Subversion Repositories

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

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

Rev 93 Rev 94
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
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-
 
24
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
 
25
-
 
26
CFARGSEXTRA = --with-cdebug
-
 
27
-
 
28
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-
 
29
export CC=$(DEB_HOST_GNU_TYPE)-gcc
-
 
30
CFARGSEXTRA += --host=$(DEB_HOST_GNU_TYPE)
-
 
31
endif
-
 
32
23
ifeq (,$(DEB_BUILD_ARCH))
33
ifeq (,$(DEB_BUILD_ARCH))
24
DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
34
DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
25
endif
35
endif
26
36
27
CFLAGS_EXTRA = -g
37
CFLAGS_EXTRA = -g
28
CPPFLAGS_EXTRA = -DDEBIAN
38
CPPFLAGS_EXTRA = -DDEBIAN
29
39
30
ifdef SSP
40
ifdef SSP
31
SSP_FLAGS=-fstack-protector
41
SSP_FLAGS=-fstack-protector
32
endif
42
endif
33
43
34
CFARGSEXTRA = --with-cdebug
-
 
35
-
 
36
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
44
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
37
CFARGSEXTRA += --without-copt
45
CFARGSEXTRA += --without-copt
38
else
46
else
39
CFARGSEXTRA += --with-copt
47
CFARGSEXTRA += --with-copt
40
endif
48
endif
41
49
42
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
50
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
43
CFARGSEXTRA += --with-rtldebug
51
CFARGSEXTRA += --with-rtldebug
44
else
52
else
45
CFARGSEXTRA += --without-rtldebug
53
CFARGSEXTRA += --without-rtldebug
46
endif
54
endif
47
55
48
CFLAGS_EXTRA += $(SSP_FLAGS)
56
CFLAGS_EXTRA += $(SSP_FLAGS)
49
# Temporary workaround for hppa linker issues
57
# Temporary workaround for hppa linker issues
50
ifeq ($(DEB_BUILD_ARCH),hppa)
58
ifeq ($(DEB_BUILD_ARCH),hppa)
51
CFLAGS_EXTRA += -ffunction-sections
59
CFLAGS_EXTRA += -ffunction-sections
52
endif
60
endif
53
61
54
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
62
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
55
	INSTALL_PROGRAM += -s
63
	INSTALL_PROGRAM += -s
56
endif
64
endif
57
65
58
EXTRA_ARGS=--with-security
66
EXTRA_ARGS=--with-security
59
67
60
DO_MACHINE_CODE=no
68
DO_MACHINE_CODE=no
61
ifeq ($(DEB_BUILD_ARCH),i386)
69
ifeq ($(DEB_BUILD_ARCH),i386)
62
DO_MACHINE_CODE=yes
70
DO_MACHINE_CODE=yes
63
endif
71
endif
64
ifeq ($(DEB_BUILD_ARCH),powerpc)
72
ifeq ($(DEB_BUILD_ARCH),powerpc)
65
DO_MACHINE_CODE=yes
73
DO_MACHINE_CODE=yes
66
endif
74
endif
67
ifeq ($(DEB_BUILD_ARCH),sparc)
75
ifeq ($(DEB_BUILD_ARCH),sparc)
68
DO_MACHINE_CODE=no
76
DO_MACHINE_CODE=no
69
endif
77
endif
70
78
71
ifeq ($(DO_MACHINE_CODE),yes)
79
ifeq ($(DO_MACHINE_CODE),yes)
72
MACHINE_OPTS=--with-machine-code
80
MACHINE_OPTS=--with-machine-code
73
else
81
else
74
MACHINE_OPTS=--without-machine-code
82
MACHINE_OPTS=--without-machine-code
75
endif
83
endif
76
84
77
#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
85
#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
78
DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)
86
DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)
79
MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)
87
MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)
80
MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)
88
MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)
81
BUILD:=$(shell sed -ne 's/build://p' buildid.txt)
89
BUILD:=$(shell sed -ne 's/build://p' buildid.txt)
82
PIKEV:=$(MAJOR).$(MINOR)
90
PIKEV:=$(MAJOR).$(MINOR)
83
VERSION:=$(MAJOR).$(MINOR).$(BUILD)
91
VERSION:=$(MAJOR).$(MINOR).$(BUILD)
84
PIKE:=pike$(PIKEV)
92
PIKE:=pike$(PIKEV)
85
93
86
ifneq ($(VERSION),$(DEBVERSION))
94
ifneq ($(VERSION),$(DEBVERSION))
87
$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))
95
$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))
88
endif
96
endif
89
97
90
CFARGS=$(CFARGSEXTRA) \
98
CFARGS=$(CFARGSEXTRA) \
91
       --with-cflags='$(CFLAGS_EXTRA)' \
99
       --with-cflags='$(CFLAGS_EXTRA)' \
92
       --with-cppflags='$(CPPFLAGS_EXTRA)' \
100
       --with-cppflags='$(CPPFLAGS_EXTRA)' \
93
       --with-bignums \
101
       --with-bignums \
94
       --with-gmp \
102
       --with-gmp \
95
       --with-poll \
103
       --with-poll \
96
       --with-zlib \
104
       --with-zlib \
97
       --with-freetype \
105
       --with-freetype \
98
       --without-ttflib \
106
       --without-ttflib \
99
       --with-libnettle \
107
       --with-libnettle \
100
       --without-sybase \
108
       --without-sybase \
101
       --without-java \
109
       --without-java \
102
       --with-odbc \
110
       --with-odbc \
103
       --with-sane \
111
       --with-sane \
104
       --with-postgres \
112
       --with-postgres \
105
       --with-postgres-include-dir=`pg_config --includedir` \
113
       --with-postgres-include-dir=`pg_config --includedir` \
106
       --with-libpq-dir=/usr/lib \
114
       --with-libpq-dir=/usr/lib \
107
       --without-ffmpeg \
115
       --without-ffmpeg \
108
       --without-fftw \
116
       --without-fftw \
109
       --without-libpdf \
117
       --without-libpdf \
110
       --without-libpanda \
118
       --without-libpanda \
111
       --without-GTK \
119
       --without-GTK \
112
       --with-GTK2 \
120
       --with-GTK2 \
113
       --without-bundles \
121
       --without-bundles \
114
       --without-oracle \
122
       --without-oracle \
115
       --without-dvb \
123
       --without-dvb \
116
       --with-sqlite \
124
       --with-sqlite \
117
       --disable-rpath \
125
       --disable-rpath \
118
       --disable-smartlink_binary \
126
       --disable-smartlink_binary \
119
       --with-relocatable-dumped-modules \
127
       --with-relocatable-dumped-modules \
120
       $(MACHINE_OPTS) $(EXTRA_ARGS)
128
       $(MACHINE_OPTS) $(EXTRA_ARGS)
121
129
122
include_prefix=/usr/include/pike$(PIKEV)
130
include_prefix=/usr/include/pike$(PIKEV)
123
lib_prefix=/usr/lib/pike$(PIKEV)
131
lib_prefix=/usr/lib/pike$(PIKEV)
124
132
125
MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core -N $(PIKE)-dev)
133
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}.
134
#{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_*}.*
135
#usr/lib/pike/*/modules/Sql.pmod/{module,Sql,rsql,sql_*}.*
128
136
129
excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF PV.pike
137
excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF PV.pike
130
# This is tricky. Note that it's only possible for an exclusion to match the last
138
# 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.
139
# component specified in an .install file or on the command line, and below.
132
DH_EXCLUDE:=$(addprefix -X,$(excluded_modules))
140
DH_EXCLUDE:=$(addprefix -X,$(excluded_modules))
133
DH_ALREADY=`for p in $(MODULE_PACKAGES); do \
141
DH_ALREADY=`for p in $(MODULE_PACKAGES); do \
134
	      find debian/$$p/usr/lib/pike?.?/* -type f -printf "-X%P "; done`
142
	      find debian/$$p/usr/lib/pike?.?/* -type f -printf "-X%P "; done`
135
143
136
TMP=$(CURDIR)/debian/tmp
144
TMP=$(CURDIR)/debian/tmp
137
145
138
#export CFLAGS CC PIKE VERSION
146
#export CFLAGS CC PIKE VERSION
139
export CC
147
export CC
140
148
141
build-arch: build-arch-stamp
149
build-arch: build-arch-stamp
142
build-arch-stamp: $(DPATCH_STAMPFN)
150
build-arch-stamp: $(DPATCH_STAMPFN)
143
	dh_testdir
151
	dh_testdir
144
	$(MAKE) compile CONFIGUREARGS="$(CFARGS)"
152
	$(MAKE) compile CONFIGUREARGS="$(CFARGS)"
145
	touch build-arch-stamp
153
	touch build-arch-stamp
146
154
147
build-indep: build-indep-stamp
155
build-indep: build-indep-stamp
148
build-indep-stamp: $(DPATCH_STAMPFN)
156
build-indep-stamp: $(DPATCH_STAMPFN)
149
	dh_testdir
157
	dh_testdir
150
	$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"
158
	$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"
151
	touch build-indep-stamp
159
	touch build-indep-stamp
152
160
153
build: build-arch
161
build: build-arch
154
162
155
clean: clean-patched unpatch
163
clean: clean-patched unpatch
156
	dh_clean
164
	dh_clean
157
165
158
clean-patched:
166
clean-patched:
159
	dh_testdir
167
	dh_testdir
160
	dh_testroot
168
	dh_testroot
161
	rm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp
169
	rm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp
162
	$(MAKE) distclean
170
	$(MAKE) distclean
163
	rm -rf refdoc/modref refdoc/traditional_manual
171
	rm -rf refdoc/modref refdoc/traditional_manual
164
172
165
install: DH_OPTIONS=
173
install: DH_OPTIONS=
166
install: build-arch
174
install: build-arch
167
	dh_testdir
175
	dh_testdir
168
	dh_testroot
176
	dh_testroot
169
	dh_clean -k
177
	dh_clean -k
170
	$(MAKE) INSTALLARGS=--traditional \
178
	$(MAKE) INSTALLARGS=--traditional \
171
		buildroot=$(TMP) \
179
		buildroot=$(TMP) \
172
		prefix=/usr \
180
		prefix=/usr \
173
		man_prefix=/usr/share/man \
181
		man_prefix=/usr/share/man \
174
		lib_prefix="$(lib_prefix)" \
182
		lib_prefix="$(lib_prefix)" \
175
		include_prefix="$(include_prefix)" \
183
		include_prefix="$(include_prefix)" \
176
		pike_name=/usr/bin/$(PIKE) \
184
		pike_name=/usr/bin/$(PIKE) \
177
		install_nodoc
185
		install_nodoc
178
186
179
#	Some cleaning
187
#	Some cleaning
180
	find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'
188
	find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'
181
189
182
	install -d -m755 $(TMP)/usr/share/pixmaps
190
	install -d -m755 $(TMP)/usr/share/pixmaps
183
	install -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpm
191
	install -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpm
184
	mv $(TMP)/usr/bin/pike $(TMP)/usr/bin/$(PIKE)
192
	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
193
	mv $(TMP)/usr/share/man/man1/pike.1 $(TMP)/usr/share/man/man1/$(PIKE).1
186
194
187
#	Simply strip exec permissions and shebangs from all pike scripts.
195
#	Simply strip exec permissions and shebangs from all pike scripts.
188
	find $(TMP)/usr -name *.p* -type f \
196
	find $(TMP)/usr -name *.p* -type f \
189
		-exec chmod a-x '{}' + \
197
		-exec chmod a-x '{}' + \
190
		-exec sed -ri -e '1!b;/^#!/d' '{}' +
198
		-exec sed -ri -e '1!b;/^#!/d' '{}' +
191
199
192
#	Install our own, simpler specs file.
200
#	Install our own, simpler specs file.
193
	sed -e "s;@include_prefix@;$(include_prefix);g" \
201
	sed -e "s;@include_prefix@;$(include_prefix);g" \
194
	    -e "s;@CONFIGURE_ARGS@;$(CFARGS);g" \
202
	    -e "s;@CONFIGURE_ARGS@;$(CFARGS);g" \
195
	    debian/specs.in > $(TMP)$(include_prefix)/specs
203
	    debian/specs.in > $(TMP)$(include_prefix)/specs
196
204
197
#	Install pike-config
205
#	Install pike-config
198
	sed -e "s#@CFLAGS@#-I$(include_prefix)#;s/@LDFLAGS@//" \
206
	sed -e "s#@CFLAGS@#-I$(include_prefix)#;s/@LDFLAGS@//" \
199
	    -e "s/@MAJOR@/$(MAJOR)/;s/@MINOR@/$(MINOR)/;s/@BUILD@/$(BUILD)/" \
207
	    -e "s/@MAJOR@/$(MAJOR)/;s/@MINOR@/$(MINOR)/;s/@BUILD@/$(BUILD)/" \
200
	    debian/pike-config.in > $(TMP)/usr/bin/$(PIKE)-config
208
	    debian/pike-config.in > $(TMP)/usr/bin/$(PIKE)-config
201
209
202
#	Fix precompike.pike
210
#	Fix precompike.pike
203
	sed -i -e "s%\.\./lib%$(lib_prefix)%" $(TMP)$(include_prefix)/precompile.pike
211
	sed -i -e "s%\.\./lib%$(lib_prefix)%" $(TMP)$(include_prefix)/precompile.pike
204
212
205
# 	# pike -x module fix
213
# 	# pike -x module fix
206
#	sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \
214
#	sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \
207
#		$(TMP)$(include_prefix)/modules/dynamic_module_makefile
215
#		$(TMP)$(include_prefix)/modules/dynamic_module_makefile
208
216
209
# Build architecture-independent files here.
217
# Build architecture-independent files here.
210
# Pass -i to all debhelper commands in this target to reduce clutter.
218
# Pass -i to all debhelper commands in this target to reduce clutter.
211
binary-indep: build-indep
219
binary-indep: build-indep
212
	dh_testdir -i
220
	dh_testdir -i
213
	dh_testroot -i
221
	dh_testroot -i
214
	# install the docs
222
	# install the docs
215
	dh_install -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
223
	dh_install -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
216
	dh_install -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
224
	dh_install -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
217
	dh_install -i -N$(PIKE)-manual -N$(PIKE)-reference --sourcedir=$(TMP)
225
	dh_install -i -N$(PIKE)-manual -N$(PIKE)-reference --sourcedir=$(TMP)
218
	dh_installdocs -i
226
	dh_installdocs -i
219
	dh_installchangelogs -i -k CHANGES
227
	dh_installchangelogs -i -k CHANGES
220
	dh_link -i
228
	dh_link -i
221
	dh_compress -i
229
	dh_compress -i
222
	dh_fixperms -i
230
	dh_fixperms -i
223
	dh_installdeb -i
231
	dh_installdeb -i
224
	dh_gencontrol -i
232
	dh_gencontrol -i
225
	dh_md5sums -i
233
	dh_md5sums -i
226
	dh_builddeb -i
234
	dh_builddeb -i
227
235
228
# Build architecture-dependent files here.
236
# Build architecture-dependent files here.
229
binary-arch: build-arch install
237
binary-arch: build-arch install
230
	dh_testdir -a
238
	dh_testdir -a
231
	dh_testroot -a
239
	dh_testroot -a
232
	dh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)
240
	dh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)
233
	dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
241
	dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
234
	for p in $(MODULE_PACKAGES) $(PIKE)-dev; do \
242
	for p in $(MODULE_PACKAGES) $(PIKE)-dev; do \
235
		dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \
243
		dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \
236
	done
244
	done
237
	dh_installdocs -a
245
	dh_installdocs -a
238
	dh_installmenu -a
246
	dh_installmenu -a
239
	dh_installchangelogs -a -k CHANGES
247
	dh_installchangelogs -a -k CHANGES
240
	dh_strip -a
248
	dh_strip -a
241
	dh_compress -a
249
	dh_compress -a
242
	dh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuite
250
	dh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuite
243
	dh_installdeb -a
251
	dh_installdeb -a
244
	dh_shlibdeps -a
252
	dh_shlibdeps -a
245
	dh_gencontrol -a
253
	dh_gencontrol -a
246
	dh_md5sums -a
254
	dh_md5sums -a
247
	dh_builddeb -a
255
	dh_builddeb -a
248
256
249
binary: binary-indep binary-arch
257
binary: binary-indep binary-arch
250
.PHONY: build clean binary-indep binary-arch binary install configure
258
.PHONY: build clean binary-indep binary-arch binary install configure