#!/usr/bin/make -f # -*- makefile -*- DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) export SOURCE_DATE_EPOCH = \ $(shell date -d "$$(dpkg-parsechangelog -c 1 -S Date)" +%s) -include /usr/share/dpkg/buildflags.mk INSTALLDIR = $(CURDIR)/debian/tmp _prefix = /usr _datadir = $(_prefix)/share _docdir = $(_datadir)/doc configure: configure-stamp configure-stamp: dh_testdir [ ! -r src/Makefile.save ] && cp -p src/Makefile src/Makefile.save || : # Fix bad permissions find . '(' -name '*.h' -o -name '*.c' -o -name '*.cpp' -o \ -name '*.cc' ')' -exec chmod 644 {} ';' chmod 644 LICENSE RELEASE-NOTES # Remove -L/usr/lib and -L/usr/lib64 since they may cause problems sed -e 's!-L$$([A-Z_]*)/lib!!' \ -e 's!-L$$([A-Z_]*)/$$(LIBDIR)!!' -i src/Makefile # Remove gsoap version from library names sed -e 's!$$(GSOAP_VERSION)!!g' -i src/Makefile touch $@ build: build-indep build-arch build-indep: build-stamp build-arch: build-stamp build-stamp: configure-stamp dh_testdir . ./VERSION && \ cd src && \ $(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC -I. `pkg-config --cflags gsoap`" \ SHLIBLDFLAGS="$(LDFLAGS) -shared" \ USE_VOMS=yes WITH_EMI=yes WITH_CPP_LIBS=yes \ LIBDIR=lib/$(DEB_HOST_MULTIARCH) VERSION=$$VERSION all doc touch $@ clean: dh_testdir dh_testroot . ./VERSION && \ cd src && \ $(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC -I. `pkg-config --cflags gsoap`" \ SHLIBLDFLAGS="$(LDFLAGS) -shared" \ USE_VOMS=yes WITH_EMI=yes WITH_CPP_LIBS=yes \ LIBDIR=lib/$(DEB_HOST_MULTIARCH) VERSION=$$VERSION clean rm -rf src/html rm -rf src/man rm -f src/doxygen_sqlite3.db rm -rf src/*.a rm -rf src/*.so [ -r src/Makefile.save ] && mv src/Makefile.save src/Makefile || : rm -f build-stamp configure-stamp dh_clean install: build-stamp dh_testdir dh_testroot dh_prep # Yes, the makefile uses RPM_BUILD_ROOT instead of the normal DESTDIR . ./VERSION && \ cd src && \ $(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC -I. `pkg-config --cflags gsoap`" \ SHLIBLDFLAGS="$(LDFLAGS) -shared" \ USE_VOMS=yes WITH_EMI=yes WITH_CPP_LIBS=yes \ LIBDIR=lib/$(DEB_HOST_MULTIARCH) VERSION=$$VERSION \ RPM_BUILD_ROOT=$(INSTALLDIR) install install.man mkdir -p $(INSTALLDIR)$(_docdir)/libcgsi-gsoap-dev mv $(INSTALLDIR)$(_docdir)/CGSI/html \ $(INSTALLDIR)$(_docdir)/libcgsi-gsoap-dev binary-indep: binary-arch: install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_install dh_missing --fail-missing dh_installman dh_lintian dh_link dh_strip --dbgsym-migration='libcgsi-gsoap-dbg (<< 1.3.10-3~)' dh_compress dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps if [ -r /usr/lib/$(DEB_HOST_MULTIARCH)/libgsoap.so ] ; then \ GSOAPLIB=`readlink /usr/lib/$(DEB_HOST_MULTIARCH)/libgsoap.so` ; \ else \ GSOAPLIB=`readlink /usr/lib/libgsoap.so` ; \ fi && \ GSOAPPKG=`dpkg -S $$GSOAPLIB | sed 's/:.*//'` && \ echo "gsoap:Depends=$$GSOAPPKG" >> debian/libcgsi-gsoap1.substvars MINGSOAPVER=`dpkg-query -W -f '$${source:Upstream-Version}' libgsoap-dev` && \ LASTNUM=`echo $$MINGSOAPVER | sed 's/.*\.//'` && \ LASTNUMP1=$$(($$LASTNUM + 1)) && \ MAXGSOAPVER=`echo $$MINGSOAPVER | sed s/$$LASTNUM$$/$$LASTNUMP1/` && \ echo "gsoap:Depends=libgsoap-dev (>= $$MINGSOAPVER), libgsoap-dev (<< $$MAXGSOAPVER)" \ >> debian/libcgsi-gsoap-dev.substvars dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .Phony: binary binary-arch binary-indep build build-arch build-indep clean configure install