#!/usr/bin/make -f export DH_VERBOSE = 1 # see FEATURE AREAS in dpkg-buildflags(1) export DEB_BUILD_MAINT_OPTIONS = hardening=+all PKG_PHP_TOOLS_VER = $(shell dpkg-query --showformat='$${Version}' --show pkg-php-tools) PKG_PHP_TOOLS_GE_1_41 = $(shell if dpkg --compare-versions $(PKG_PHP_TOOLS_VER) ge "1.41~"; then echo y; else echo n; fi) %: dh $@ --with apache2 execute_before_dh_auto_build: ifeq "$(PKG_PHP_TOOLS_GE_1_41)" "y" phpabtpl composer.json > debian/autoload.php.tpl endif #Skip phpab since there is no need to have spl_autoload_register in kalkun sed '/@codingStandardsIgnoreFile/,/@codeCoverageIgnoreEnd/d' debian/autoload.php.tpl > debian/autoload.php # Remove codeigniter framework from autoloader because it doesn't provide it. sed -i -e "/Codeigniter\/Framework/ d" debian/autoload.php execute_after_dh_install: ln -sf ../../../../javascript/jquery/jquery.min.js debian/kalkun/usr/share/kalkun/www/media/js/jquery-*.min.js for file in debian/kalkun/usr/share/kalkun/www/media/css/jquery-ui/images/*.png; do \ ln -sf ../../../../../../javascript/jquery-ui/themes/base/images/$$(basename "$$file") debian/kalkun/usr/share/kalkun/www/media/css/jquery-ui/images/$$(basename "$$file") ; \ done ln -sf ../../../../../javascript/jquery-ui/jquery-ui.min.js debian/kalkun/usr/share/kalkun/www/media/js/jquery-ui/jquery-ui.min.js ln -sf ../../../../../javascript/jquery-ui/themes/base/jquery-ui.min.css debian/kalkun/usr/share/kalkun/www/media/css/jquery-ui/jquery-ui.min.css for file in debian/kalkun/usr/share/kalkun/www/media/js/jquery-ui/i18n/*.js; do \ ln -sf ../../../../../../javascript/jquery-ui/ui/i18n/$$(basename "$$file") debian/kalkun/usr/share/kalkun/www/media/js/jquery-ui/i18n/$$(basename "$$file") ; \ done ln -sf ../../../../javascript/chart.js/chart.min.js debian/kalkun/usr/share/kalkun/www/media/js/chart.umd.js ln -sf ../../../../javascript/autosize/autosize.min.js debian/kalkun/usr/share/kalkun/www/media/js/autosize-*.js execute_after_dh_fixperms: # These files contain credentials. So change the permissions. for file in \ debian/kalkun/etc/kalkun/config/database.php \ debian/kalkun-plugin-phonebook-ldap/etc/kalkun/plugins/phonebook_ldap.php \ debian/kalkun-plugin-rest-api/etc/kalkun/plugins/rest.php \ debian/kalkun-plugin-sms-to-email/etc/kalkun/plugins/sms_to_email.php \ debian/kalkun-plugin-sms-to-twitter/etc/kalkun/plugins/sms_to_twitter.php \ ; do \ chown root:www-data $$file ; \ chmod 640 $$file ; \ done chown www-data:www-data debian/kalkun/var/log/kalkun/