File: rules

package info (click to toggle)
scribus 1.3.3.13.dfsg~svn20081228-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 54,668 kB
  • ctags: 14,434
  • sloc: cpp: 165,840; ansic: 8,920; python: 3,149; xml: 419; makefile: 114; perl: 94; sh: 69
file content (143 lines) | stat: -rwxr-xr-x 3,621 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
140
141
142
143
#!/usr/bin/make -f

package=scribus
CMAKE=/usr/bin/cmake

#export DH_VERBOSE=1
DEBUG_FLAG=0

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
BUILD_DIR = $(shell pwd)/debian/build
INSTALL_DIR = $(shell pwd)/debian/scribus
DOC_DIR = $(INSTALL_DIR)/usr/share/doc/scribus
SCRIPTS_DIR = $(INSTALL_DIR)/usr/share/scribus/scripts
PATCH_DIR = $(DEBIAN_DIR)/patches
patches = $(shell ls $(PATCH_DIR) | sort)
rev_patches = $(shell ls $(PATCH_DIR) | 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

#ifeq (,$(findstring parallelbuild,$(DEB_BUILD_OPTIONS)))
#MAKE_FLAG = -j5
#else
#MAKE_FLAG =
#endif


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

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

configure-stamp:
	echo "DEB_BUILD_OPTIONS: ${DEB_BUILD_OPTIONS}"
	dh_testdir
	mkdir -p $(BUILD_DIR)
	cd $(BUILD_DIR) && $(CMAKE) \
	    -DWANT_DEBUG:STRING=$(DEBUG_FLAG) \
	    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
	    -DCMAKE_SKIP_RPATH:BOOL=1 \
	    -DRPATH_STYLE:STRING=none \
	    -DWANT_VERSIONING:BOOL=0 \
	    -DCMAKE_CXX_FLAGS:STRING='$(OPT_FLAG)' \
	    -DWANT_LIB32:BOOL=1 \
	    -DCMAKE_C_FLAGS:STRING='$(OPT_FLAG)' ../../
	touch configure-stamp
//	    -DCUSTOM_VERSIONTAG:STRING=\

build: patch-stamp configure-stamp build-stamp
build-stamp:
	dh_testdir
	dh_clean
	$(MAKE) $(MAKE_FLAG) -C $(BUILD_DIR)
	touch build-stamp

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot
#	[ ! -d $(CURDIR)/debian/build ] || $(MAKE) $(MAKE_FLAG) -C $(BUILD_DIR) clean
	rm -f configure-stamp build-stamp install-stamp
	rm -rf $(BUILD_DIR) $(INSTALL_DIR)
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	dh_install
	mkdir -p $(INSTALL_DIR)
	$(MAKE) $(MAKE_FLAG) -C $(BUILD_DIR) install DESTDIR=$(INSTALL_DIR)
	mv $(INSTALL_DIR)/usr/share/scribus/scripts/ChangeLog $(INSTALL_DIR)/usr/share/doc/scribus/ChangeLogScripts
	mv $(INSTALL_DIR)/usr/share/scribus/icons/scribus.png $(INSTALL_DIR)/usr/share/pixmaps/scribus.png
	rm -f $(DOC_DIR)/ChangeLogSVN \
	$(DOC_DIR)/AUTHORS \
	$(DOC_DIR)/BUILDING \
	$(DOC_DIR)/changelog \
	$(DOC_DIR)/BUILDING \
	$(DOC_DIR)/PACKAGING \
	$(DOC_DIR)/NEWS \
	$(DOC_DIR)/TODO \
	$(DOC_DIR)/INSTALL \
	$(DOC_DIR)/README.MacOSX \
	$(DOC_DIR)/README.OS2 \
	$(DOC_DIR)/COPYING \
	$(SCRIPTS_DIR)/COPYING \
	$(SCRIPTS_DIR)/NEWS \
	$(SCRIPTS_DIR)/ReadMe \
	$(SCRIPTS_DIR)/TODO \
	$(INSTALL_DIR)/usr/share/applications/vnd.scribus.desktop
	mv $(INSTALL_DIR)/usr/share/man/man1/scribus.1.de \
		$(INSTALL_DIR)/usr/share/man/de/man1/scribus.1
	chmod 755 $(INSTALL_DIR)/usr/share/scribus/samples/*.py
	install -m644 debian/scribus.lintian $(INSTALL_DIR)/usr/share/lintian/overrides/scribus
	install -m644 scribus.desktop $(INSTALL_DIR)/usr/share/applications
	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_installmenu -a
	dh_installman -a
	dh_installchangelogs ChangeLog
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	chmod 755 $(INSTALL_DIR)/usr/lib/scribus/plugins/*.so
	chmod 755 $(INSTALL_DIR)/usr/lib/scribus/plugins/*/*.so
	dh_installdeb -a
	dh_desktop -a
	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