File: rules

package info (click to toggle)
roundcube 1.3.17%2Bdfsg.1-1~deb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,024 kB
  • sloc: php: 110,360; javascript: 33,964; pascal: 4,654; sh: 2,262; sql: 2,150; perl: 73; makefile: 70; ansic: 48; python: 21
file content (106 lines) | stat: -rwxr-xr-x 5,411 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/make -f

%:
	dh $@ --with phpcomposer

override_dh_auto_build:
	>plugins/jqueryui/js/jquery-ui-1.10.4.custom.min.js debian/create-jquery-ui-custom.sh
	CACHEDIR=$(CURDIR)/debian/missing-sources/ debian/install-jsdeps.sh -s -e # can be replaced with bin/install-jsdeps.sh with upstream version >= 1.3.0

override_dh_auto_clean:
	CACHEDIR=$(CURDIR)/debian/missing-sources/ debian/install-jsdeps.sh -d # can be replaced with bin/install-jsdeps.sh with upstream version >= 1.3.0

	debconf-updatepo

override_dh_install:
	dh_install

	install -m 0644 $(CURDIR)/.htaccess $(CURDIR)/debian/roundcube-core/etc/roundcube/htaccess
	install -m 0644 $(CURDIR)/composer.json-dist $(CURDIR)/debian/roundcube-core/usr/share/roundcube/composer.json

	# database intial
	install -m 0644 $(CURDIR)/SQL/mysql.initial.sql $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/install/mysql
	install -m 0644 $(CURDIR)/SQL/postgres.initial.sql $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/install/pgsql
	install -m 0644 $(CURDIR)/SQL/sqlite.initial.sql $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/install/sqlite3

	#database update
	cp -r $(CURDIR)/debian/sql/* $(CURDIR)/debian/roundcube-core/usr/share/dbconfig-common/data/roundcube/upgrade/

	# Convert .js back to min.js
	for js in $$(find $(CURDIR)/debian/roundcube-core -type f -name '*.js' -not -name '*.min.js' -print); do \
		yui-compressor --type js "$$js" -o "$${js%.*}.min.js" ; \
	done

	# Dont encode timezones, etc.
	find "$(CURDIR)"/debian/roundcube-core/usr/share/roundcube/program/js/tinymce/ -print0 | \
		xargs -0r touch --no-dereference --date="@$(SOURCE_DATE_EPOCH)"

	# Plugins are in usr/share/roundcube/plugins, for each plugin
	# if there is config.inc.php.dist, we symlink a config.inc.php
	# in /etc/roundcube/plugins with some dummy content.
	for package in roundcube-core roundcube-plugins; do \
		for plugin in $(CURDIR)/debian/$${package}/usr/share/roundcube/plugins/*; do \
			dh_link -p$${package} usr/share/roundcube/plugins/$${plugin##*/} \
				var/lib/roundcube/plugins/$${plugin##*/} ; \
			if [ ! -f $${plugin}/config.inc.php.dist ]; then continue; fi ; \
			dh_installdirs -p$${package} etc/roundcube/plugins/$${plugin##*/} ; \
			(echo "<?php" ; \
			 echo "// Empty configuration for $${plugin##*/}" ; \
			 echo "// See /usr/share/roundcube/plugins/$${plugin##*/}/config.inc.php.dist for instructions" ; \
			 echo "// Check the access right of the file if you put sensitive information in it." ; \
			 echo '$$config=array();' ; \
			 echo "?>") > \
				$(CURDIR)/debian/$${package}/etc/roundcube/plugins/$${plugin##*/}/config.inc.php ; \
			dh_link -p$${package} etc/roundcube/plugins/$${plugin##*/}/config.inc.php \
				usr/share/roundcube/plugins/$${plugin##*/}/config.inc.php ; \
		done \
	done

	# Remove
	rmdir debian/roundcube-core/var/lib/roundcube/config

	#setup /usr/share/bug/$(package)/control files
	for package in roundcube roundcube-core roundcube-mysql roundcube-sqlite3 roundcube-pgsql roundcube-plugins roundcube-sqlite3; do \
		install -d $(CURDIR)/debian/$${package}/usr/share/bug/$${package} ;\
		install -m 644 $(CURDIR)/debian/bug.control $(CURDIR)/debian/$${package}/usr/share/bug/$${package}/control ;\
	done

	#get rid of randomly '.gitignore' files
	find $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube \( -name '._*' -o -name '.gitignore' \) -delete ;

	# password helpers is a experimental
	rm $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube/plugins/password/helpers/chgsaslpasswd.c
	rm $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube/plugins/password/helpers/chgvirtualminpasswd.c
	rm $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube/plugins/password/helpers/chpass-wrapper.py

override_dh_fixperms:
	dh_fixperms --

	#only make scripts in bin dir executeable
	find $(CURDIR)/debian/roundcube-core/usr/share/roundcube -type f -print0 | xargs -r0 chmod -x ;
	find $(CURDIR)/debian/roundcube-core/usr/share/roundcube/bin -type f -print0 | xargs -r0 chmod +x ;

	#make everything non executable
	find $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube -type f -print0 | xargs -r0 chmod -x ;
	find $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube -type d -empty -delete ;
	chmod 0755 $(CURDIR)/debian/roundcube-plugins/usr/share/roundcube/plugins/password/helpers/*.p[ly]

override_dh_installdocs:
	dh_installdocs --link-doc=roundcube-core -proundcube -proundcube-core
	dh_installdocs -proundcube-mysql -proundcube-pgsql -proundcube-sqlite3 -proundcube-plugins
	mv $(CURDIR)/debian/roundcube-core/usr/share/doc/roundcube-core/CHANGELOG \
		$(CURDIR)/debian/roundcube-core/usr/share/doc/roundcube-core/changelog
	for pkg in roundcube-core roundcube-plugins; do \
		for doc in $(CURDIR)/debian/$$pkg/usr/share/roundcube/plugins/*/README; do \
			plugin="$${doc#"$(CURDIR)/debian/$$pkg/usr/share/roundcube/plugins/"}"; \
			plugin="$${plugin%/README}"; \
			mkdir -p "$(CURDIR)/debian/$$pkg/usr/share/doc/$$pkg/plugins/$$plugin"; \
			mv -nt "$(CURDIR)/debian/$$pkg/usr/share/doc/$$pkg/plugins/$$plugin" "$$doc"; \
		done; \
	done
	# "README.md" is in debian/roundcube-core.docs already
	rm -f  $(CURDIR)/debian/roundcube-core/usr/share/roundcube/program/lib/Roundcube/README.md

override_dh_phpcomposer:
	dh_phpcomposer --sourcedirectory=$(CURDIR)/debian/roundcube-core/usr/share/roundcube