-
Notifications
You must be signed in to change notification settings - Fork 4
/
makePackage
executable file
·58 lines (44 loc) · 1020 Bytes
/
makePackage
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
#!/bin/bash
CONTROL_FILE="debian/DEBIAN/control"
PACKAGE="libnexus"
INSTALL_BASE="debian/usr/local"
if [ $# != 1 ]; then
echo "makePackage <version>"
exit 1
fi
clean()
{
echo "Cleaning install directory."
rm -Rf debian/usr/*
rm -Rf debian/etc/*
}
if [ $1 = clean ] ; then
clean
exit 0
fi
ARCH=`dpkg --print-architecture`
VER=$1
clean
echo `pwd`
BASE_DIR=`pwd`
mkdir $ARCH-build
cd $ARCH-build
export CXXFLAGS=""
../configure --prefix=$BASE_DIR/debian/usr/local
#make clean
make
make install
../configure
cd $BASE_DIR
rm -R debian/usr/local/include/
rm debian/usr/local/lib/*.la
rm debian/usr/local/lib/*.a
rm -R debian/usr/local/bin
# Update version in control file
echo "Setting control to version $VER"
sed -e "s/Version:.*/Version: $VER/g" <$CONTROL_FILE>tmp.file
mv tmp.file $CONTROL_FILE
echo "Setting control to Architecture $ARCH"
sed -e "s/Architecture:.*/Architecture: $ARCH/g" <$CONTROL_FILE>tmp.file
mv tmp.file $CONTROL_FILE
dpkg-deb --build debian/ "$PACKAGE-$ARCH-$VER.deb"