Subversion Repositories

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

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

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