#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS=hardening=+all # Variables declaration ABI_VERSION=1 VERSION=$(shell cat VERSION | sed -e 's/\([0-9]*\.[0-9]*\)-[0-9]*/\1/') MAJOR_VERSION=$(shell cat VERSION | sed -e 's/\([0-9]*\)\.[0-9]*/\1/') MINOR_VERSION=$(shell cat VERSION | sed -e 's/[0-9]*\.\([0-9]*\)/\1/') SONAME=$(MAJOR_VERSION) LIBRHEOLEF=librheolef${ABI_VERSION} LIBRHEOLEF_DEV=librheolef-dev RHEOLEF_DOC=rheolef-doc RHEOLEF_RUNTIME=rheolef TMPDIR=debian/tmp-rheolef # compilation flags CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) CXXFLAGS := -O3 -g $(shell dpkg-buildflags --get CXXFLAGS | sed -e 's/-O2/-O3/' -e 's/-g//') LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) $(CXXFLAGS) CFLAGS := $(CXXFLAGS}) %: dh $@ override_dh_autoreconf: # Prepare the debian control files necessary for the creation of the packages cat debian/shlibs.librheolef1.X | \ sed -e "s/\@LIBRHEOLEF\@/$(LIBRHEOLEF)/g" \ -e "s/\@MAJOR_VERSION\@/$(MAJOR_VERSION)/g" \ -e "s/\@MINOR_VERSION\@/$(MINOR_VERSION)/g" \ -e "s/\@VERSION\@/$(VERSION)/g" \ -e "s/\@SONAME\@/$(SONAME)/g" > debian/shlibs.$(LIBRHEOLEF) echo 'shlibs:Depends=libc6 (>= 2.7-1), libgcc1 (>= 1:4.3.1-9), libstdc++6 (>= 4.3.1-9)' > debian/$(LIBRHEOLEF).substvars ./bootstrap override_dh_auto_configure: ./bootstrap CXX=g++ CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" dh_auto_configure -- --disable-optim --enable-debian-packaging --enable-fast-install --disable-ginac --without-trilinos-libdir --enable-permissive override_dh_auto_clean: dh_auto_clean # removing installation directories rm -Rf $(TMPDIR) # removing and/or reinitialising files generated after templates # rm -f debian/shlibs.local override_dh_auto_test: # dh_auto_test --no-parallel # -> will be supported with the forthcoming rheolef-7.0 upstream version true override_dh_auto_install: make install DESTDIR=$(CURDIR)/$(TMPDIR) dh_movefiles --sourcedir=$(TMPDIR) # removing some useless progs rm -f $(TMPDIR)/usr/bin/doc2man rm -f $(TMPDIR)/usr/bin/doc2texi rm -f $(TMPDIR)/usr/bin/doc2oxy # remove info/dir rm -f $(TMPDIR)/usr/share/info/dir* # delete rpath (debian policy) if any: - chrpath -d $(TMPDIR)/usr/bin/branch - chrpath -d $(TMPDIR)/usr/bin/field - chrpath -d $(TMPDIR)/usr/bin/geo - chrpath -d $(TMPDIR)/usr/bin/csr - chrpath -d $(TMPDIR)/usr/lib/*/librheolef.*so* - chrpath -d $(TMPDIR)/usr/lib/*/rheolef/mkgeo_* - chrpath -d $(TMPDIR)/usr/lib/*/rheolef/msh2geo_int - chrpath -d $(TMPDIR)/usr/lib/*/rheolef/mkgeo_ball_gmsh_fix # Changing file access permissions chmod 755 $(TMPDIR)/usr/share/rheolef/check-shlibpath_var.sh override_dh_install: dh_install --sourcedir=$(TMPDIR) override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params="--ignore-missing-info" override_dh_installchangelogs: dh_installchangelogs ChangeLog override_dh_compress: dh_compress -X.pdf -Xexamples/ override_dh_gencontrol: dh_gencontrol --dpkg-gencontrol-params="-Tdebian/$(LIBRHEOLEF).substvars"