File: rules

package info (click to toggle)
dogtag-pki 11.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 73,404 kB
  • sloc: java: 339,416; sh: 290,677; python: 48,446; ansic: 39,816; cpp: 38,497; javascript: 19,449; xml: 5,399; jsp: 2,246; makefile: 704; sql: 96; perl: 11; exp: 8
file content (141 lines) | stat: -rwxr-xr-x 5,047 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
#!/usr/bin/make -f

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

include /usr/share/dpkg/architecture.mk

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

VER :=  $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)-.*$$/\1/ p' | sed -e 's/~.*//')

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-$(DEB_BUILD_ARCH)
PKI_JAVA_HOME=debian/tmp/usr/share/pki/java-home
PKI_JAVA_PATH=/usr/share/pki/java-home/bin/java
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
export CFLAGS += -I/usr/include/nss $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
export CXXFLAGS += -I/usr/include/nss -I/usr/include/apr-1.0 $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
export LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
DEB_BUILD_DIR ?= $(CURDIR)/build

CONFIGS = core

STAMP_DIR = debian/stamp
STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE)
BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS))

confflags = 

confflags-core = \
	-DJAVA_HOME=$(JAVA_HOME) \
	-DPKI_JAVA_PATH=$(PKI_JAVA_PATH) \
	-DVERSION=$(VER) \
	-DSYSTEMD_LIB_INSTALL_DIR=/lib/systemd/system \
	-DVAR_INSTALL_DIR:PATH=/var \
	-DRESTEASY_LIB=/usr/share/java/ \
	-DP11_KIT_TRUST=/usr/lib/$(DEB_HOST_MULTIARCH)/pkcs11/p11-kit-trust.so \
	-DPKI_CERTSRV_JAR=$(DEB_BUILD_DIR)/core/dist/pki-certsrv.jar \
	-DPKI_CMS_JAR=$(DEB_BUILD_DIR)/core/dist/pki-cms.jar \
	-DPKI_CMSBUNDLE_JAR=$(DEB_BUILD_DIR)/core/dist/pki-cmsbundle.jar \
	-DPKI_CMSUTIL_JAR=$(DEB_BUILD_DIR)/core/dist/pki-cmsutil.jar \
	-DNSS_DEFAULT_DB_TYPE=sql \
	-DBUILD_PKI_CORE:BOOL=ON \
	-DAPP_SERVER=tomcat-9.0 \
	-DBUILD_PKI_CONSOLE:BOOL=ON \
	-DTHEME=dogtag \
	-DWITH_TEST=OFF \

%:
	dh $@ --with javahelper,python3,apache2 --builddirectory=build/ \
		--buildsystem=pybuild

override_dh_auto_clean:
	rm -rf $(CURDIR)/build
	rm -f $(CURDIR)/base/common/python/pki/*.pyc
	rm -rf $(CURDIR)/tomcat
	rm -rf $(CURDIR)/.pybuild
	rm -rf $(CURDIR)/base/common/python/pki/__pycache__
	rm -rf $(CURDIR)/base/symkey/src/main/java/com/netscape/symkey/SessionKey.class

override_dh_auto_configure:

build-stamp: $(BUILD_STAMPS)
	>$@

$(STAMP)-build-%:
	mkdir -p $(DEB_BUILD_DIR)/$*
	cd $(DEB_BUILD_DIR)/$* && \
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
		-DSYSCONF_INSTALL_DIR:PATH=/etc \
		-DVAR_INSTALL_DIR:PATH=/var \
		-DJAVA_LIB_INSTALL_DIR=/usr/share/java \
		$(confflags-$*) \
		../../
	cd $(DEB_BUILD_DIR)/$* && make VERBOSE=1 $(MAKE_FLAGS)

override_dh_auto_build: build-stamp

override_dh_auto_install:
	set -e; for config in $(CONFIGS); do \
		make -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \
	done

	find $(CURDIR)/debian/tmp/usr/share/pki -name '*.cgi' -exec chmod 755 '{}' ';'
	find $(CURDIR)/debian/tmp/usr/share/pki -name '*.pl' -exec chmod 755 '{}' ';'
	find $(CURDIR)/debian/tmp/lib/systemd -exec chmod 644 '{}' ';'

	rm -f $(CURDIR)/debian/tmp/lib/systemd/pki-tomcatd@.service

override_dh_installinit:
	dh_installinit -ppki-server --name=pki-tomcatd --error-handler=invoke_failure

override_dh_installsystemd:
	dh_installsystemd -ppki-server --no-enable --name pki-tomcatd@
	dh_installsystemd -ppki-server --no-enable pki-tomcatd-nuxwdog@.service

override_dh_install:
	# we don't use these
	rm -rf $(CURDIR)/debian/tmp/etc/rc.d

	# tpsclient hasn't been ported to java yet
	rm -rf $(CURDIR)/debian/tmp/lib/systemd/system/pki-tpsd* \
		$(CURDIR)/debian/tmp/usr/lib/httpd/modules/mod_tps.so \
		$(CURDIR)/debian/tmp/usr/lib/httpd/modules/mod_tokendb.so \
		$(CURDIR)/debian/tmp/usr/lib/tps/libldapauth.so \
		$(CURDIR)/debian/tmp/usr/share/pki/tps/cgi-bin \
		$(CURDIR)/debian/tmp/usr/share/pki/tps/docroot \
		$(CURDIR)/debian/tmp/usr/share/pki/tps/lib \
		$(CURDIR)/debian/tmp/usr/share/pki/tps/scripts \
		$(CURDIR)/debian/tmp/usr/share/pki/tps/samples

	# not needed since we don't ship any binary applets
	rm -rf $(CURDIR)/debian/tmp/usr/share/pki/tps/applets

	ln -sf /usr/share/java/jboss-logging.jar $(CURDIR)/debian/tmp/usr/share/pki/lib/jboss-logging.jar
	ln -sf /usr/share/java/jboss-logging.jar $(CURDIR)/debian/tmp/usr/share/pki/server/common/lib/jboss-logging.jar

	ln -sf /usr/share/java/geronimo-annotation-1.3-spec.jar $(CURDIR)/debian/tmp/usr/share/pki/lib/geronimo-annotation-1.3-spec.jar
	ln -sf /usr/share/java/geronimo-annotation-1.3-spec.jar $(CURDIR)/debian/tmp/usr/share/pki/server/common/lib/geronimo-annotation-1.3-spec.jar

	# use our own symlink to the arch-dependent java dir
	ln -sf $(JAVA_HOME) $(PKI_JAVA_HOME)
	sed -i 's/lib\/jvm\/java-11-openjdk.*/share\/pki\/java-home/' \
		debian/tmp/usr/share/pki/etc/pki.conf

	rm -f $(CURDIR)/debian/tmp/usr/share/pki/lib/resteasy-jaxrs-jandex.jar

	dh_install

	mkdir -p debian/pki-server/usr/share/pki
	cp debian/tomcat-start.sh debian/pki-server/usr/share/pki

override_dh_missing:
	dh_missing --fail-missing

get-orig-source: SOURCE=dogtag-pki
get-orig-source: UV=$(shell dpkg-parsechangelog|awk '/^Version:/ {print $$2}'|sed 's/-.*$$//')
get-orig-source:
	tar --transform 's,^,$(SOURCE)-$(UV)/,' \
		--exclude 'debian' --exclude-vcs \
		-cJf ../$(SOURCE)_$(UV).orig.tar.xz .