File: rules

package info (click to toggle)
myproxy 5.6-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,892 kB
  • sloc: ansic: 25,065; sh: 8,818; perl: 3,568; makefile: 521
file content (239 lines) | stat: -rwxr-xr-x 5,992 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#!/usr/bin/make -f
# -*- makefile -*-

name = myproxy
soname = 5

INSTALLDIR = $(CURDIR)/debian/tmp
GLOBUSPACKAGEDIR = $(INSTALLDIR)$(_datadir)/globus/packages

_prefix = /usr
_bindir = $(_prefix)/bin
_sbindir = $(_prefix)/sbin
_libdir = $(_prefix)/lib
_datadir = $(_prefix)/share
_mandir = $(_datadir)/man
_docdir = $(_datadir)/doc/lib$(name)-dev
_sysconfdir = /etc

DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

ifneq (,$(filter $(DEB_HOST_ARCH_CPU), amd64 alpha ia64 s390x ppc64 sparc64))
flavor = gcc64
else
flavor = gcc32
endif

sed: sed-stamp

sed-stamp:
	dh_testdir

	for f in `find . ! -path */.pc/* -name Makefile.am` ; do \
	  sed -e 's!^flavorinclude_HEADERS!include_HEADERS!' \
	      -e 's!\(lib[a-zA-Z_]*\)_$$(GLOBUS_FLAVOR_NAME)\.la!\1.la!g' \
	      -e 's!^\(lib[a-zA-Z_]*\)___GLOBUS_FLAVOR_NAME__la_!\1_la_!' \
	    -i $$f ; \
	done

	touch $@

unsed:
	dh_testdir

	if [ -e sed-stamp ] ; then \
	  for f in `find . ! -path */.pc/* -name Makefile.am` ; do \
	    sed -e 's!^include_HEADERS!flavorinclude_HEADERS!' \
		-e 's!\(lib[a-zA-Z_]*\)\.la!\1_$$(GLOBUS_FLAVOR_NAME).la!g' \
		-e 's!^\(lib[a-zA-Z_]*\)_la_!\1___GLOBUS_FLAVOR_NAME__la_!' \
	      -i $$f ; \
	  done ; \
	fi

	rm -f sed-stamp

configure: configure-stamp

configure-stamp: sed-stamp
	dh_testdir

	/usr/share/globus/globus-bootstrap.sh

	dh_autotools-dev_updateconfig

	./configure \
	   --disable-static \
	   --with-flavor=$(flavor) \
	   --with-voms=/usr \
	   --with-openldap=/usr \
	   --with-kerberos5=/usr \
	   --with-sasl2=/usr \
	   --enable-doxygen \
	   --with-docdir=$(_docdir)

	# Reduce overlinking
	sed 's!CC -shared !CC \\$${wl}--as-needed -shared !g' -i libtool

	touch $@

build: build-arch build-indep

build-arch: build-stamp

build-indep: build-stamp

build-stamp: configure-stamp
	dh_testdir

	$(MAKE)

	touch $@

clean: unsed
	dh_testdir
	dh_testroot

	if [ -r Makefile ] ; then $(MAKE) distclean ; fi

	dh_autotools-dev_restoreconfig

	# Remove autogenerated files

	rm -f aclocal.m4
	rm -f configure
	rm -f config.guess
	rm -f config.sub
	rm -f ltmain.sh
	rm -f mkinstalldirs

	rm -f doxygen/Doxyfile*
	rm -f doxygen/Makefile.am
	rm -f pkgdata/Makefile.am
	rm -f pkgdata/*.filelist
	rm -f pkgdata/*.gpt
	rm -f pkgdata/$(name).pc
	rm -f pkgdata/pkg_data_src.pc.in
	rm -f gptdata.sh
	rm -f globus_automake*
	rm -rf autom4te.cache

	rm -rf doxygen/doc

	find . -name Makefile.in -exec rm {} ';'

	rm -f build-stamp configure-stamp

	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep

	$(MAKE) install DESTDIR=$(INSTALLDIR)

	# Remove libtool archives (.la files)
	find $(INSTALLDIR)$(_libdir) -name 'lib*.la' -exec rm -v '{}' \;
	sed '/lib.*\.la$$/d' \
	  -i $(GLOBUSPACKAGEDIR)/$(name)/$(flavor)_dev.filelist

	# Move documentation to default debian location
	mkdir -p $(INSTALLDIR)$(_docdir)/lib$(name)-dev/extras
	for FILE in login.html myproxy-accepted-credentials-mapapp \
	  myproxy-cert-checker myproxy-certificate-mapapp \
          myproxy-certreq-checker myproxy-crl.cron myproxy.cron \
	  myproxy-get-delegation.cgi myproxy-get-trustroots.cron \
	  myproxy-passphrase-policy myproxy-revoke ; do \
	  mv $(INSTALLDIR)$(_datadir)/$(name)/$$FILE \
	     $(INSTALLDIR)$(_docdir)/lib$(name)-dev/extras ; \
	  sed -i "s!$(name)/$$FILE!doc/lib$(name)-dev/extras/$$FILE!" \
	    $(GLOBUSPACKAGEDIR)/$(name)/noflavor_data.filelist ; \
	done

	mkdir -p $(INSTALLDIR)$(_docdir)/$(name)
	for FILE in PROTOCOL VERSION ; do \
	  mv $(INSTALLDIR)$(_datadir)/$(name)/$$FILE \
	    $(INSTALLDIR)$(_docdir)/$(name) ; \
	  sed -i "s!$(name)/$$FILE!doc/$(name)/$$FILE!" \
	    $(GLOBUSPACKAGEDIR)/$(name)/noflavor_data.filelist ; \
	done

	# Remove irrelavent example configuration files.
	for FILE in etc.inetd.conf.modifications etc.init.d.myproxy.nonroot \
	  etc.services.modifications etc.xinetd.myproxy \
	  etc.init.d.myproxy LICENSE* INSTALL README ; do \
	  rm $(INSTALLDIR)$(_datadir)/$(name)/$$FILE ; \
	  sed -i "/share\/$(name)\/$$FILE/d" \
	    $(GLOBUSPACKAGEDIR)/$(name)/noflavor_data.filelist ; \
	done

	# Move example configuration file into place.
	mkdir -p $(INSTALLDIR)$(_sysconfdir)
	mv $(INSTALLDIR)$(_datadir)/$(name)/myproxy-server.config \
	   $(INSTALLDIR)$(_sysconfdir)
	sed -i "/share\/$(name)\/myproxy-server.config/d" \
	  $(GLOBUSPACKAGEDIR)/$(name)/noflavor_data.filelist

	mkdir -p $(INSTALLDIR)/var/lib/$(name)
	chmod 700 $(INSTALLDIR)/var/lib/$(name)

	# Create a directory to hold myproxy owned host certificates.
	mkdir -p $(INSTALLDIR)$(_sysconfdir)/grid-security/$(name)

	sed 's/\(^\.TH.*\) 1 /\1 8 /' \
	  -i $(INSTALLDIR)$(_mandir)/man8/myproxy-admin-query.8

	# Use system jquery script
	if [ -r $(INSTALLDIR)$(_docdir)/html/jquery.js ] ; then \
	  rm $(INSTALLDIR)$(_docdir)/html/jquery.js ; \
	  ln -s /usr/share/javascript/jquery/jquery.js \
	    $(INSTALLDIR)$(_docdir)/html/jquery.js ; \
	  echo js:Depends=libjs-jquery >> debian/lib$(name)-doc.substvars ; \
	else \
	  echo js:Depends= >> debian/lib$(name)-doc.substvars ; \
	fi

	# Check
	PATH=.:$$PATH ./myproxy-test -startserver -generatecerts

binary: binary-arch binary-indep

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installdocs -a
	dh_installchangelogs -a
	dh_install -a --fail-missing
	dh_installinit -a --name=myproxy-server
	dh_installman -a
	dh_link -a
	dh_strip -a --dbg-package=$(name)-dbg
	dh_compress -a
	dh_fixperms -a -X var/lib/$(name)
	dh_perl -a
	dh_lintian -a
	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a -l debian/lib$(name)$(soname)/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs -p lib$(name)-doc --link-doc=lib$(name)-dev
	dh_installdocs -i
	dh_installchangelogs -i
	dh_install -i --fail-missing
	dh_installman -i
	dh_link -i
	dh_compress -i -X .tag
	dh_fixperms -i
	dh_perl -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

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