File: rules

package info (click to toggle)
mod-mono 1.2.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,640 kB
  • ctags: 230
  • sloc: sh: 8,606; ansic: 1,750; makefile: 120
file content (143 lines) | stat: -rwxr-xr-x 4,737 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# Perl code to figure out the current version and the next "potential" version
DPKG_VERSION ?= $(shell head -n 1 debian/changelog  | cut -f 2 -d '(' | cut -f 1 -d ')')
PKG_VERSION ?= $(shell echo $(DPKG_VERSION) | cut -f 1 -d '-' | cut -f 1-3 -d '.')
NEXT_PKG_VERSION ?= $(shell echo $(PKG_VERSION) | perl -e '$$_=<>;/\.(\d+)$$/;$$a=$$1+1;s/\.(\d+)$$/.$$a/;print;')

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

COMMON_CONFIG=	--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info

configure: configure-apache-stamp configure-apache2-stamp
configure-apache-stamp:
	dh_testdir
	if [ -d apache-build ]; then rm -rf apache-build; fi
	-mkdir apache-build
	cd apache-build && \
		../configure $(COMMON_CONFIG) --with-apxs=/usr/bin/apxs
	touch $@
configure-apache2-stamp:
	dh_testdir
	if [ -d apache2-build ]; then rm -rf apache2-build; fi
	-mkdir apache2-build
	cd apache2-build && \
		../configure $(COMMON_CONFIG) --with-apxs=/usr/bin/apxs2
	touch $@

build: configure build-apache-stamp build-apache2-stamp
build-apache-stamp: configure-apache-stamp
	dh_testdir
	cd apache-build && $(MAKE)
	touch $@
build-apache2-stamp: configure-apache2-stamp
	dh_testdir
	cd apache2-build && $(MAKE)
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp *-stamp-*
	rm -rf apache-build apache2-build
	debconf-updatepo
	dh_clean 

install: build install-prereq install-apache install-apache2
install-prereq: build
	dh_testdir
	dh_testroot
	dh_clean -k
install-apache:
	dh_installdirs -plibapache-mod-mono

	# Install into debian/libapache-mod-mono.
	# We need APXS = /bin/true, otherwise mod_mono will install everything
	# in /usr instead of debian/libapache-mod-mono.
	cd apache-build && $(MAKE) install \
		DESTDIR=../debian/libapache-mod-mono \
		APXS=/bin/true
#	install -m644 debian/libapache-mod-mono.conf \
#		debian/libapache-mod-mono/etc/apache/conf.d/mod_mono.conf
	install -m755 apache-build/src/.libs/mod_mono.so \
		debian/libapache-mod-mono/`apxs -q LIBEXECDIR`
	install -m644 debian/libapache-mod-mono.info \
		debian/libapache-mod-mono/`apxs -q LIBEXECDIR`/500mod_mono.info
install-apache2:
	dh_installdirs -plibapache2-mod-mono

	# Install into debian/libapache2-mod-mono.
	# We need APXS = /bin/true, otherwise mod_mono will install everything
	# in /usr instead of debian/libapache2-mod-mono.
	cd apache2-build && $(MAKE) install \
		DESTDIR=../debian/libapache2-mod-mono \
		APXS=/bin/true
	install -m755 apache2-build/src/.libs/mod_mono.so \
		debian/libapache2-mod-mono/`apxs2 -q LIBEXECDIR`
	install -m644 debian/libapache2-mod-mono.load \
		debian/libapache2-mod-mono/etc/apache2/mods-available/mod_mono.load
	install -m644 debian/libapache2-mod-mono.conf \
		debian/libapache2-mod-mono/etc/apache2/mods-available/mod_mono.conf

#	Install a Debian version of the AutoConfiguration stuff that fits
#	with the apache2 a2{en,dis}mod stuff. We use the existing version
#	because of the autoconf substitutions.
	grep LoadModule debian/libapache2-mod-mono/etc/apache2/mod_mono.conf \
		> debian/libapache2-mod-mono/etc/apache2/mods-available/mod_mono_auto.load
	chmod 0644 debian/libapache2-mod-mono/etc/apache2/mods-available/mod_mono_auto.load
	cp debian/libapache2-mod-mono.conf_auto \
		debian/libapache2-mod-mono/etc/apache2/mods-available/mod_mono_auto.conf
	chmod 0644 debian/libapache2-mod-mono/etc/apache2/mods-available/mod_mono_auto.conf
	rm -f debian/libapache2-mod-mono/etc/apache2/mod_mono.conf

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

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
	dh_installdebconf
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -- \
		-Vcurrent-version=$(PKG_VERSION) -Vnext-version=$(NEXT_PKG_VERSION)
	dh_md5sums
	dh_builddeb

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