File: rules

package info (click to toggle)
scribus 1.2.5.dfsg-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 35,352 kB
  • ctags: 9,123
  • sloc: cpp: 105,458; sh: 16,519; ansic: 8,812; perl: 2,001; python: 1,551; makefile: 1,460; xml: 107
file content (139 lines) | stat: -rwxr-xr-x 4,103 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/make -f

package=scribus

#export DH_VERBOSE=1

DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

DEBIAN_DIR = $(shell pwd)/debian

CURDIR= $(shell pwd)

patchdir = $(DEBIAN_DIR)/patches
patches = $(shell ls $(patchdir) | sort)
rev_patches = $(shell ls $(patchdir) | sort -r)

ifeq ($(DEB_HOST_GNU_TYPE), alpha-linux)
OPT_FLAG = -O0
else
OPT_FLAG = -O2
endif

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPT_FLAG = -O0
endif

OPT_FLAG += -g -Wall

build: patch-stamp build-stamp

build-stamp:
	dh_testdir
	dh_clean

	$(MAKE) -f Makefile.cvs

	CFLAGS="$(OPT_FLAG)" \
	CXXFLAGS="$(OPT_FLAG)" \
	./configure				\
		--prefix=/usr			\
		--sysconfdir=/etc		\
		--infodir=/usr/share/info	\
		--mandir=/usr/share/man		\

	$(MAKE)

	touch build-stamp

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot
	-rm -f build-stamp install-stamp
	-$(MAKE) distclean
	-rm -f config.cache config.log config.status
	-rm -f scribus/*.orig scribus/*.rej
	if [ -e $(DEBIAN_DIR)/patches/templates/br1.sla.gz ] ; then \
		mv scribus/templates/br1/br1.sla.gz $(DEBIAN_DIR)/patches/ ; \
		mv scribus/templates/nl1/nl1.sla.gz $(DEBIAN_DIR)/patches/ ; \
		mv scribus/templates/sc_presentation/presentation.sla.gz $(DEBIAN_DIR)/patches ; \
		mv $(DEBIAN_DIR)/patches/templates/br1.sla.gz scribus/templates/br1/ ; \
		mv $(DEBIAN_DIR)/patches/templates/nl1.sla.gz scribus/templates/nl1/ ; \
		mv $(DEBIAN_DIR)/patches/templates/presentation.sla.gz scribus/templates/sc_presentation/; \
		gunzip $(DEBIAN_DIR)/patches/*sla.gz; \
	fi
	dh_clean

patch-stamp:
	dpatch apply-all
	touch patch-stamp

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) install					\
		prefix=$(DEBIAN_DIR)/$(package)/usr	\
		mandir=$(DEBIAN_DIR)/$(package)/usr/share/man \
		datadir=$(DEBIAN_DIR)/$(package)/usr/share
	rm -rf $(DEBIAN_DIR)/$(package)/usr/include
	rm -f $(DEBIAN_DIR)/$(package)/usr/share/scribus/scripts/COPYING
	for i in linda lintian ; do \
	  install -m644 debian/scribus.$$i $(DEBIAN_DIR)/$(package)/usr/share/$$i/overrides/scribus ; \
	done
	touch install-stamp


binary-indep: build install
	dh_testdir
	dh_testroot


binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs -a README AUTHORS TODO
	dh_install
	dh_installmenu -a
	dh_installchangelogs -a ChangeLog
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	chmod 755 $(DEBIAN_DIR)/$(package)/usr/lib/scribus/libs/*
	chmod 755 $(DEBIAN_DIR)/$(package)/usr/lib/scribus/plugins/*
	chmod 755 $(DEBIAN_DIR)/$(package)/usr/lib/scribus/plugins/*/*
	dh_installdeb -a
	dh_desktop -a
	if [ -e $(DEBIAN_DIR)/patches/br1.sla ] ; then \
		mv scribus/templates/br1/br1.sla.gz $(DEBIAN_DIR)/patches/templates/ ; \
		mv scribus/templates/nl1/nl1.sla.gz $(DEBIAN_DIR)/patches/templates/ ; \
		mv scribus/templates/sc_presentation/presentation.sla.gz $(DEBIAN_DIR)/patches/templates/ ; \
		gzip $(DEBIAN_DIR)/patches/*sla ; \
		mv $(DEBIAN_DIR)/patches/br1.sla.gz scribus/templates/br1/ ; \
		mv $(DEBIAN_DIR)/patches/nl1.sla.gz scribus/templates/nl1/ ; \
		mv $(DEBIAN_DIR)/patches/presentation.sla.gz scribus/templates/sc_presentation/; \
	fi
#	for LIBFILE in $(shell ls $(DEBIAN_DIR)/$(package)/usr/lib/scribus/libs/*.0.0.0 \
#		$(DEBIAN_DIR)/$(package)/usr/lib/scribus/plugins/*.0.0.0 \
#		$(DEBIAN_DIR)/$(package)/usr/lib/scribus/plugins/*/*.0.0.0) ; do \
#	mv $${LIBFILE} $${LIBFILE%.0.0.0}".so.0.0.0" ; \
#	dh_link `echo "$${LIBFILE%.0.0.0}.so.0.0.0" | sed -r 's:'"$(DEBIAN_DIR)/$(package)"'/::'` `echo "$${LIBFILE%.0.0.0}.so" | sed -r 's:'"$(DEBIAN_DIR)/$(package)"'/::'` ; \
#	dh_link `echo "$${LIBFILE%.0.0.0}.so.0.0.0" | sed -r 's:'"$(DEBIAN_DIR)/$(package)"'/::'` `echo "$${LIBFILE%.0.0.0}.so.0" | sed -r 's:'"$(DEBIAN_DIR)/$(package)"'/::'` ; \
#	done
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

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