File: rules

package info (click to toggle)
krb5 1.22.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,652 kB
  • sloc: ansic: 293,109; python: 10,357; cpp: 9,477; makefile: 7,035; sh: 6,189; perl: 1,650; asm: 1,212; yacc: 933; javascript: 789; awk: 344; csh: 147; xml: 135; lisp: 104
file content (164 lines) | stat: -rwxr-xr-x 6,253 bytes parent folder | download | duplicates (2)
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
#!/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


export DEB_HOST_MULTIARCH


# 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-mit12 libkadm5srv-mit12 libkdb5-10t64 libgssrpc4t64  \
	libkrb5support0  libk5crypto3 libkrad0

ifneq (,$(filter stage1,$(DEB_BUILD_PROFILES)))
KRB5_SKIP_LDAP=        1
endif

ifeq (,$(KRB5_SKIP_LDAP))
CONFIGURE_LDAP=        --with-ldap
else
CONFIGURE_LDAP=        --without-ldap
endif
DH_BUILD_OPTS= --sourcedir=src --builddir=build

build: build-arch build-indep

execute_before_dh_auto_build:
	# It's fine for a test program not to get some of the hardening flags because
	# it is never installed
	@echo 'blhc: ignore-line-regexp: .* -o t_trval .*'
	# It's not a problem that fortify flags are absent when preprosessor creates
	# version identifier in docs
	@echo 'blhc: ignore-line-regexp: .*doc/version.py'

override_dh_auto_configure:
	dh_auto_configure $(DH_BUILD_OPTS) -- --with-system-et --with-system-ss --disable-rpath  \
		--enable-shared $(CONFIGURE_LDAP) --without-tcl \
	--with-system-verto \
	--with-lmdb \
		--sysconfdir=/etc  \
		--localstatedir=/etc

override_dh_auto_build:
	dh_auto_build $(DH_BUILD_OPTS)

# Build the documentation in a separate directory, since otherwise we'll
# overwrite the info pages provided upstream and then debian/rules clean won't
build-indep: build-indep-stamp
# build-indep should not need to depend on build-arch, but currently it does at least to populate build/doc
# Add the dependency until we get a chance to make it work properly
build-indep-stamp:  build-arch
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
	cd build/doc && make PYTHON=python3 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
endif

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


override_dh_auto_install:

	dh_auto_install $(DH_BUILD_OPTS)
	install -d $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/krb5 $(CURDIR)/debian/tmp/etc/insserv/overrides
ifeq (,$(KRB5_SKIP_LDAP))
	install -m644 debian/krb5-kdc-ldap.insserv-override debian/tmp/etc/insserv/overrides/krb5-kdc
	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
else
	rm -f $(CURDIR)/debian/tmp/usr/share/man/man8/kdb5_ldap_util.8
endif
	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 -d $(CURDIR)/debian/tmp/usr/share/aclocal
	install -m644 src/util/ac_check_krb5.m4 \
		$(CURDIR)/debian/tmp/usr/share/aclocal


override_dh_install-arch:
	dh_install   $(EXCLUDE) --sourcedir=.
	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 -m 755 debian/krb5_newrealm \
		debian/krb5-admin-server/usr/sbin
	install -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
	for I in kdestroy kinit klist kpasswd ksu kadmin ktutil kswitch; do { \
		mv debian/krb5-user/usr/bin/$$I debian/krb5-user/usr/bin/$$I.mit; \
		mv debian/krb5-user/usr/share/man/man1/$$I.1 debian/krb5-user/usr/share/man/man1/$$I.mit.1; \
	} done

override_dh_installinit:
	# We don't need to override systemd because the systemd behavior is reasonable, and we're just trying to work around issues with error handling in init scripts
	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

override_dh_strip:
	set -e ; for pkg in $(LIB_PACKAGES) ; do \
		DH_OPTIONS="" dh_strip -p$$pkg --dbg-package=libkrb5-dbg; \
	done
	dh_strip

override_dh_makeshlibs:
	dh_makeshlibs -Xkrb5/plugins --  -c4

override_dh_fixperms-arch:
	dh_fixperms
	chmod u+s debian/krb5-user/usr/bin/ksu.mit
	chmod 700 debian/krb5-kdc/var/lib/krb5kdc
	chmod 700 debian/krb5-kdc/etc/krb5kdc

override_dh_auto_test:
	dh_auto_test $(DH_BUILD_OPTS) --no-parallel

%:
	dh $@


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