-
Notifications
You must be signed in to change notification settings - Fork 8
/
fetch-rpms
executable file
·104 lines (87 loc) · 2.12 KB
/
fetch-rpms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#! /bin/bash
qt_rpms() {
local version="$1"
local arch="$2"
cat <<-EOF
qt47-${QTVER}.el${version}.${arch}.rpm
qt47-assistant-${QTVER}.el${version}.${arch}.rpm
qt47-config-${QTVER}.el${version}.${arch}.rpm
qt47-demos-${QTVER}.el${version}.${arch}.rpm
qt47-designer-plugin-phonon-${QTVER}.el${version}.${arch}.rpm
qt47-devel-${QTVER}.el${version}.${arch}.rpm
qt47-examples-${QTVER}.el${version}.${arch}.rpm
qt47-mysql-${QTVER}.el${version}.${arch}.rpm
qt47-odbc-${QTVER}.el${version}.${arch}.rpm
qt47-postgresql-${QTVER}.el${version}.${arch}.rpm
qt47-tds-${QTVER}.el${version}.${arch}.rpm
qt47-webkit-${QTVER}.el${version}.${arch}.rpm
qt47-webkit-devel-${QTVER}.el${version}.${arch}.rpm
qt47-x11-${QTVER}.el${version}.${arch}.rpm
phonon-backend-gstreamer-${QTVER}.el${version}.${arch}.rpm
EOF
}
sqlite_rpms() {
local version="$1"
local arch="$2"
cat <<-EOF
sqlite-3.6.20-1.el${version}.${arch}.rpm
sqlite-devel-3.6.20-1.el${version}.${arch}.rpm
EOF
}
run() {
echo "$@"
[ "${DRYRUN}" != "" ] || "$@"
}
fetch() {
local baseurl="$1"
local pkg="$2"
run rm -f "${pkg}"
run wget "${baseurl}/${pkg}"
}
set_basearch() {
local arch="$1"
case "$arch" in
i386|i686)
basearch="i386"
;;
x86_64)
basearch="x86_64"
;;
esac
}
set_archs() {
local version="$1"
case "$version" in
5)
archs=(x86_64 i386)
;;
6)
archs=(x86_64 i686)
;;
esac
}
set_pkgs() {
local version="$1"
local arch="$2"
pkgs=$(qt_rpms "${version}" "${arch}")
if [ "${version}" == 5 ]; then
pkgs="${pkgs} $(sqlite_rpms "${version}" "${arch}")"
fi
}
set -e
readonly QTVER=4.7.2-1_18
readonly BASEDIR=$(cd $(dirname "$0"); pwd)
readonly VERSIONS=(5 6)
for version in "${VERSIONS[@]}" ; do
set_archs "${version}"
for arch in "${archs[@]}"; do
set_basearch "${arch}"
set_pkgs "${version}" "${arch}"
baseurl="http://dl.atrpms.net/el${version}-${basearch}/atrpms/testing"
mkdir -p "${BASEDIR}/RPMS/el/${version}/${basearch}"
cd "${BASEDIR}/RPMS/el/${version}/${basearch}"
for pkg in ${pkgs}; do
fetch "${baseurl}" "${pkg}"
done
done
done