forked from netblue30/firejail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdeb.sh
executable file
·55 lines (41 loc) · 1.46 KB
/
mkdeb.sh
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
#!/bin/bash
# based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
# a code archive should already be available
TOP=`pwd`
CODE_ARCHIVE="$1-$2.tar.bz2"
CODE_DIR="$1-$2"
INSTALL_DIR+="$CODE_DIR/debian"
DEBIAN_CTRL_DIR+="$CODE_DIR/debian/DEBIAN"
echo "*****************************************"
echo "code archive: $CODE_ARCHIVE"
echo "code directory: $CODE_DIR"
echo "install directory: $INSTALL_DIR"
echo "debian control directory: $DEBIAN_CTRL_DIR"
echo "*****************************************"
tar -xjvf $CODE_ARCHIVE
#mkdir -p $INSTALL_DIR
cd $CODE_DIR
./configure --prefix=/usr
make
mkdir debian
DESTDIR=debian make install-strip
cd ..
echo "*****************************************"
SIZE=`du -s $INSTALL_DIR`
echo "install size $SIZE"
echo "*****************************************"
mv $INSTALL_DIR/usr/share/doc/firejail/RELNOTES $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
gzip -9 $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
rm $INSTALL_DIR/usr/share/doc/firejail/COPYING
cp platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/.
mkdir -p $DEBIAN_CTRL_DIR
sed "s/FIREJAILVER/$2/g" platform/debian/control > $DEBIAN_CTRL_DIR/control
cp platform/debian/conffiles $DEBIAN_CTRL_DIR/.
find $INSTALL_DIR -type d | xargs chmod 755
cd $CODE_DIR
fakeroot dpkg-deb --build debian
lintian debian.deb
mv debian.deb ../firejail_$2_1_amd64.deb
echo "if building a 32bit package, rename the deb file manually"
cd ..
rm -fr $CODE_DIR