File: rules

package info (click to toggle)
scribus 1.4.6%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 244,196 kB
  • ctags: 25,329
  • sloc: cpp: 273,566; xml: 12,482; python: 3,446; ansic: 3,438; makefile: 1,204; perl: 95; sh: 41
file content (107 lines) | stat: -rwxr-xr-x 4,175 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
#!/usr/bin/make -f

export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

CFLAGS += -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
CXXFLAGS += -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64

t :=
p := scribus$t
export p

ifneq (,$t)
extraconf := \
	-DWANT_DEBUG:BOOL=1 \
	-DWANT_VERSIONING:BOOL=1 \
	-DCUSTOM_VERSIONTAG=$t
else
extraconf :=
endif

%:
	dh $@ --buildsystem=cmake --with python2

override_dh_auto_configure:
	dh_auto_configure -- \
	    -DWANT_HUNSPELL=1 \
	    -DWANT_GRAPHICSMAGICK:BOOL=1 \
	    -DWANT_DISTROBUILD:BOOL=1 \
	    -DWANT_NORPATH:BOOL=1 \
	    -DCMAKE_SKIP_RPATH:BOOL=1 \
	    $(extraconf)

override_dh_auto_install:
	dh_auto_install
ifneq (,$(findstring doc, $(shell grep -e '^Package: ' debian/control)))
	# move the docs somewhere else, so that I can then pick them up
	# do it only if we are building the -doc package from the same source.
	# This won't be the case for the official Debian package, as the
	# documentation is non-free and in a separate source package.
	mkdir -p $(CURDIR)/debian/tmp/doc
	mv -v $(CURDIR)/debian/tmp/usr/share/doc/$p/en \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/de \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/it \
	      $(CURDIR)/debian/tmp/doc
endif
	mv -v $(CURDIR)/debian/tmp/usr/share/$p/scripts/ChangeLog $(CURDIR)/debian/tmp/usr/share/doc/$p/ChangeLogScripts
	rm -v $(CURDIR)/debian/tmp/usr/share/doc/$p/ChangeLogSVN \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/BUILDING \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/ChangeLog \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/PACKAGING \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/NEWS \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/TODO \
	      $(CURDIR)/debian/tmp/usr/share/doc/$p/COPYING \
	      $(CURDIR)/debian/tmp/usr/share/$p/scripts/NEWS \
	      $(CURDIR)/debian/tmp/usr/share/$p/scripts/TODO
	find $(CURDIR)/debian/tmp -type d -empty -delete
	# move the .desktop somewhere senseful
	mkdir -p $(CURDIR)/debian/tmp/usr/share/applications
	mv -v $(CURDIR)/debian/tmp/usr/share/mimelnk/application/vnd.scribus.desktop \
	      $(CURDIR)/debian/tmp/usr/share/applications/$p.desktop
ifneq (,$t)
	# rename some stuff from scribus to match the versiontag:
	mv -v $(CURDIR)/debian/tmp/usr/share/man/pl/man1/scribus.1 \
	      $(CURDIR)/debian/tmp/usr/share/man/pl/man1/$p.1
	mv -v $(CURDIR)/debian/tmp/usr/share/man/de/man1/scribus.1 \
	      $(CURDIR)/debian/tmp/usr/share/man/de/man1/$p.1
	mv -v $(CURDIR)/debian/tmp/usr/share/man/man1/scribus.1 \
	      $(CURDIR)/debian/tmp/usr/share/man/man1/$p.1
	mv -v $(CURDIR)/debian/tmp/usr/share/mime/packages/scribus.xml \
	      $(CURDIR)/debian/tmp/usr/share/mime/packages/$p.xml
endif
	# remove references to prorietary fonts and use free fonts in templates.
	# also remove references to Bitstream fonts, which are unmaintained, and
	# use DejaVu ones, instead
	# See https://bugs.debian.org/742003 and https://launchpad.net/bugs/1393349
	gunzip -v $(CURDIR)/debian/tmp/usr/share/$p/templates/*/*.sla.gz
	sed -i $(CURDIR)/debian/tmp/usr/share/$p/templates/*/*.sla \
		-e 's/Arial Regular/Liberation Sans Regular/g' \
		-e 's/Arial Black Regular/Liberation Sans Bold/g' \
		-e 's/FreeSans Medium/Liberation Sans Bold/g' \
		-e 's/Bitstream Vera Sans Roman/DejaVu Sans Book/g' \
		-e 's/Bitstream Vera Sans Mono Roman/DejaVu Sans Mono Book/g' \
		-e 's/Bitstream Vera Serif Roman/DejaVu Serif Book/g' \
		-e 's/Bitstream Vera Serif/DejaVu Serif/g' \
		-e 's/Bitstream Vera Sans/DejaVu Sans/g' \
		-e 's/Bitstream Vera Mono/DejaVu Mono/g'
	gzip -v -n -8 $(CURDIR)/debian/tmp/usr/share/$p/templates/*/*.sla

override_dh_install:
	dh_install --fail-missing

override_dh_fixperms:
	# the plugins (which are the only .so files here) needs to be +x.
	# let the scribus installer take care of them
	dh_fixperms -X .so

override_dh_python2:
	dh_python2 /usr/share/$p/samples/
	dh_python2 /usr/share/$p/scripts/

# scribus expects the {docdir}/{lang}/menu.xml being present and uncompressed,
# otherwise you'll get no docs.
override_dh_compress:
	dh_compress -X usr/share/doc/$p/de \
				-X usr/share/doc/$p/en \
				-X usr/share/doc/$p/it