File: rules

package info (click to toggle)
krb5 1.15-1+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 54,220 kB
  • ctags: 32,381
  • sloc: ansic: 310,596; cpp: 16,220; exp: 13,350; python: 7,990; makefile: 7,223; sh: 6,185; perl: 3,518; asm: 1,460; yacc: 1,006; xml: 503; awk: 396; csh: 147; lisp: 104; sed: 43
file content (211 lines) | stat: -rwxr-xr-x 7,853 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
#!/usr/bin/make -f
# Based on sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

SHELL=/bin/bash
export SHELL

# Tell Autoconf the correct system types.  Needed for cross builds.
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
    SYSTEM = --build $(DEB_HOST_GNU_TYPE)
    CACHE  =
else
    SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
    CACHE  = --cache-file=$(DEB_HOST_GNU_TYPE).cache
endif

export DEB_HOST_MULTIARCH

CCOPTS=-g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    CCOPTS +=-O0
else
    CCOPTS +=-O2
endif

ifneq (,$(filter i486-linux-gnu x86_64-linux-gnu,$(DEB_HOST_GNU_TYPE)))
    CCOPTS +=-D_FORTIFY_SOURCE=2 -fstack-protector
    endif
FLAGS=$(shell if res=`dpkg-buildflags --export=configure `; then echo $$res; else echo   CFLAGS="'$(CCOPTS)'"; fi)

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

# The flags to pass to dh_install specifying the upstream files to exclude.
# We use --fail-missing to be sure we catch any new upstream files, so be
# sure to update this list if upstream adds any more files we don't want.
EXCLUDE = -Xtmac.doc -Xexamples/krb5 -Xgnats/mit -Xkrb5-send-pr \
	-Xsserver -Xsim_server -Xuuserver \
	-Xsclient -Xsim_client -Xuuclient -Xpreauth/test.so

LIB_PACKAGES = libkrb5-3 libgssapi-krb5-2 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-8 libgssrpc4  \
	libkrb5support0  libk5crypto3 libkrad0

# We touch each configure and Autoconf-related file so that we do not attempt
# to use Autoconf.  The cache is used by the Embdebian project for cross
# compiles.
configure: configure-stamp
configure-stamp:
	dh_testdir
	mkdir -p build
	find src -name configure -print | xargs touch
	find src \( -name \*hin -o -name \*.h.in -o -name \*.stmp \) -print \
		| xargs touch
	[ ! -f $(DEB_HOST_GNU_TYPE).cache ] \
		|| cp $(DEB_HOST_GNU_TYPE).cache build/
	cd build && $(FLAGS) ../src/configure  \
		--prefix=/usr --localstatedir=/etc --mandir=/usr/share/man \
		--with-system-et --with-system-ss --disable-rpath  \
		--enable-shared --with-ldap --without-tcl \
	--with-system-verto \
		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
		--sysconfdir=/etc \
		$(SYSTEM) $(CACHE)
	touch configure-stamp

# Build the documentation in a separate directory, since otherwise we'll
# overwrite the info pages provided upstream and then debian/rules clean won't
# get back to a virgin copy of the package.
build: build-arch build-indep

build-arch: build-stamp

build-indep: build-indep-stamp

build-stamp: configure-stamp
	cd build && $(MAKE) $(NUMJOBS) all
	touch build-stamp

build-indep-stamp: build-stamp
	cd build/doc && make substhtml substpdf
	ln -sf /usr/share/javascript/jquery/jquery.js build/doc/html_subst/_static/jquery.js
	ln -sf /usr/share/javascript/underscore/underscore.js build/doc/html_subst/_static/underscore.js
	ln -sf /usr/share/javascript/sphinxdoc/1.0/doctools.js build/doc/html_subst/_static/doctools.js
	ln -sf /usr/share/javascript/sphinxdoc/1.0/searchtools.js build/doc/html_subst/_static/searchtools.js
	touch build-indep-stamp

clean:
	dh_testdir
	-rm -rf build doc/tools/*.pyc doc/version.py
	dh_clean build-stamp configure-stamp build-indep-stamp

install: DH_OPTIONS=
install: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	set -e; for file in krb5-kdc.dirs krb5-multidev.dirs krb5-multidev.links \
	            krb5-multidev.install libkrb5-3.dirs libkrb5-dev.dirs; \
	do \
		sed -e"s,\$${DEB_HOST_MULTIARCH},${DEB_HOST_MULTIARCH},g" \
			debian/$${file}.in > debian/$$file; \
	done
	dh_installdirs

	cd build && $(MAKE) install DESTDIR=`pwd`/../debian/tmp
	install -d $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/krb5 $(CURDIR)/debian/tmp/etc/insserv/overrides
	install -m644 debian/krb5-kdc-ldap.insserv-override debian/tmp/etc/insserv/overrides/krb5-kdc
	install -m644 $(CURDIR)/debian/README.mech.d $(CURDIR)/debian/libgssapi-krb5-2/etc/gss/mech.d/README
	mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libkdb_ldap* \
	    $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/krb5/
	rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/krb5/libkdb_ldap*.so
	mv $(CURDIR)/debian/tmp/usr/bin/krb5-config \
	    $(CURDIR)/debian/tmp/usr/bin/krb5-config.mit
	mv $(CURDIR)/debian/tmp/usr/share/man/man1/krb5-config.1 \
	    $(CURDIR)/debian/tmp/usr/share/man/man1/krb5-config.mit.1

	install -m644 src/util/ac_check_krb5.m4 \
		debian/libkrb5-dev/usr/share/aclocal

	dh_install --fail-missing $(EXCLUDE)
	set -e ; find debian/krb5-multidev/usr/lib/$(DEB_HOST_MULTIARCH)/mit-krb5 -type l -name \*.so -print |\
		while read linkname; do \
		ln -s -f ../`readlink $$linkname` \
		$$linkname; \
	done
		rm debian/krb5-multidev/usr/include/mit-krb5/krad.h debian/krb5-multidev/usr/lib/*/mit-krb5/libkrad.so
		for dir in include lib/$(DEB_HOST_MULTIARCH) lib/$(DEB_HOST_MULTIARCH)/pkgconfig; do \
		(cd debian/krb5-multidev/usr/$$dir/mit-krb5 && \
		find . -type d -print ) | (cd debian/libkrb5-dev/usr/$$dir && \
		xargs mkdir -p); \
		(cd debian/krb5-multidev/usr/$$dir/mit-krb5 && find . \( -type f -o -type l \) -print ) | \
		(cd debian/libkrb5-dev/usr/$$dir && xargs -I+ ln -s /usr/$$dir/mit-krb5/+ +) ; \
		done
	# however we will handle libkadm5{srv,clnt.so} in dh_link
# because they actually point to the current level not one level up
	rm -f debian/krb5-multidev/usr/lib/$(DEB_HOST_MULTIARCH)/mit-krb5/libkadm5{clnt,srv}.so


	docbook-to-man debian/krb5_newrealm.sgml \
		> debian/krb5-admin-server/usr/share/man/man8/krb5_newrealm.8
	install -o root -g root -m 755 debian/krb5_newrealm \
		debian/krb5-admin-server/usr/sbin
	install -o root -g root -m 644 debian/kdc.conf \
		debian/krb5-kdc/usr/share/krb5-kdc/kdc.conf.template
	ln -s /usr/share/krb5-kdc/kdc.conf.template \
		debian/krb5-kdc/usr/share/doc/krb5-kdc/examples/kdc.conf

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: DH_OPTIONS=-i
binary-indep: build-indep  install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installinfo
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
# Pass -a to all debhelper commands in this target to reduce clutter.  Strip
# library packages  separately and save the debug information for the
# libkrb5-dbg package.  This method strips the libraries in those packages
# twice, but that should be harmless and all other ways of doing this seem
# uglier.
binary-arch: DH_OPTIONS=-a
binary-arch: build-arch install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installdebconf
	DH_OPTIONS= dh_installinit -pkrb5-kdc --error-handler=init_error -- defaults 18 18 
	DH_OPTIONS= dh_installinit -pkrb5-kpropd -- defaults 18 18
		DH_OPTIONS= dh_installinit -pkrb5-admin-server -- defaults 18 18 
	dh_systemd_enable
	dh_lintian
	set -e ; for pkg in $(LIB_PACKAGES) ; do \
		DH_OPTIONS="" dh_strip -p$$pkg --dbg-package=libkrb5-dbg; \
		DH_OPTIONS="" dh_makeshlibs -p$$pkg -Xusr/lib/$(DEB_HOST_MULTIARCH)/krb5/plugins -- -c4 ; \
	done
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	chmod u+s debian/krb5-user/usr/bin/ksu
	chmod 700 debian/krb5-kdc/var/lib/krb5kdc
	chmod 700 debian/krb5-kdc/etc/krb5kdc
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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