-
Notifications
You must be signed in to change notification settings - Fork 0
/
new-usermin
executable file
·83 lines (75 loc) · 2.43 KB
/
new-usermin
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
#!/bin/sh
if [ -z $1 ]; then
echo "No version provided. Exiting."
exit 1
fi
ver=$1
# XXX This will fail on devel releases
oldver=`bc <<< "scale=4; ${ver}-0.020"`
if [ -z $2 ]; then
rel=1
else
rel=$2
fi
prog=usermin
rpmname=${prog}-${ver}-${rel}
# RPM
cd ${HOME}/result/universal
curl -L -O http://prdownloads.sourceforge.net/webadmin/${rpmname}.noarch.rpm
#old=`repomanage --keep=2 --old . | grep ${prog}`
#rm -f $old
cd ${HOME}/result/gpl/universal
ln -sf ../../universal/${rpmname}.noarch.rpm .
rm -f $old
for vmver in 6; do
cd ${HOME}/result/universal
cp ${rpmname}.noarch.rpm ${HOME}/result/vm/$vmver/universal
cd ${HOME}/result/vm/$vmver/universal
rm -f $old
cd ${HOME}/result/vm/$vmver/gpl/universal
ln -sf ../../universal/${rpmname}.noarch.rpm .
rm -f $old
done
for vmver in 7; do
cd ${HOME}/result/universal
cp ${rpmname}.noarch.rpm ${HOME}/result/vm/$vmver/pro/rpm/noarch
cp ${rpmname}.noarch.rpm ${HOME}/result/vm/$vmver/gpl/rpm/noarch
cd ${HOME}/result/vm/$vmver/pro/rpm/noarch
rm -f $old
cd ${HOME}/result/vm/$vmver/gpl/rpm/noarch
rm -f $old
done
# tarball
cd ${HOME}/result/wbm
curl -L -O http://prdownloads.sourceforge.net/webadmin/${prog}-${ver}.tar.gz
rm ${prog}-${oldver}.tar.gz
cd ${HOME}/result/gpl/wbm
ln -s ../../wbm/${prog}-${ver}.tar.gz
del-broken-links
for vmver in 6 7; do
cd ${HOME}/result/vm/$vmver/wbm
rm -f ${prog}-${oldver}.tar.gz
ln -s ../../../wbm/${prog}-${ver}.tar.gz
del-broken-links
cd ${HOME}/result/vm/$vmver/wbm
rm -f ${prog}-${oldver}.tar.gz
ln -s ../../../../gpl/wbm/${prog}-${ver}.tar.gz
del-broken-links
done
# Deb
cd ${HOME}/result/debian/dists/virtualmin-universal/main/binary-i386
curl -L -O http://prdownloads.sourceforge.net/webadmin/${prog}_${ver}_all.deb
cp ${prog}_${ver}_all.deb ../binary-amd64
rm ${prog}_${oldver}_all.deb
cp ${prog}_${ver}_all.deb ${HOME}/result/gpl/debian/dists/virtualmin-universal/main/binary-i386
cp ${prog}_${ver}_all.deb ${HOME}/result/gpl/debian/dists/virtualmin-universal/main/binary-amd64
cd ../binary-amd64
rm ${prog}_${oldver}_all.deb
cd ${HOME}/result/gpl/debian/dists/virtualmin-universal/main/binary-i386
del-broken-links
cd ${HOME}/result/gpl/debian/dists/virtualmin-universal/main/binary-amd64
del-broken-links
aptly repo add virtualmin-universal ${prog}_${ver}_all.deb
aptly repo add virtualmin-gpl-universal ${prog}_${ver}_all.deb
aptly repo add virtualmin-7-pro ${prog}_${ver}_all.deb
aptly repo add virtualmin-7-gpl ${prog}_${ver}_all.deb