File: rules

package info (click to toggle)
moin 1.9.9-1+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 76,024 kB
  • sloc: python: 143,896; java: 10,704; php: 2,385; perl: 1,574; xml: 371; makefile: 214; sh: 81; sed: 5
file content (120 lines) | stat: -rwxr-xr-x 4,627 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/make -f
#-*- makefile -*-

pkg = python-moinmoin
datadir = /usr/share/moin
libdir = $(datadir)/server
python_all = pyversions -r | tr ' ' '\n' | xargs -t -I {} env {}
staticpath := $(shell sed -n -e "s|^\s*release_short\s*=\s*'\([^']*\)'.*|/moin_static\1|p" MoinMoin/version.py)
$(if $(staticpath),,$(error Failed to resolve staticpath))

export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)

build-arch build-indep: build-stamp
build-stamp:
	dh_testdir
	bash debian/tweak-moin-manpage debian/moin.1.template debian/moin.1
	cd MoinMoin/i18n && make
	$(python_all) setup.py build
	sed s,__STATICPATH__,$(staticpath),g < debian/README.Debian.in > debian/README.Debian
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -rf build
	cd MoinMoin/i18n && make clean
	rm -f MoinMoin/i18n/meta.py
	rm -f debian/stamp-update-translations
	rm -f debian/moin.1
	rm -f debian/copyright_newhints debian/README.Debian
	rm -f build-stamp install-stamp
	find . -name '*.py[co]' -delete
	find . -name __pycache__ -type d -empty -delete
	find . -prune -name '*.egg-info' -exec rm -rf '{}' ';'
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/$(pkg)
	$(python_all) setup.py install --prefix=/usr --root=debian/$(pkg) --install-layout=deb
	sed -i '1 s,\(#!/usr/bin/python\).*,\1,' debian/*/usr/bin/*

	# Ensure proper hash-bang in Python scripts (Python Policy 0.9.0.0 ยง3.1)
	egrep -r -l -Z '^#! ?/usr/bin/(env )?python[[:print:]]*$$' debian/$(pkg)$(datadir)/server/* debian/$(pkg)/usr/share/doc/* debian/$(pkg)/usr/bin/moin \
	    | xargs -r -0 perl -pi -e 's,^#! ?/usr/bin/(env )?python[[:print:]]*$$,#!/usr/bin/python$(cdbs_python_nondefault_version),'

	# Strip notes in underlay about editing only on moinmaster.
	sh debian/process_language_pages debian/$(pkg)

	# Make sure scripts are executable
	egrep -r -l -Z '^#! ?/usr/bin/(env )?python[[:print:]]*$$' debian/$(pkg)$(libdir) \
		| xargs -r -0 chmod a+x

	# Move underlay to /usr/share/moin
	for HTDOCS in debian/$(pkg)/usr/lib/python*/*-packages/MoinMoin/web/static/htdocs; do \
	    cp -a $${HTDOCS} debian/$(pkg)$(datadir); \
	    rm -rf $${HTDOCS}; \
	    ln -s $(datadir)/htdocs $${HTDOCS} ; \
	done

	# Include Moinmoin Desktop editions files.
	install -m 755 wikiserver.py wikiconfig.py debian/$(pkg)/usr/share/doc/$(pkg)/examples/desktop-edition
	install -m 755 debian/examples/wikiserver-init.sh debian/$(pkg)/usr/share/doc/$(pkg)/examples/wikiserver-init.sh

	# Setup system wide farmconfig.
	for file in `find debian/$(pkg)$(datadir)/config/wikifarm -type f -print`; do \
		sed -f debian/configtweaks.sed $$file > debian/$(pkg)/etc/moin/$${file##*/}; \
	done
	for file in `find debian/$(pkg)$(datadir)/server -type f -printf '%f\n'`; do \
		sed -i -f debian/servertweaks.sed debian/$(pkg)$(datadir)/server/$$file; \
	done

	# Use systemwide word file as main dictionary
	ln -s /etc/moin/words debian/$(pkg)/usr/share/pyshared/MoinMoin/
	ln -s /usr/share/dict/words debian/$(pkg)/etc/moin/words

	# Strip TwikiDrawPlugin as we need to compile from source
	rm -f debian/$(pkg)$(datadir)/htdocs/applets/TWikiDrawPlugin/twikidraw.jar
	echo "This applet has not yet been packaged for Debian. for now it is available at http://debian.jones.dk/auryn/pool-all/official/moin/twikidraw/" > debian/$(pkg)$(datadir)/htdocs/applets/TWikiDrawPlugin/README

	# Strip AnyWikiDrawForTWiki as needs to compile from source
	rm -rf debian/$(pkg)$(datadir)/htdocs/applets/anywikidraw/*
	echo "This applet has not yet been packaged for Debian." > debian/$(pkg)$(datadir)/htdocs/applets/anywikidraw/README

	# Strip FCKeditor, as it's provided by packages fckeditor
	rm -rf debian/$(pkg)$(datadir)/htdocs/applets/FCKeditor/*
	echo "This applet is provided by Debian's fckeditor package." > debian/$(pkg)$(datadir)/htdocs/applets/FCKeditor/README
	echo "More info at /usr/share/doc/$(pkg)/README.Debian(.gz)" >> debian/$(pkg)$(datadir)/htdocs/applets/FCKeditor/README

	touch install-stamp

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_install
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_installchangelogs
	dh_python2
	dh_compress -X examples/
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
build: build-arch build-indep
.PHONY: build-arch build-indep  build clean binary-indep binary-arch binary