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
|
#!/usr/bin/make -f
VERSION := $(shell dpkg-parsechangelog | grep -x "Version:.*" | sed 's@Version: \(.\+\)-.\+@\1@')
EXTRA_SHARED_FLAGS=-Wl,-soname,libflint-$(VERSION).so
MAKE_OVERRIDE = AT= QUIET_CXX= QUIET_CC= QUIET_AR= INCS=-I$(CURDIR) \
ABI_FLAG='$(LDFLAGS)'
%:
dh $@ --parallel
# upstream Makefile has only CFLAGS, not CPPFLAGS and not even CXXFLAGS, so
# inject flags using configure. let's hope CFLAGS will always be good enough
# even for $(CXX)
override_dh_auto_configure:
./configure --prefix="/usr" --with-ntl CFLAGS='$(CPPFLAGS) $(CFLAGS)'
sed -i Makefile -e "/^FLINT_LIB\>=/s/libflint/libflint-$(VERSION)/"
override_dh_auto_build:
dh_auto_build --parallel -- $(MAKE_OVERRIDE) \
EXTRA_SHARED_FLAGS="$(EXTRA_SHARED_FLAGS)"
(cd doc/latex && make)
override_dh_auto_clean:
rm -f doc/latex/flint-manual.pdf
dh_auto_clean
override_dh_auto_test:
dh_auto_test --parallel -- $(MAKE_OVERRIDE)
override_dh_auto_install:
dh_auto_install
ln -sf libflint-$(VERSION).so debian/tmp/usr/lib/libflint.so
override_dh_installchangelogs:
dh_installchangelogs NEWS
|