File: rules

package info (click to toggle)
libapache-mod-perl 1.21.20000309-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,632 kB
  • ctags: 1,295
  • sloc: perl: 7,049; ansic: 5,214; sh: 356; makefile: 171
file content (152 lines) | stat: -rwxr-xr-x 4,765 bytes parent folder | download | duplicates (2)
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
144
145
146
147
148
149
150
151
152
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DEV_DPKG_VERSION := $(shell dpkg -s apache-dev | awk '/Version:/ {print $2}')
DEV_VERSION := $(shell echo $(DEV_DPKG_VERSION) | sed "s/^Version: \(.*\)-.*$$/\1/")
# (From the egcs packaging)
NEXTVERNO := $(shell echo $(DEV_VERSION) | awk -F. '{OFS="."; $$NF = $$NF + 1; print}')

# This mess only has the desired result if the latest perl is installed.
ifndef PERL
  PERL = /usr/bin/perl
endif

USR_BIN_PERL_VER := $(shell /usr/bin/perl -e 'printf "%.3f", $$]')
DOLLAR_PERL_VER  := $(shell $(PERL) -e 'printf "%.3f", $$]')

PERL_DEPEND = perl-$(DOLLAR_PERL_VER)

ifeq ($(DOLLAR_PERL_VER),$(USR_BIN_PERL_VER))
  PERL_PACKNAME =
else
  PERL_PACKNAME = -$(PERL_VER)
endif

ifneq ($(wildcard /usr/lib/libperl5.so.*.*),)
  LIBPERL := -lperl5
else
  LIBPERL := DEFAULT
endif

build: build-stamp
build-stamp:
	dh_testdir

# This file isn't in the CVS archive.  Decrease my hack count by one by not
# preserving it any more.
#	# Preserve files
#	if [ -f src/modules/perl/mod_perl_version.h -a \
#	    '!' -f src/modules/perl/mod_perl_version.h.backup ]; \
#	then \
#	  echo 'Preserving mod_perl_version.h ...'; \
#	  cp src/modules/perl/mod_perl_version.h \
#	   src/modules/perl/mod_perl_version.h.backup; \
#	fi

	if [ -f apaci/mod_perl.config -a '!' -f apaci/mod_perl.config.backup ]; \
	then \
	  echo 'Preserving mod_perl.config ...'; \
	  cp apaci/mod_perl.config apaci/mod_perl.config.backup; \
	fi

	$(PERL) Makefile.PL USE_APXS=1 WITH_APXS=/usr/bin/apxs \
		PERL_SECTIONS=1 PERL_SSI=1 PERL_METHOD_HANDLERS=1 ALL_HOOKS=1 \
		PERL_TIE_TABLES=1 PERL_DIRECTIVE_HANDLERS=1 PERL_STACKED_HANDLERS=1 \
		PERL_TRACE=0 PERL_LOG_API=1 PERL_URI_API=1 PERL_UTIL_API=1 \
		PERL_TABLE_API=1 PERL_FILE_API=1 # PERL_DEBUG=1
	$(MAKE)
	touch build-stamp

debian/control: debian/control.in
	sed -e 's/THISDEV/$(DEV_VERSION)/g' -e 's/NEXTDEV/$(NEXTVERNO)/g' \
	    -e 's/PERL_PACKNAME/$(PERL_PACKNAME)/g' \
	    -e 's/PERL_DEPEND/$(PERL_DEPEND)/g' \
		< debian/control.in > debian/control

clean:
	dh_testdir
	rm -f build-stamp
	dh_clean

	rm -f lib/Apache/MyConfig.pm t/docs/test.shtml \
		 t/net/config.pl t/net/perl/cgi.pl t/report t/conf/httpd.conf{,.old} \
		 t/httpd.conf apaci/find_source lib/mod_perl_hooks.pm
	find . -name .tmp.\* -exec rm -rf {} \;
	([ -f Makefile ] && $(MAKE) distclean) || true
	chmod -R u+w .
	rm -f debian/control
	$(MAKE) -f debian/rules debian/control

# See above.
#	if [ -f src/modules/perl/mod_perl_version.h.backup ]; then \
#	  echo 'Reverting mod_perl_version.h ...'; \
#	  mv -f src/modules/perl/mod_perl_version.h.backup \
#	   src/modules/perl/mod_perl_version.h; \
#	fi
# So just delete it.
	rm -f src/modules/perl/mod_perl_version.h

	if [ -f apaci/mod_perl.config.backup ]; then \
	  echo 'Reverting mod_perl.config ...'; \
	  mv -f apaci/mod_perl.config.backup apaci/mod_perl.config; \
	fi

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
	dh_testversion
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the files into debian/tmp
	$(MAKE) PREFIX=`pwd`/debian/tmp/usr INSTALLMAN3DIR=`pwd`/debian/tmp/usr/share/man/man3 \
		INSTALLMAN1DIR=`pwd`/debian/tmp/usr/share/man/man1 install_perl

	find `pwd`/debian/tmp \( -name .packlist -o -name perllocal.pod \) -exec \
	  rm -f '{}' \;
	# Why does this return nonzero?
	-find `pwd`/debian/tmp -type d -print0 | xargs -0 \
	  --no-run-if-empty rmdir -p --ignore-fail-on-non-empty

	mkdir -p debian/tmp/usr/lib/apache/1.3
	cp apaci/libperl.so debian/tmp/usr/lib/apache/1.3/mod_perl.so
	chmod 644 debian/tmp/usr/lib/apache/1.3/mod_perl.so
	cp debian/400mod_perl.info debian/tmp/usr/lib/apache/1.3/400mod_perl.info

	dh_installdocs
	cp -a eg/ debian/tmp/usr/share/doc/libapache-mod-perl/examples
	(cd debian/tmp/usr/share/doc/libapache-mod-perl && mv Changes changelog)

	find `pwd`/debian/tmp -type f \( -name \*.pm -o -name \*.pl \) \
	  -exec chmod a-x '{}' \;

	find `pwd`/debian/tmp -type f -name .cvsignore -exec rm '{}' ';'

	find `pwd`/debian/tmp -type f -name mod_perl.exp -exec rm '{}' ';'

	dh_installmanpages
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary