#!/usr/bin/make -f # -*- makefile -*- export DH_VERBOSE=1 include /usr/share/GNUstep/debian/config.mk export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow DEB_HOST_ARCH_ENDIAN ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_ENDIAN) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) %: dh $@ override_dh_auto_clean: [ ! -f config.make ] || $(MAKE) distclean [ ! -f config.make ] || (cd ActiveSync && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp GNUSTEP_INSTALLATION_DOMAIN=SYSTEM OBJCFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" messages=yes clean) rm -f config.make override_dh_auto_build: dh_auto_build -- CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(shell dpkg-buildflags --export=cmdline) messages=yes dh_auto_build -- -C ActiveSync CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(shell dpkg-buildflags --export=cmdline) messages=yes override_dh_auto_configure: ./configure --with-ssl=ssl --enable-saml2 --enable-mfa override_dh_auto_test: ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) ifeq ($(DEB_HOST_ARCH_ENDIAN),little) dh_auto_test else -dh_auto_test endif endif override_dh_auto_install: $(MAKE) DESTDIR=$(CURDIR)/debian/tmp GNUSTEP_INSTALLATION_DOMAIN=SYSTEM OBJCFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" messages=yes install (cd ActiveSync && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp GNUSTEP_INSTALLATION_DOMAIN=SYSTEM OBJCFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" messages=yes install) mkdir -p debian/tmp/etc/default debian/tmp/etc/cron.d debian/tmp/etc/logrotate.d debian/tmp/usr/share/doc/sogo debian/tmp/usr/lib/tmpfiles.d cp Scripts/sogo-default debian/tmp/etc/default/sogo cp Scripts/sogo.cron debian/tmp/etc/cron.d/sogo cp Scripts/sogo-backup.sh debian/tmp/usr/sbin/sogo-backup cp Scripts/logrotate debian/tmp/etc/logrotate.d/sogo sed -e 's|/usr/lib/GNUstep|$(GNUSTEP_SYSTEM_LIBRARY)|g' \ Apache/SOGo.conf > apache.conf cp debian/sogo.tmpfiles.d debian/tmp/usr/lib/tmpfiles.d/sogo.conf # Put arch independent files in /usr/share instead of /usr/lib mkdir -p debian/tmp/usr/share/GNUstep/SOGo mv debian/tmp/usr/lib/*/GNUstep/SOGo/Templates debian/tmp/usr/lib/*/GNUstep/SOGo/WebServerResources debian/tmp/usr/share/GNUstep/SOGo # Use packaged 3rd party javascript libraries available in Debian rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/FileSaver.min.js* rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/angular.js rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/angular.min.js* for m in animate aria cookies messages sanitize; do \ rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/angular-$$m.js \ debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/angular-$$m.min.js*; \ done rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/lodash.js rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/lodash.min.js* rm -f debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/punycode.js # CKEditor sample page (loads remote images) and build-only files cd debian/tmp/usr/share/GNUstep/SOGo/WebServerResources/js/vendor/ckeditor && \ rm -rf sample src package.json package-lock.json tsconfig.json webpack.config.js dh_install # Libraries live in a private directory, no ldconfig trigger needed. override_dh_makeshlibs: dh_makeshlibs --no-scripts override_dh_installchangelogs: dh_installchangelogs CHANGELOG.md execute_before_dh_link: # Remove the ActiveSync and API bundles in advance, otherwise dh_gnustep # will happily move its Resources to /usr/share in the sogo-common package. rm -rf debian/tmp$(GNUSTEP_SYSTEM_LIBRARY)/SOGo/ActiveSync* rm -rf debian/tmp$(GNUSTEP_SYSTEM_LIBRARY)/SOGo/API* gsdh_gnustep --bundle-dir=SOGo --move-to=sogo-common