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
|
#!/usr/bin/make -f
PACKAGE=teem
# DPatch
DEB_SOURCE_PACKAGE:=$(PACKAGE)
include /usr/share/dpatch/dpatch.make
# Uncomment this to turn on verbose mode.
export DH_VERBOSE = 1
STATIC_BUILD_PATH = DEB_build_static
SHARED_BUILD_PATH = DEB_build_shared
CMAKE_FLAGS = -DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed" \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DBUILD_EXPERIMENTAL_APPS:BOOL=OFF \
-DBUILD_EXPERIMENTAL_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
export CFLAGS
# set the number of build jobs
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
JOBS := -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
get-orig-source:
. debian/get-orig-source
configure: configure-stamp
configure-stamp: patch-stamp
dh_testdir
# Add here commands to configure the package.
if [ ! -d $(STATIC_BUILD_PATH) ]; then mkdir $(STATIC_BUILD_PATH); fi
if [ ! -d $(SHARED_BUILD_PATH) ]; then mkdir $(SHARED_BUILD_PATH); fi
cd $(STATIC_BUILD_PATH) \
&& cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=OFF
cd $(SHARED_BUILD_PATH) \
&& cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=ON
touch configure-stamp
build: build-arch
build-arch: build-arch-stamp
build-arch-stamp: configure
dh_testdir
# Add here commands to compile the package.
# build static libs
$(MAKE) $(JOBS) -C $(STATIC_BUILD_PATH)
# build shared libs and binaries
$(MAKE) $(JOBS) -C $(SHARED_BUILD_PATH)
# - cd $(SHARED_BUILD_PATH) && ctest -D Nightly -VV
touch $@
build-indep: build-indep-stamp
build-indep-stamp: configure
dh_testdir
# generate documentation
doxygen debian/Doxyfile
# remove zero byte files
find doc/ -depth -empty | xargs rm -rf
touch $@
clean: clean-patched unpatch
clean-patched:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp docs-stamp build-indep-stamp build-arch-stamp
# Add here commands to clean up after the build process.
rm -rf $(STATIC_BUILD_PATH)
rm -rf $(SHARED_BUILD_PATH)
rm -rf doc
dh_clean
install: install-indep install-arch
install-indep: build-indep
dh_install -pteem-doc doc/* usr/share/doc/teem-doc
install-arch: build-arch
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp
# install binaries and shared libs
$(MAKE) $(JOBS) -C $(SHARED_BUILD_PATH) install DESTDIR=$(CURDIR)/debian/tmp
# install static libs
cd $(STATIC_BUILD_PATH)/bin/ \
&& cp libteem.a $(CURDIR)/debian/tmp/usr/lib/
d-shlibmove \
--commit \
--override s/libbz2-1.0-dev/libbz2-dev/ \
--movedev "debian/tmp/usr/include/teem/*" usr/include/teem \
debian/tmp/usr/lib/libteem.so
dh_install -plibteem1-dev debian/tmp/usr/lib/Teem-1.10.0 usr/lib
dh_install -pteem-apps debian/tmp/usr/bin/* usr/bin
dh_installman
# dpkg-gensymbols -v1.10.0 -plibteem1 -Pdebian/libteem1 -Odebian/libteem1.symbols
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
# Build architecture-dependent files here.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install --sourcedir=$(CURDIR)/debian/tmp
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
|