File: rules

package info (click to toggle)
gridsite 3.0.0~20180202git2fdbc6f-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,424 kB
  • sloc: ansic: 16,195; perl: 1,183; makefile: 525; sh: 414; xml: 252
file content (156 lines) | stat: -rwxr-xr-x 3,970 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
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/make -f
# -*- makefile -*-

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

-include /usr/share/dpkg/buildflags.mk

INSTALLDIR = $(CURDIR)/debian/tmp

_prefix = /usr
_bindir = $(_prefix)/bin
_sbindir = $(_prefix)/sbin
_libdir = $(_prefix)/lib
_includedir = $(_prefix)/include
_sysconfdir = /etc
_localstatedir = /var
_datadir = $(_prefix)/share
_mandir = $(_datadir)/man
_docdir = $(_datadir)/doc

export SOURCE_DATE_EPOCH = \
	$(shell date -d "$$(dpkg-parsechangelog -c 1 -S Date)" +%s)

configure: configure-stamp

configure-stamp:
	dh_testdir

	touch $@

build: build-indep build-arch

build-indep: build-stamp

build-arch: build-stamp

build-stamp: configure-stamp
	dh_testdir

	cd src && \
	$(MAKE) build prefix=/usr libdir=lib/$(DEB_HOST_MULTIARCH) \
	    CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"

	touch $@

clean:
	dh_testdir
	dh_testroot

	cd src && \
	$(MAKE) clean

	rm -rf doc/doxygen
	rm -f doc/*.1.html
	rm -f doc/*.8.html
	rm -f src/doxygen_sqlite3.db

	rm -f build-stamp configure-stamp

	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep

	cd src && \
	$(MAKE) install install-ws DESTDIR=$(INSTALLDIR) \
		prefix=/usr libdir=lib/$(DEB_HOST_MULTIARCH)

	# Change cgi scripts location
	mkdir -m 0755 -p $(INSTALLDIR)$(_libdir)/gridsite/cgi-bin
	mv $(INSTALLDIR)$(_sbindir)/*.cgi \
	   $(INSTALLDIR)$(_libdir)/gridsite/cgi-bin
	rmdir $(INSTALLDIR)$(_sbindir)

	# Let dh_apache2 handle module installation
	rm -rf $(INSTALLDIR)$(_libdir)/$(DEB_HOST_MULTIARCH)/httpd

	# Let debhelper do the compression
	gunzip $(INSTALLDIR)$(_mandir)/man*/*

	# This is not really useful
	rm $(INSTALLDIR)$(_libdir)/$(DEB_HOST_MULTIARCH)/libgridsite_globus.*
	rm $(INSTALLDIR)$(_libdir)/$(DEB_HOST_MULTIARCH)/libgridsite_nossl.*

	# Remove these - docs are installed using the debian/*.docs files
	rm -rf $(INSTALLDIR)$(_datadir)/doc

	# Set up root area to serve files from
	mkdir -m 0755 -p $(INSTALLDIR)$(_localstatedir)/lib/gridsite
	mkdir -m 0755 -p $(INSTALLDIR)$(_sysconfdir)/gridsite
	install -m 0644 debian/gridsitehead.txt \
	   $(INSTALLDIR)$(_sysconfdir)/gridsite/gridsitehead.txt
	install -m 0644 debian/gridsitefoot.txt \
	   $(INSTALLDIR)$(_sysconfdir)/gridsite/gridsitefoot.txt
	install -m 0644 debian/root-level.gacl \
	   $(INSTALLDIR)$(_sysconfdir)/gridsite/.gacl

	mkdir -m 0755 -p $(INSTALLDIR)$(_sysconfdir)/grid-security/dn-lists
	mkdir -m 0755 -p $(INSTALLDIR)$(_sysconfdir)/grid-security/vomsdir
	mkdir -m 0755 -p $(INSTALLDIR)$(_localstatedir)/cache/mod_gridsite

	mkdir -m 0755 -p $(INSTALLDIR)$(_datadir)/apache2/icons
	uudecode -o $(INSTALLDIR)$(_datadir)/apache2/icons/gridsitelogo.png \
	   debian/gridsitelogo.png.uu

	chown www-data.www-data \
	  $(INSTALLDIR)$(_localstatedir)/lib/gridsite \
	  $(INSTALLDIR)$(_sysconfdir)/gridsite/.gacl \
	  $(INSTALLDIR)$(_sysconfdir)/gridsite/gridsitehead.txt \
	  $(INSTALLDIR)$(_sysconfdir)/gridsite/gridsitefoot.txt \
	  $(INSTALLDIR)$(_sysconfdir)/grid-security/dn-lists \
	  $(INSTALLDIR)$(_localstatedir)/cache/mod_gridsite

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs -i
	dh_installchangelogs -i
	dh_install -i
	dh_missing -i --fail-missing
	dh_lintian -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installdocs -a
	dh_installchangelogs -a
	dh_install -a
	dh_missing -a --fail-missing
	dh_apache2 -a
	dh_installman -a
	dh_lintian -a
	dh_link -a
	dh_strip -a --dbgsym-migration='gridsite-dbg (<< 3.0.0~), libgridsite-dbg (<< 3.0.0~)'
	dh_compress -a
	dh_fixperms -a -X var/lib/gridsite -X etc/gridsite \
		       -X var/cache/mod_gridsite -X etc/grid-security/dn-lists
	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

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