#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DESTDIR=$(CURDIR)/debian/dokuwiki API_VERSION := $(shell awk -F\" '/^\$$updateVersion/ { print $$2 }' doku.php | cut -d. -f1) UPSTREAM_VERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | rev | cut -d- -f2- | rev) upstream: lynx "https://www.dokuwiki.org/changes?do=export_raw" -dump > debian/local/changelog.upstream %: dh $@ override_dh_install: dh_install # Already installed to /var/lib/ rm -rf $(DESTDIR)/usr/share/dokuwiki/lib/tpl rm -rf $(DESTDIR)/usr/share/dokuwiki/lib/plugins # Create plugins.local.php touch $(DESTDIR)/etc/dokuwiki/plugins.local.php execute_after_dh_install: # removing unused installer rm -f debian/dokuwiki/usr/share/dokuwiki/install.php # removing uneeded git files find debian/dokuwiki -name ".git*" -delete # removing uneeded metadata files find debian/dokuwiki -type f -name "_dummy" -delete find debian/dokuwiki -type f -name "_deprecated.txt" -delete find debian/dokuwiki -type f -name "deleted.files" -delete # removing uneeded documentation find debian/dokuwiki -type f -name "README*" -delete find debian/dokuwiki -type f -name "LICENSE*" -delete find debian/dokuwiki -type f -name "license.txt" -delete override_dh_fixperms: dh_fixperms # Fixe erroneous executable permission on some files chmod -x $(DESTDIR)/usr/share/dokuwiki/inc/lang/az/* # Allow www-data to write pages and account files. chown -R www-data:root $(DESTDIR)/var/lib/dokuwiki/data chown -R www-data:root $(DESTDIR)/var/lib/dokuwiki/acl chmod 700 $(DESTDIR)/var/lib/dokuwiki/acl chmod 700 $(DESTDIR)/var/lib/dokuwiki/data chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/attic chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/cache chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/index chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/locks chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/media chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/meta chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/pages chmod 700 $(DESTDIR)/var/lib/dokuwiki/data/tmp # Command-line executables chmod +x $(DESTDIR)/usr/share/dokuwiki/bin/*.php # Standard permission for webapp configuration chown -R root:www-data $(DESTDIR)/etc/dokuwiki override_dh_installchangelogs: dh_installchangelogs debian/local/changelog.upstream override_dh_gencontrol: dh_gencontrol -- -Vdokuwiki:Provides:api="dokuwiki-api-$(API_VERSION) (= $(UPSTREAM_VERSION))"