-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-packages
executable file
·92 lines (77 loc) · 2.02 KB
/
build-packages
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
#!/bin/sh -e
if [ -z "$KEY_ID" ]; then
KEY_ID="4F23A0260F19DAC5"
fi
release=`lsb_release -c | awk '{print $2}'`
if [ -z "$release" ]; then
echo "could not get release codename, exit"
exit 1
fi
id=`lsb_release -i | awk '{print $3}'`
if [ -z "$id" ]; then
echo "could not get distribution id, exit"
exit 1
fi
case "$id" in
debian | Debian )
releases="bookworm trixie sid"
id=debian
;;
ubuntu | Ubuntu )
releases="focal jammy noble"
id=ubuntu
;;
* )
echo "Unknown distribution id $id"
exit 1
;;
esac
if [ "$nosign" = "" ]; then
echo "Signing dummy file"
rm -f /tmp/dummy.$$*
touch /tmp/dummy.$$
gpg --default-key $KEY_ID --sign /tmp/dummy.$$
fi
if [ -d .git ]; then
rm debian/changelog debian/control
git checkout debian/changelog debian/control
fi
if [ -f Makefile.PL ]; then
rm -f Makefile
fi
rm -rf .pc
for what in $release; do
sed -i "s%~unstable%~$what%g" debian/changelog debian/control
sed -i "s%) unstable;%) $what;%g" debian/changelog
dpkg-buildpackage -i -I -k$KEY_ID
if [ -d .git ]; then
rm debian/changelog debian/control
git checkout debian/changelog debian/control
else
sed -i "s%~$what%~unstable%g" debian/changelog debian/control
sed -i "s%) $what;%) unstable;%g" debian/changelog
fi
done
for what in $releases; do
sed -i "s%~unstable%~$what%g" debian/changelog debian/control
sed -i "s%) unstable;%) $what;%g" debian/changelog
case "$id" in
debian )
dpkg-buildpackage -d -i -I -k$KEY_ID
;;
ubuntu )
dpkg-buildpackage -i -I -S -k$KEY_ID
;;
* )
exit 1
;;
esac
if [ -d .git ]; then
rm debian/changelog debian/control
git checkout debian/changelog debian/control
else
sed -i "s%~$what%~unstable%g" debian/changelog debian/control
sed -i "s%) $what;%) unstable;%g" debian/changelog
fi
done
echo "ok"