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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/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
override_dh_auto_install:
mkdir debian/tmp
# We only want to install some dirs
cp -a index.php install application/ docs/ scripts/ media/ debian/tmp
# We don't want to ship the dirs below
rm -r debian/tmp/application/logs debian/tmp/application/cache
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/
|