mkdeb.sh 1.75 KB
Newer Older
1
#!/bin/sh
netblue30's avatar
netblue30 committed
2
# based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
netblue30's avatar
netblue30 committed
3 4 5
# a code archive should already be available

TOP=`pwd`
6
CODE_ARCHIVE="$1-$2.tar.xz"
netblue30's avatar
netblue30 committed
7
CODE_DIR="$1-$2"
8 9
INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian"
DEBIAN_CTRL_DIR="${DEBIAN_CTRL_DIR}${CODE_DIR}/debian/DEBIAN"
netblue30's avatar
netblue30 committed
10 11 12 13 14 15 16

echo "*****************************************"
echo "code archive: $CODE_ARCHIVE"
echo "code directory: $CODE_DIR"
echo "install directory: $INSTALL_DIR"
echo "debian control directory: $DEBIAN_CTRL_DIR"
echo "*****************************************"
netblue30's avatar
netblue30 committed
17

18
tar -xJvf $CODE_ARCHIVE
netblue30's avatar
netblue30 committed
19
#mkdir -p $INSTALL_DIR
netblue30's avatar
netblue30 committed
20
cd $CODE_DIR
21
./configure --prefix=/usr
22
make -j2
netblue30's avatar
netblue30 committed
23 24
mkdir debian
DESTDIR=debian make install-strip
netblue30's avatar
netblue30 committed
25 26 27

cd ..
echo "*****************************************"
netblue30's avatar
netblue30 committed
28
SIZE=`du -s $INSTALL_DIR`
netblue30's avatar
netblue30 committed
29 30 31
echo "install size $SIZE"
echo "*****************************************"

netblue30's avatar
netblue30 committed
32
mv $INSTALL_DIR/usr/share/doc/firejail/RELNOTES $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
33
gzip -9 -n $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
netblue30's avatar
netblue30 committed
34
rm $INSTALL_DIR/usr/share/doc/firejail/COPYING
35
install -m644 platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/.
netblue30's avatar
netblue30 committed
36
mkdir -p $DEBIAN_CTRL_DIR
37
sed "s/FIREJAILVER/$2/g"  platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH) > $DEBIAN_CTRL_DIR/control
netblue30's avatar
netblue30 committed
38

39
mkdir -p $INSTALL_DIR/usr/share/lintian/overrides/
40
install -m644 platform/debian/firejail.lintian-overrides $INSTALL_DIR/usr/share/lintian/overrides/firejail
netblue30's avatar
netblue30 committed
41

42
find $INSTALL_DIR/etc -type f | sed "s,^$INSTALL_DIR,," | LC_ALL=C sort > $DEBIAN_CTRL_DIR/conffiles
43
chmod 644 $DEBIAN_CTRL_DIR/conffiles
netblue30's avatar
netblue30 committed
44 45 46
find $INSTALL_DIR  -type d | xargs chmod 755
cd $CODE_DIR
fakeroot dpkg-deb --build debian
47
lintian debian.deb
48
mv debian.deb ../firejail_$2_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb
netblue30's avatar
netblue30 committed
49
cd ..
netblue30's avatar
netblue30 committed
50
rm -fr $CODE_DIR