File: rules

package info (click to toggle)
gosa 2.7.4%2Breloaded3-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 38,716 kB
  • sloc: php: 87,789; perl: 14,364; xml: 4,987; javascript: 4,127; sh: 887; pascal: 306; sql: 263; python: 162; makefile: 76
file content (97 lines) | stat: -rwxr-xr-x 5,419 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
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

PKD      = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG      = $(DEB_SOURCE)
UVER     = $(shell echo $(DEB_VERSION) | cut -d "-" -f1)
DTYPE    = +reloaded3
VER     ?= $(subst $(DTYPE),,$(UVER))
PLUGINS  = $(shell ls debian/watch.* | cut -d "." -f2 | sed -e 's/gosa-//')

NULL     =

%:
	dh $@

override_dh_compress:
	dh_compress
	gzip -d debian/gosa/usr/share/doc/gosa/gosa.conf.gz

override_dh_install:

	# Run dh_install first...
	dh_install

	# silence several lintian warnings (package-contains-empty-directory).
	touch debian/gosa/usr/share/gosa/html/plugins/references/.placeholder
	test -f debian/gosa/usr/share/gosa/locale/core/en/LC_MESSAGES/messages.po || \
	    touch debian/gosa/usr/share/gosa/locale/core/en/LC_MESSAGES/.placeholder
	find debian/gosa-plugin-*/usr/share/gosa/locale/plugins/*/locale/*/LC_MESSAGES/ -type d | while read dir; do \
	    test -f $$dir/messages.po || touch $$dir/.placeholder; \
	done

	# don't use embedded fonts, use font package files from Debian
	mkdir -p debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts
	ln -sf /usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf debian/gosa/usr/share/gosa/html/themes/default/fonts

	# symlink to Debian's libjs-scriptaculous package
	mkdir -p debian/gosa/usr/share/gosa/html/include
	ln -sf /usr/share/javascript/scriptaculous/effects.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/controls.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/dragdrop.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/unittest.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/slider.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/scriptaculous.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/sound.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/builder.js debian/gosa/usr/share/gosa/html/include/
	ln -sf /usr/share/javascript/scriptaculous/prototype.js debian/gosa/usr/share/gosa/html/include/

	# symlink the smarty-gettext plugin
	ln -sf /usr/share/php/smarty3/plugins/block.t.php debian/gosa/usr/share/gosa/include/smartyAddons/

override_dh_installchangelogs:
	dh_installchangelogs -k gosa-core/Changelog

get-orig-source: $(patsubst %,$(PKG)-%_$(VER)$(DTYPE).orig.tar.gz,$(PLUGINS))
	cd $(PKD) && XZ_OPT=-6v tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.gz" --owner=root --group=root --mode=a+rX README.multi-orig-tarball-package
	cd $(PKD)/.. && mv *.tar.gz ..
	@echo "# Repacking gosa-core..."
	cd $(PKD)/.. && rm -rf gosa-core-$(VER) && tar xzf ../$(PKG)_$(VER)$(DTYPE).orig-gosa-core.tar.gz
	cd $(PKD)/../gosa-core-$(VER) && \
	    rm -rfv debian/ \
	    rm -rfv redhat/ \
	    rm -rfv include/smarty \
	    rm -fv  include/smartyAddons/block.t.php \
	    rm -fv  html/include/prototype.js \
	    rm -fv  html/include/scriptaculous.js \
	    rm -fv  html/include/slider.js \
	    rm -fv  html/include/sound.js \
	    rm -fv  html/include/unittest.js \
	    rm -fv  html/themes/default/fonts/*.ttf \
	    rm -fv  include/pChart/*.ttf \
	    $(NULL)
	rm ../$(PKG)_$(VER)$(DTYPE).orig-gosa-core.tar.gz
	cd $(PKD)/../ && tar czf ../$(PKG)_$(VER)$(DTYPE).orig-gosa-core.tar.gz gosa-core-$(VER) && rm -rf gosa-core-$(VER)


$(PKG)-%_$(VER)$(DTYPE).orig.tar.gz:
	@echo "# Downloading..."
	if [ ! -f $(PKD)/../../$(PKG)_$(VER)$(DTYPE).orig-$(shell echo $* | sed -e 's/plugin-//').tar.gz ]; then \
	    cd $(PKD)/.. && uscan --noconf --download --force-download --package $(PKG)-$* --watchfile debian/watch.gosa-$* --upstream-version $(UVER) --download-version $(VER) --rename --destdir=../; \
	fi
	@echo "# Renaming..."
	if [ -f $(PKD)/../../$(PKG)-$*_$(VER).orig.tar.gz ]; then \
	    cd $(PKD)/.. && mv -v ../$(PKG)-$*_$(VER).orig.tar.gz ../$(PKG)_$(VER)$(DTYPE).orig-$(shell echo $* | sed -e 's/plugin-//').tar.gz; \
	fi