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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess.
#
# This version is for a multibinary package. It also allows you to build any
# of the binary packages independantly, via binary-<package> targets.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
export DH_COMPAT=3
# This has to be exported to make some magic below work.
export DH_OPTIONS
# Changes from a standard boost build include:
#
# - build jam binary in fixed location, rather than in .../bin.${SYSTEM}
# - use modified version of gcc-stlport-tools.jam file
# - build libraries into subdirectory rooted at "debian-build"
# (easier to clean up, and to find the libraries that got built)
# Boost does not guarantee any ABI, so we use full version in SONAME version
SOVERSION=1.27
# Locations of static libs.
static_regex = debian-build/libs/regex/build/bin/libboost_regex.a/debian/release/runtime-link-dynamic/libboost_regex.a
static_thread = debian-build/libs/thread/build/bin/libboost_thread/debian/release/runtime-link-dynamic/threading-multi/libboost_thread.a
static_graph = libs/graph/src/libbgl-viz.a
# locations of shared libs.
shared_regex = debian-build/libs/regex/build/bin/libboost_regex.so/debian/release/runtime-link-dynamic/shared-linkable-true/libboost_regex.so
shared_python = debian-build/libs/python/build/bin/libboost_python/debian/release/runtime-link-dynamic/shared-linkable-true/libboost_python.so
shared_graph = libs/graph/src/libbgl-viz.so.$(SOVERSION)
htmldir = debian/libboost-dev/usr/share/doc/libboost-dev/HTML
JAM = tools/build/jam_src/bin/jam -sTOOLS="debian" -sBUILD=release -sBOOST_ROOT=. -d2
tools/build/jam_src/bin/jam:
$(MAKE) -C tools/build/jam_src LOCATE_TARGET=bin
build: build-stamp
build-stamp: tools/build/jam_src/bin/jam
dh_testdir
echo GCC version `g++ --version`
# This seems like a good idea, but it messed up when I tried it.
# cd libs/config && ./configure
# mv libs/config/user.hpp boost/config
# Build most of the stuff with jam
$(JAM) -sALL_LOCATE_TARGET=`pwd`/debian-build -sPYTHON_VERSION=2.1 -sPYTHON_ROOT=/usr -sSOVERSION=$(SOVERSION)
# Build the graph library with upstream makefile
$(MAKE) -C libs/graph/src libbgl-viz.a
cd libs/graph/src && rm -f *.o *.output graphviz_digraph_parser.cpp graphviz_graph_parser.cpp graphviz_lex.cpp graphviz_parser.h
$(MAKE) -C libs/graph/src EXTRAFLAGS='-fPIC' GRAPH_SONAME_VERSION=$(SOVERSION) libbgl-viz.so
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
-$(JAM) clean
rm -rf tools/build/jam_src/bin
rm -f tools/build/jam_src/jam0
rm -rf debian-build
$(MAKE) -C libs/graph/src clean
# Do not need to track changes done to built files.
# rm -f boost/config/user.hpp
rm -f libs/config/config.{log,status}
rm -f libs/graph/src/graphviz_parser.tab.{c,h}
# rm -f tools/build/jam_src/jamgram.{c,h}
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs --all usr/include usr/lib
# package libboost-dev
rm -rf debian/libboost-dev/usr/include/boost
cp -a boost debian/libboost-dev/usr/include/boost
rm -f debian/libboost-dev/usr/include/boost/pool/detail/*.bat
rm -f debian/libboost-dev/usr/include/boost/pool/detail/*.m4
rm -f debian/libboost-dev/usr/include/boost/pool/detail/*.sh
cp $(static_thread) debian/libboost-dev/usr/lib
mkdir -p $(htmldir)
find * -name '*.html' | xargs cp -a --parents --target-directory=$(htmldir)
find * -name '*.htm' | xargs cp -a --parents --target-directory=$(htmldir)
cp -a c++boost.gif more people $(htmldir)
# package libboost-regex$(SOVERSION)
cp $(shared_regex) \
debian/libboost-regex$(SOVERSION)/usr/lib/libboost_regex.so.$(SOVERSION)
# package libboost-regex-dev
mkdir -p debian/libboost-regex-dev/usr/include/boost
mv debian/libboost-dev/usr/include/boost/*regex* \
debian/libboost-regex-dev/usr/include/boost
cp $(static_regex) debian/libboost-regex-dev/usr/lib
ln -s libboost_regex.so.$(SOVERSION) \
debian/libboost-regex-dev/usr/lib/libboost_regex.so
# package libboost-python$(SOVERSION)
cp $(shared_python) \
debian/libboost-python$(SOVERSION)/usr/lib/libboost_python.so.$(SOVERSION)
# package libboost-python-dev
mkdir -p debian/libboost-python-dev/usr/include/boost
mv debian/libboost-dev/usr/include/boost/python \
debian/libboost-python-dev/usr/include/boost
ln -s libboost_python.so.$(SOVERSION) \
debian/libboost-python-dev/usr/lib/libboost_python.so
# package libboost-graph$(SOVERSION)
cp $(shared_graph) \
debian/libboost-graph$(SOVERSION)/usr/lib/libbgl-viz.so.$(SOVERSION)
# package libboost-graph-dev
mkdir -p debian/libboost-graph-dev/usr/include/boost
mv debian/libboost-dev/usr/include/boost/graph \
debian/libboost-graph-dev/usr/include/boost
cp $(static_graph) debian/libboost-graph-dev/usr/lib
ln -s libbgl-viz.so.$(SOVERSION) \
debian/libboost-graph-dev/usr/lib/libbgl-viz.so
# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common:
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs README
dh_installexamples
dh_installinfo
dh_installchangelogs
dh_strip
dh_link
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build install
# (Uncomment this next line if you have such packages.)
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build install
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
# Any other binary targets build just one binary package at a time.
binary-%: build install
make -f debian/rules binary-common DH_OPTIONS=-p$*
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|