File: rules

package info (click to toggle)
mod-mono 3.8-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,760 kB
  • ctags: 448
  • sloc: sh: 11,397; ansic: 3,127; makefile: 45
file content (48 lines) | stat: -rwxr-xr-x 1,821 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
#!/usr/bin/make -f

# 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;')

# Hard-code some values for the above, as we make an assumption that the 
# XSP and mod-mono versions match (which they don't today)
PKG_VERSION = 4.2
NEXT_PKG_VERSION = 4.4

MAKEFILE = $(firstword $(MAKEFILE_LIST))
DEBIAN_DIR = $(dir $(MAKEFILE))
SOURCE_DIR = $(DEBIAN_DIR)/..

DEB_VERSION = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Version | cut -d" " -f2)
DEB_SOURCE_NAME = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Source | cut -d" " -f2)
VERSION = $(shell echo $(DEB_VERSION) | cut -d"-" -f1 | sed 's/+dfsg.*//')

override_dh_install:
	dh_install

	# 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
	rm -f debian/libapache2-mod-mono/etc/apache2/mod_mono.conf

override_dh_gencontrol:
	dh_gencontrol -- \
		-Vcurrent-version=$(PKG_VERSION) -Vnext-version=$(NEXT_PKG_VERSION)

get-orig-source:
	uscan \
		--package $(DEB_SOURCE_NAME) \
		--watchfile $(DEBIAN_DIR)/watch \
		--upstream-version $(VERSION) \
		--download-version $(VERSION) \
		--destdir ./ \
		--force-download \
		--rename

%:
	dh $@ --with apache2,autoreconf