Subversion Repositories

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

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

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