#!/bin/bash
export DEBVERSION=1.58.0-1
if [ ! -d "boost_1_58_0" ]; then
wget "http://nchc.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2" -O boost_1_58_0.tar.bz2
tar xjvf boost_1_58_0.tar.bz2
fi
cd boost_1_58_0
:<<BLOCK
'export DEBVERSION=1.60.0-1
if [ ! -d "boost_1_60_0" ]; then
wget "http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2" -O boost-all_1.60.0.orig.tar.bz2
tar xjvf boost-all_1.60.0.orig.tar.bz2
fi
cd boost_1_60_0
'
BLOCK
#Build DEB
rm -rf debian
mkdir -p debian
#Use the LICENSE file from nodejs as copying file
touch debian/copying
#Create the changelog (no messages needed)
dch --create -v $DEBVERSION --package libboost-all ""
#Create copyright file
touch debian
#Create control file
cat > debian/control <<EOF
Source: libboost-all
Maintainer: LongSky <wangqiang1588@sina.com>
Section: misc
Priority: optional
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 8), cdbs, libbz2-dev, zlib1g-dev
Package: libboost-all
Architecture: arm64
Depends: \${shlibs:Depends}, \${misc:Depends}, libboost-all (= $DEBVERSION)
Description: Boost library, version $DEBVERSION (shared libraries)
Package: libboost-all-dev
Architecture: any
Depends: libboost-all (= $DEBVERSION)
Description: Boost library, version $DEBVERSION (development files)
Package: libboost-build
Architecture: any
Depends: \${misc:Depends}
Description: Boost Build v2 executable
EOF
#Create rules file
cat > debian/rules <<EOF
#!/usr/bin/make -f
%:
dh \$@
override_dh_auto_configure:
./bootstrap.sh
override_dh_auto_build:
./b2 link=static,shared -j 1 --prefix=`pwd`/debian/libboost-all/usr/
override_dh_auto_test:
override_dh_auto_install:
mkdir -p debian/libboost-all/usr debian/libboost-all-dev/usr debian/libboost-build/usr/bin
./b2 link=static,shared --prefix=`pwd`/debian/libboost-all/usr/ install
mv debian/libboost-all/usr/include debian/libboost-all-dev/usr
cp b2 debian/libboost-build/usr/bin
./b2 install --prefix=`pwd`/debian/libboost-build/usr/ install
EOF
#Create some misc files
echo "8" > debian/compat
mkdir -p debian/source
echo "3.0 (quilt)" > debian/source/format
#Build the package
nice -n19 ionice -c3 debuild -b -d -uc -us