File: rules

package info (click to toggle)
dokuwiki 2024-02-06b%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 24,624 kB
  • sloc: php: 97,851; javascript: 3,724; sh: 599; makefile: 70; xml: 34
file content (72 lines) | stat: -rwxr-xr-x 2,459 bytes parent folder | download | duplicates (2)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/make -f

DESTDIR=$(CURDIR)/debian/dokuwiki

API_VERSION := $(shell awk -F\" '/^\$$updateVersion/ { print $$2 }' doku.php | cut -d. -f1)
UPSTREAM_VERSION := $(shell dpkg-parsechangelog -SVersion | rev | cut -d- -f2- | rev)

upstream:
	lynx "https://www.dokuwiki.org/changes?do=export_raw" -dump > debian/local/changelog.upstream

%:
	dh ${@}

execute_after_dh_auto_clean:
	$(MAKE) -C debian/local/farm clean

execute_after_dh_auto_build:
	$(MAKE) -C debian/local/farm build

execute_after_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

	# 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

execute_after_dh_fixperms:
	# fix 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))"