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
|
#!/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.
# Completely reworked for 2.x packages, by Jose Carlos Garcia Sogo.
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
include /usr/share/quilt/quilt.make
ifndef PERL
PERL = /usr/bin/perl
endif
# C compiler information
CC = gcc
CFLAGS = -Wall -g
INSTALL = install
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# apxs2 needs CFLAGS as -Wc,-g -Wc,-O2
# the comma needs special 'escaping' due to $(patsubst X,Y,STR) syntax
comma:= ,
APXS_CFLAGS=$(patsubst %,-Wc$(comma)%,$(CFLAGS))
SPEEDY=speedy-cgi-perl
MOD_SPEEDY2=libapache2-mod-speedycgi
TMP_SCP = $(CURDIR)/debian/$(SPEEDY)
TMP_MOD_SCP2 = $(CURDIR)/debian/$(MOD_SPEEDY2)
build: $(QUILT_STAMPFN) build-stamp kill-backends-stamp
build-stamp:
dh_testdir
echo no | $(PERL) Makefile.PL
# rebuild these because the source is patched
$(MAKE) README README.html lib/CGI/SpeedyCGI.pm
# hack: rerun so it picks up lib/CGI/SpeedyCGI.pm again
echo no | $(PERL) Makefile.PL
cd mod_speedycgi2 && $(PERL) Makefile.PL
$(MAKE) OPTIMIZE="$(CFLAGS)"
$(MAKE) -C mod_speedycgi2 APXS=apxs2 DEBUG="$(APXS_CFLAGS)" \
LIB="$$(apr-config --link-ld) $$(apu-config --link-ld)"
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) -C speedy test
sleep 2
endif
touch build-stamp
kill-backends: kill-backends-stamp
kill-backends-stamp:
# kill any leftover speedy_backend processes
perl debian/list-backends "$(CURDIR)/speedy_backend/speedy_backend" | \
xargs --no-run-if-empty --verbose kill || true
touch kill-backends-stamp
clean: unpatch
dh_testdir
dh_testroot
$(RM) build-stamp install-speedy-stamp install-modspeedy2-stamp kill-backends-stamp
ifeq (Makefile,$(wildcard Makefile))
# the Makefile dpatch causes a timestamp issue
touch Makefile
$(MAKE) realclean
endif
[ ! -f mod_speedycgi2/Makefile ] || $(MAKE) -C mod_speedycgi2 realclean
dh_clean
install: install-speedy-stamp install-modspeedy2-stamp
install-speedy-stamp: build-stamp
dh_testdir --package=$(SPEEDY)
dh_testroot --package=$(SPEEDY)
dh_clean -k -d --package=$(SPEEDY)
dh_installdirs --package=$(SPEEDY)
$(INSTALL) -m 755 blib/script/* $(TMP_SCP)/usr/bin/
install -m 644 blib/lib/CGI/SpeedyCGI.pm $(TMP_SCP)/usr/lib/perl5/CGI/
install -m 644 blib/man3/CGI::SpeedyCGI.3pm $(TMP_SCP)/usr/share/man/man3
install -m 644 docs/*.html $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/
install -m 644 docs/file* $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/
install -m 644 docs/*txt $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/
install -m 644 docs/backend_parent $(TMP_SCP)/usr/share/doc/$(SPEEDY)/internals/
install -m 644 debian/lintian.override $(TMP_SCP)/usr/share/lintian/overrides/speedy-cgi-perl
touch install-speedy-stamp
install-modspeedy2-stamp: build-stamp
dh_testdir --package=$(MOD_SPEEDY2)
dh_testroot --package=$(MOD_SPEEDY2)
dh_clean -k -d --package=$(MOD_SPEEDY2)
dh_installdirs --package=$(MOD_SPEEDY2)
$(INSTALL) -m 644 mod_speedycgi2/mod_speedycgi.so $(TMP_MOD_SCP2)/usr/lib/apache2/modules
install -m 644 debian/speedycgi.load debian/speedycgi.conf \
$(TMP_MOD_SCP2)/etc/apache2/mods-available
touch install-modspeedy2-stamp
binary-indep:
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs README*
dh_installman
dh_installchangelogs Changes
dh_strip
dh_compress
dh_fixperms
dh_perl -V
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary patch unpatch install
|