-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-virtualmin
executable file
·118 lines (101 loc) · 3.09 KB
/
build-virtualmin
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# Build Pro packages
m="virtual-server"
cd $HOME/build/webmin/
if [ ! -d virtualmin-gpl ]; then
git clone "[email protected]:virtualmin/virtualmin-gpl.git"
else
cd virtualmin-gpl
git pull
cd ..
fi
if [ ! -d virtualmin-pro ]; then
git clone "[email protected]:virtualmin/virtualmin-pro.git"
else
cd virtualmin-pro
git pull
cd ..
fi
cd virtualmin-gpl
echo "Back in $(pwd)"
# Link in Pro
if [ ! -h pro ]; then
ln -s ../virtualmin-pro pro
fi
# Get latest version
#ver=$(git describe --tags --abbrev=0)
ver=$(git tag --sort=committerdate | tail -1 |cut -d'-' -f1)
rel=$(git tag --sort=committerdate | tail -1 |cut -d'-' -s -f2)
if [ -z $rel ]; then
rel=1
git checkout tags/$ver
else
git checkout tags/$ver-$rel
fi
old_ver=$(cat "$HOME/build/lastvers/$m")
echo "Version: $ver"
echo "Release: $rel"
sleep 1
# This does not handle releases. Argh.
if [ true ]; then
#if [ $(echo $ver'>'$old_ver | bc -l) == 1 ]; then
publish=1
echo "$m: Newer version found, building."
cd $HOME/build/webmin
# Link it so name is right
if [ ! -h $m ]; then
rm $m
ln -sf virtualmin-gpl $m
fi
## Pro Packages
# Debian package
makemoduledeb.pl --licence "Copyright Virtualmin, Inc." --email "[email protected]" --allow-overwrite --target-dir tmp $m "$ver.pro-$rel"
# RPM package
makemodulerpm.pl --licence "Copyright Virtualmin, Inc." --allow-overwrite --epoch 3 --rpm-dir $HOME/rpmbuild --target-dir tmp $m "$ver.pro" --release "$rel"
# wbm
create-module.pl "tmp/$m-$ver.pro-$rel.wbm.gz" "$m"
# Copy into place
aptly repo add virtualmin-universal tmp/*.deb
aptly repo add virtualmin-7-pro tmp/*.deb
sign-with vm6 tmp/*.rpm
cp tmp/*.rpm $HOME/result/vm/6/universal/
sign-with vm7 tmp/*.rpm
cp tmp/*.rpm $HOME/result/vm/7/pro/rpm/noarch/
cp tmp/*.wbm.gz $HOME/result/vm/6/wbm
cp tmp/*.wbm.gz $HOME/result/vm/7/wbm
# Cleanup Pro
rm tmp/*
# Debian package
makemoduledeb.pl --licence "Copyright Virtualmin, Inc." --exclude pro --email "[email protected]" --allow-overwrite --target-dir tmp $m "$ver.gpl-$rel"
## Package GPL rpm
makemodulerpm.pl --licence "Copyright Virtualmin, Inc." --exclude pro --allow-overwrite --epoch 3 --rpm-dir $HOME/rpmbuild --target-dir tmp $m "$ver.gpl" --release $rel
# Download GPL
#wget -P tmp/ https://download.webmin.com/download/virtualmin/virtual-server-$ver.gpl.wbm.gz
# wbm
create-module.pl --exclude pro "tmp/$m-$ver.gpl-$rel.wbm.gz" "$m"
# Copy into place
aptly repo add virtualmin-gpl-universal tmp/*gpl*.deb
aptly repo add virtualmin-7-gpl tmp/*gpl*.deb
sign-with vm6 tmp/*.rpm
cp tmp/*gpl*.rpm $HOME/result/vm/6/gpl/universal/
sign-with vm7 tmp/*.rpm
cp tmp/*gpl*.rpm $HOME/result/vm/7/gpl/rpm/noarch
cp tmp/*gpl*.wbm.gz $HOME/result/vm/6/gpl/wbm
cp tmp/*gpl*.wbm.gz $HOME/result/vm/7/gpl/wbm
# Cleanup
rm tmp/*
# Bump rev in lastvers
echo "$ver" > "$HOME/build/lastvers/$m"
else
echo "No new version found."
publish=0
fi
echo "$m git version: $ver"
echo "$m old version: $old_ver"
exit 0
if [ $publish -eq 1 ]; then
# update-universal-apt
publish-universal
updatevm7rpm.sh
rsync-repos.sh
fi