Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 64 | Rev 84 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64 Rev 71
1
#!/usr/bin/make -f
1
#!/usr/bin/make -f
2
# Sample debian/rules that uses debhelper. 
2
# Sample debian/rules that uses debhelper. 
3
# GNU copyright 1997 by Joey Hess.
3
# GNU copyright 1997 by Joey Hess.
4
#
4
#
5
# This version is for a hypothetical package that builds an
5
# This version is for a hypothetical package that builds an
6
# architecture-dependant package, as well as an architecture-independent
6
# architecture-dependant package, as well as an architecture-independent
7
# package.
7
# package.
8
#
8
#
9
# $Id: rules,v 1.64 2006/08/05 15:49:18 grendel Exp $
9
# $Id: rules,v 1.64 2006/08/05 15:49:18 grendel Exp $
10
#
10
#
11
11
12
# Uncomment this to turn on verbose mode. 
12
# Uncomment this to turn on verbose mode. 
13
#export DH_VERBOSE=1
13
#export DH_VERBOSE=1
14
14
15
include /usr/share/dpatch/dpatch.make
15
include /usr/share/dpatch/dpatch.make
16
16
17
ifdef CCVER
17
ifdef CCVER
18
CC=gcc-$(CCVER)
18
CC=gcc-$(CCVER)
19
else
19
else
20
CC=gcc
20
CC=gcc
21
endif
21
endif
22
22
23
ifeq (,$(DEB_BUILD_ARCH))
23
ifeq (,$(DEB_BUILD_ARCH))
24
DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
24
DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
25
endif
25
endif
26
26
27
CFLAGS_EXTRA = -g
27
CFLAGS_EXTRA = -g
28
CPPFLAGS_EXTRA = -DDEBIAN
28
CPPFLAGS_EXTRA = -DDEBIAN
29
29
30
ifdef SSP
30
ifdef SSP
31
SSP_FLAGS=-fstack-protector
31
SSP_FLAGS=-fstack-protector
32
endif
32
endif
33
33
34
CFARGSEXTRA = --with-cdebug
34
CFARGSEXTRA = --with-cdebug
35
35
36
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
36
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
37
CFARGSEXTRA += --without-copt
37
CFARGSEXTRA += --without-copt
38
else
38
else
39
CFARGSEXTRA += --with-copt
39
CFARGSEXTRA += --with-copt
40
endif
40
endif
41
41
42
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
42
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
43
CFARGSEXTRA += --with-rtldebug
43
CFARGSEXTRA += --with-rtldebug
44
else
44
else
45
CFARGSEXTRA += --without-rtldebug
45
CFARGSEXTRA += --without-rtldebug
46
endif
46
endif
47
47
48
CFLAGS_EXTRA += $(SSP_FLAGS)
48
CFLAGS_EXTRA += $(SSP_FLAGS)
49
# Temporary workaround for hppa linker issues
49
# Temporary workaround for hppa linker issues
50
ifeq ($(DEB_BUILD_ARCH),hppa)
50
ifeq ($(DEB_BUILD_ARCH),hppa)
51
CFLAGS_EXTRA += -ffunction-sections
51
CFLAGS_EXTRA += -ffunction-sections
52
endif
52
endif
53
53
54
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
54
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
55
	INSTALL_PROGRAM += -s
55
	INSTALL_PROGRAM += -s
56
endif
56
endif
57
57
58
EXTRA_ARGS=--with-security
58
EXTRA_ARGS=--with-security
59
59
60
DO_MACHINE_CODE=no
60
DO_MACHINE_CODE=no
61
ifeq ($(DEB_BUILD_ARCH),i386)
61
ifeq ($(DEB_BUILD_ARCH),i386)
62
DO_MACHINE_CODE=yes
62
DO_MACHINE_CODE=yes
63
endif
63
endif
64
ifeq ($(DEB_BUILD_ARCH),powerpc)
64
ifeq ($(DEB_BUILD_ARCH),powerpc)
65
DO_MACHINE_CODE=yes
65
DO_MACHINE_CODE=yes
66
endif
66
endif
67
ifeq ($(DEB_BUILD_ARCH),sparc)
67
ifeq ($(DEB_BUILD_ARCH),sparc)
68
DO_MACHINE_CODE=no
68
DO_MACHINE_CODE=no
69
endif
69
endif
70
70
71
ifeq ($(DO_MACHINE_CODE),yes)
71
ifeq ($(DO_MACHINE_CODE),yes)
72
MACHINE_OPTS=--with-machine-code
72
MACHINE_OPTS=--with-machine-code
73
else
73
else
74
MACHINE_OPTS=--without-machine-code
74
MACHINE_OPTS=--without-machine-code
75
endif
75
endif
76
76
77
#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
77
#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
78
DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)
78
DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)
79
MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)
79
MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)
80
MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)
80
MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)
81
BUILD:=$(shell sed -ne 's/build://p' buildid.txt)
81
BUILD:=$(shell sed -ne 's/build://p' buildid.txt)
82
PIKEV:=$(MAJOR).$(MINOR)
82
PIKEV:=$(MAJOR).$(MINOR)
83
VERSION:=$(MAJOR).$(MINOR).$(BUILD)
83
VERSION:=$(MAJOR).$(MINOR).$(BUILD)
84
PIKE:=pike$(PIKEV)
84
PIKE:=pike$(PIKEV)
85
85
86
ifneq ($(VERSION),$(DEBVERSION))
86
ifneq ($(VERSION),$(DEBVERSION))
87
$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))
87
$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))
88
endif
88
endif
89
89
90
CFARGS=$(CFARGSEXTRA) \
90
CFARGS=$(CFARGSEXTRA) \
91
       --with-cflags='$(CFLAGS_EXTRA)' \
91
       --with-cflags='$(CFLAGS_EXTRA)' \
92
       --with-cppflags='$(CPPFLAGS_EXTRA)' \
92
       --with-cppflags='$(CPPFLAGS_EXTRA)' \
93
       --with-bignums \
93
       --with-bignums \
94
       --with-gmp \
94
       --with-gmp \
95
       --with-poll \
95
       --with-poll \
96
       --with-zlib \
96
       --with-zlib \
97
       --with-freetype \
97
       --with-freetype \
98
       --without-ttflib \
98
       --without-ttflib \
99
       --with-libnettle \
99
       --with-libnettle \
100
       --without-sybase \
100
       --without-sybase \
101
       --without-java \
101
       --without-java \
102
       --with-odbc \
102
       --with-odbc \
103
       --with-sane \
103
       --with-sane \
104
       --with-postgres \
104
       --with-postgres \
105
       --with-postgres-include-dir=`pg_config --includedir` \
105
       --with-postgres-include-dir=`pg_config --includedir` \
106
       --with-libpq-dir=/usr/lib \
106
       --with-libpq-dir=/usr/lib \
107
       --without-ffmpeg \
107
       --without-ffmpeg \
108
       --without-fftw \
108
       --without-fftw \
109
       --without-libpdf \
109
       --without-libpdf \
110
       --without-libpanda \
110
       --without-libpanda \
111
       --without-GTK \
111
       --without-GTK \
112
       --with-GTK2 \
112
       --with-GTK2 \
113
       --without-bundles \
113
       --without-bundles \
114
       --without-oracle \
114
       --without-oracle \
115
       --without-dvb \
115
       --without-dvb \
116
       --with-sqlite \
116
       --with-sqlite \
117
       --disable-rpath \
117
       --disable-rpath \
118
       --disable-smartlink_binary \
118
       --disable-smartlink_binary \
119
       --with-relocatable-dumped-modules \
119
       --with-relocatable-dumped-modules \
120
       $(MACHINE_OPTS) $(EXTRA_ARGS)
120
       $(MACHINE_OPTS) $(EXTRA_ARGS)
121
121
122
include_prefix=/usr/include/pike/$(VERSION)
122
include_prefix=/usr/include/pike/$(VERSION)
123
lib_prefix=/usr/lib/pike/$(VERSION)
123
lib_prefix=/usr/lib/pike/$(VERSION)
124
124
125
MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core -N $(PIKE)-dev)
125
MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core -N $(PIKE)-dev)
126
#{ADT,Array,Audio,Cache,Calendar,Calendar_I,COM,Colors,CommonLog,Crypto,Debug,Filesystem,Error,Float,Function,Geography,Getopt,Gettext,Gmp,Graphics,Gz,HTTPAccept,Int,Kerberos,Languages,Local,Locale,Mapping,Math,MIME,Mird,Multiset,Nettle,Parser,Pike,Pipe,Process,Program,Protocols,Regexp,Remote,SSL,Shuffler,Standards,Stdio,String,System,Thread,Tools,Unicode,Web,Yabu,Yp,_ADT,_Charset,_Roxen,___Gz,___MIME,___Math,___Mird,___Regexp,___Yp,____Charset,__builtin*,spider}.
126
#{ADT,Array,Audio,Cache,Calendar,Calendar_I,COM,Colors,CommonLog,Crypto,Debug,Filesystem,Error,Float,Function,Geography,Getopt,Gettext,Gmp,Graphics,Gz,HTTPAccept,Int,Kerberos,Languages,Local,Locale,Mapping,Math,MIME,Mird,Multiset,Nettle,Parser,Pike,Pipe,Process,Program,Protocols,Regexp,Remote,SSL,Shuffler,Standards,Stdio,String,System,Thread,Tools,Unicode,Web,Yabu,Yp,_ADT,_Charset,_Roxen,___Gz,___MIME,___Math,___Mird,___Regexp,___Yp,____Charset,__builtin*,spider}.
127
#usr/lib/pike/*/modules/Sql.pmod/{module,Sql,rsql,sql_*}.*
127
#usr/lib/pike/*/modules/Sql.pmod/{module,Sql,rsql,sql_*}.*
128
128
129
excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF
129
excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF
130
# This is tricky. Note that it's only possible for an exclusion to match the last
130
# This is tricky. Note that it's only possible for an exclusion to match the last
131
# component specified in an .install file or on the command line, and below.
131
# component specified in an .install file or on the command line, and below.
132
DH_EXCLUDE:=$(addprefix -X,$(excluded_modules))
132
DH_EXCLUDE:=$(addprefix -X,$(excluded_modules))
133
DH_ALREADY=`for p in $(MODULE_PACKAGES); do \
133
DH_ALREADY=`for p in $(MODULE_PACKAGES); do \
134
	      find debian/$$p/usr/lib/pike/*/* -type f -printf "-X%P "; done`
134
	      find debian/$$p/usr/lib/pike/*/* -type f -printf "-X%P "; done`
135
135
136
TMP=$(CURDIR)/debian/tmp
136
TMP=$(CURDIR)/debian/tmp
137
137
138
#export CFLAGS CC PIKE VERSION
138
#export CFLAGS CC PIKE VERSION
139
export CC
139
export CC
140
140
141
build-arch: build-arch-stamp
141
build-arch: build-arch-stamp
142
build-arch-stamp: $(DPATCH_STAMPFN)
142
build-arch-stamp: $(DPATCH_STAMPFN)
143
	dh_testdir
143
	dh_testdir
144
	$(MAKE) compile CONFIGUREARGS="$(CFARGS)"
144
	$(MAKE) compile CONFIGUREARGS="$(CFARGS)"
145
	touch build-arch-stamp
145
	touch build-arch-stamp
146
146
147
build-indep: build-indep-stamp
147
build-indep: build-indep-stamp
148
build-indep-stamp: $(DPATCH_STAMPFN)
148
build-indep-stamp: $(DPATCH_STAMPFN)
149
	dh_testdir
149
	dh_testdir
150
	$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"
150
	$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"
151
	touch build-indep-stamp
151
	touch build-indep-stamp
152
152
153
build: build-arch
153
build: build-arch
154
154
155
clean: clean-patched unpatch
155
clean: clean-patched unpatch
156
	dh_clean
156
	dh_clean
157
157
158
clean-patched:
158
clean-patched:
159
	dh_testdir
159
	dh_testdir
160
	dh_testroot
160
	dh_testroot
161
	rm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp
161
	rm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp
162
	$(MAKE) distclean
162
	$(MAKE) distclean
163
	rm -rf refdoc/modref refdoc/traditional_manual
163
	rm -rf refdoc/modref refdoc/traditional_manual
164
164
165
install: DH_OPTIONS=
165
install: DH_OPTIONS=
166
install: build-arch
166
install: build-arch
167
	dh_testdir
167
	dh_testdir
168
	dh_testroot
168
	dh_testroot
169
	dh_clean -k
169
	dh_clean -k
170
	$(MAKE) INSTALLARGS=--traditional \
170
	$(MAKE) INSTALLARGS=--traditional \
171
		buildroot=$(TMP) \
171
		buildroot=$(TMP) \
172
		prefix=/usr \
172
		prefix=/usr \
173
		man_prefix=/usr/share/man \
173
		man_prefix=/usr/share/man \
174
		lib_prefix="$(lib_prefix)" \
174
		lib_prefix="$(lib_prefix)" \
175
		include_prefix="$(include_prefix)" \
175
		include_prefix="$(include_prefix)" \
176
		pike_name=/usr/bin/$(PIKE) \
176
		pike_name=/usr/bin/$(PIKE) \
177
		install_nodoc
177
		install_nodoc
178
178
179
#	Some cleaning
179
#	Some cleaning
180
	find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'
180
	find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'
181
181
182
	install -d -m755 $(TMP)/usr/share/pixmaps
182
	install -d -m755 $(TMP)/usr/share/pixmaps
183
	install -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpm
183
	install -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpm
184
	mv $(TMP)/usr/bin/pike $(TMP)/usr/bin/$(PIKE)
184
	mv $(TMP)/usr/bin/pike $(TMP)/usr/bin/$(PIKE)
185
	mv $(TMP)/usr/share/man/man1/pike.1 $(TMP)/usr/share/man/man1/$(PIKE).1
185
	mv $(TMP)/usr/share/man/man1/pike.1 $(TMP)/usr/share/man/man1/$(PIKE).1
186
186
187
#	Simply strip exec permissions and shebangs from all pike scripts.
187
#	Simply strip exec permissions and shebangs from all pike scripts.
188
	find $(TMP)/usr -name *.p* -type f \
188
	find $(TMP)/usr -name *.p* -type f \
189
		-exec chmod a-x '{}' + \
189
		-exec chmod a-x '{}' + \
190
		-exec sed -ri -e '1!b;/^#!/d' '{}' +
190
		-exec sed -ri -e '1!b;/^#!/d' '{}' +
191
191
192
#	Don't install our own specs file - the ordinary one is not that bad really
192
#	Don't install our own specs file - the ordinary one is not that bad really
193
#	sed -e 's/@PIKEVERSION@/$(VERSION)/g' \
193
#	sed -e 's/@PIKEVERSION@/$(VERSION)/g' \
194
	    -e 's;@CONFIGURE_ARGS@;$(CFARGS);g' \
194
	    -e 's;@CONFIGURE_ARGS@;$(CFARGS);g' \
195
	    debian/specs.in > $(TMP)$(include_prefix)/specs
195
	    debian/specs.in > $(TMP)$(include_prefix)/specs
196
196
197
#	Install pike-config
197
#	Install pike-config
198
	sed -e "s#@CFLAGS@#-I$(include_prefix)#;s/@LDFLAGS@//" \
198
	sed -e "s#@CFLAGS@#-I$(include_prefix)#;s/@LDFLAGS@//" \
199
	    -e "s/@MAJOR@/$(MAJOR)/;s/@MINOR@/$(MINOR)/;s/@BUILD@/$(BUILD)/" \
199
	    -e "s/@MAJOR@/$(MAJOR)/;s/@MINOR@/$(MINOR)/;s/@BUILD@/$(BUILD)/" \
200
	    debian/pike-config.in > $(TMP)/usr/bin/$(PIKE)-config
200
	    debian/pike-config.in > $(TMP)/usr/bin/$(PIKE)-config
201
201
202
# 	# pike -x module fix
202
# 	# pike -x module fix
203
#	sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \
203
#	sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \
204
#		$(TMP)$(include_prefix)/modules/dynamic_module_makefile
204
#		$(TMP)$(include_prefix)/modules/dynamic_module_makefile
205
205
206
# Build architecture-independent files here.
206
# Build architecture-independent files here.
207
# Pass -i to all debhelper commands in this target to reduce clutter.
207
# Pass -i to all debhelper commands in this target to reduce clutter.
208
binary-indep: build-indep
208
binary-indep: build-indep
209
	dh_testdir -i
209
	dh_testdir -i
210
	dh_testroot -i
210
	dh_testroot -i
211
	# install the docs
211
	# install the docs
212
	dh_install -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
212
	dh_install -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
213
	dh_install -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
213
	dh_install -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
214
	dh_install -i -N$(PIKE)-manual -N$(PIKE)-reference --sourcedir=$(TMP)
214
	dh_install -i -N$(PIKE)-manual -N$(PIKE)-reference --sourcedir=$(TMP)
215
	dh_installdocs -i
215
	dh_installdocs -i
216
	dh_installchangelogs -i -k CHANGES
216
	dh_installchangelogs -i -k CHANGES
217
	dh_link -i
217
	dh_link -i
218
	dh_compress -i
218
	dh_compress -i
219
	dh_fixperms -i
219
	dh_fixperms -i
220
	dh_installdeb -i
220
	dh_installdeb -i
221
	dh_gencontrol -i
221
	dh_gencontrol -i
222
	dh_md5sums -i
222
	dh_md5sums -i
223
	dh_builddeb -i
223
	dh_builddeb -i
224
224
225
# Build architecture-dependent files here.
225
# Build architecture-dependent files here.
226
binary-arch: build-arch install
226
binary-arch: build-arch install
227
	dh_testdir -a
227
	dh_testdir -a
228
	dh_testroot -a
228
	dh_testroot -a
229
	dh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)
229
	dh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)
230
	dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
230
	dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
231
	for p in $(MODULE_PACKAGES) $(PIKE)-dev; do \
231
	for p in $(MODULE_PACKAGES) $(PIKE)-dev; do \
232
		dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \
232
		dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \
233
	done
233
	done
234
	dh_installdocs -a
234
	dh_installdocs -a
235
	dh_installmenu -a
235
	dh_installmenu -a
236
	dh_installchangelogs -a -k CHANGES
236
	dh_installchangelogs -a -k CHANGES
237
	dh_strip -a
237
	dh_strip -a
238
	dh_compress -a
238
	dh_compress -a
239
	dh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuite
239
	dh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuite
240
	dh_installdeb -a
240
	dh_installdeb -a
241
	dh_shlibdeps -a
241
	dh_shlibdeps -a
242
	dh_gencontrol -a
242
	dh_gencontrol -a
243
	dh_md5sums -a
243
	dh_md5sums -a
244
	dh_builddeb -a
244
	dh_builddeb -a
245
245
246
binary: binary-indep binary-arch
246
binary: binary-indep binary-arch
247
.PHONY: build clean binary-indep binary-arch binary install configure
247
.PHONY: build clean binary-indep binary-arch binary install configure