File: rules

package info (click to toggle)
xrootd 5.9.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,956 kB
  • sloc: cpp: 244,425; sh: 2,691; python: 1,980; ansic: 1,027; perl: 814; makefile: 272
file content (208 lines) | stat: -rwxr-xr-x 7,419 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
#!/usr/bin/make -f
# -*- makefile -*-

# Disable ceph dependent packages for architectures without ceph
# This list should match the Build-Depends on ceph libraries in debian/control
#
# Ceph requires boost-context and boost-coroutine
# These are only available on these Debian architectures:
#   i386 hurd-i386 amd64 hurd-amd64 armel armhf arm64 loong64
#   mips mipsel mips64el powerpc ppc64el riscv64 s390x
#
# Ceph requires Java
# Java is not available on these Debian architectures:
#   hppa hurd-i386 hurd-amd64
#
# Ceph only supports 64 bit architectures
ifneq ($(filter $(DEB_HOST_ARCH),amd64 arm64 loong64 mips64el ppc64el riscv64 s390x),)
CEPH = ON
else
CEPH = OFF
endif

ifneq ($(filter $(DEB_HOST_ARCH),amd64 arm64 mips64el ppc64el riscv64 s390x alpha hurd-amd64 loong64 ppc64 sparc64),)
EC = ON
else
EC = OFF
endif

ifneq ($(filter $(DEB_HOST_ARCH),armel armhf hppa loong64 m68k powerpc sh4),)
POSIX_TEST_BROKEN = 1
else
POSIX_TEST_BROKEN = 0
endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

BUILD_DOC = $(if $(filter xrootd-doc,$(shell dh_listpackages)),TRUE,FALSE)

%:
	dh $@ --with python3 --buildsystem cmake

override_dh_auto_configure:
	dh_auto_configure -- \
	    -DFORCE_ENABLED:BOOL=ON \
	    -DENABLE_TESTS:BOOL=ON \
	    -DENABLE_FUSE:BOOL=OFF \
	    -DENABLE_CEPH:BOOL=$(CEPH) \
	    -DENABLE_XRDEC:BOOL=$(EC) \
	    -DPIP_OPTIONS="--no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --verbose"

override_dh_auto_build:
	dh_auto_build
	[ "$(BUILD_DOC)" = "FALSE" ] || ( \
	doxygen Doxyfile && \
	sed 's!src=".*/xrootd-logo.png"!src="xrootd-logo.png"!' \
	    -i doxydoc/html/index.html && \
	cp -p docs/images/xrootd-logo.png doxydoc/html )

override_dh_auto_test:
	[ -r tests/XRootD/common.cfg.save ] || \
	    cp -p tests/XRootD/common.cfg tests/XRootD/common.cfg.save

	# Reduce socket path lengths used during tests
	# Tests fail with sockets in the build directory if path is too long
	mktemp -d -p /var/tmp > adminpath

	sed "s!all.adminpath .*!all.adminpath $$(cat adminpath)/XRootD!" \
	    -i tests/XRootD/common.cfg

	for x in authenticated_cluster badredir cluster TPCTests xcachewithcsi ; do \
	    sed "s!all.adminpath .*!all.adminpath $$(cat adminpath)/$${x}!" \
		-i obj-$(DEB_HOST_GNU_TYPE)/tests/$${x}/common.cfg ; \
	done

	# The XRootD::cluster::test fails the http protocol tests on some hosts
	# https://github.com/xrootd/xrootd/issues/2464

	# The badredir test fails when there is no network - exclude

	# The posix test is broken for 32 bit archs with 64 bit time_t ...
	# https://github.com/xrootd/xrootd/issues/2559
	# ... and for loong64
	# https://github.com/xrootd/xrootd/issues/2560

	touch testfile
	if ( setfattr -n user.testattr -v testvalue testfile ) ; then \
	    if [ $(POSIX_TEST_BROKEN) -eq 1 ] ; then \
		POSIXTEST='XRootD::posix::test|' ; \
	    fi ; \
	    HOSTNAME=localhost \
	    dh_auto_test -- ARGS+="-E '\
$${POSIXTEST}\
XRootD::authenticated_cluster::test|\
XRootD::badredir|\
XRootD::cluster::test'" ; \
	else \
	    echo "Extended file attributes not supported by file system" ; \
	    echo "Don't run tests that require them" ; \
	    HOSTNAME=localhost \
	    dh_auto_test -- ARGS+="-E '\
XrdCl::FileCopyTest|\
XrdCl::FileSystemTest.PlugInTest|\
XrdCl::FileSystemTest.ServerQueryTest|\
XrdCl::FileSystemTest.XAttrTest|\
XrdCl::FileTest.XAttrTest|\
XrdCl::LocalFileHandlerTest.XAttrTest|\
XrdCl::ThreadingTest|\
XrdCl::WorkflowTest.CheckpointTest|\
XrdCl::WorkflowTest.XAttrWorkflowTest|\
XrdEc::XrdEcTests|\
XRootD::authenticated_cluster::test|\
XRootD::badredir|\
XRootD::cluster::test|\
XRootD::http::test|\
XRootD::posix::test|\
XRootD::tpc::test'" ; \
	fi

	rm testfile
	mv tests/XRootD/common.cfg.save tests/XRootD/common.cfg
	rm -rf $$(cat adminpath)
	rm adminpath

override_dh_auto_clean:
	rm -f testfile
	[ -r tests/XRootD/common.cfg.save ] && \
	    mv tests/XRootD/common.cfg.save tests/XRootD/common.cfg || :
	[ -r adminpath ] && rm -rf $$(cat adminpath) || :
	rm -f adminpath
	dh_auto_clean

override_dh_auto_install:
	ln -sf libxrootd-private-dev.install.ec-$(EC) \
	   debian/libxrootd-private-dev.install

	DEB_PYTHON_INSTALL_LAYOUT=deb \
	_PYTHON_HOST_PLATFORM=$(DEB_HOST_ARCH_OS)-$(DEB_HOST_GNU_CPU) \
	dh_auto_install

	rm -f debian/tmp/usr/lib/*/libXrdCephPosix.so

	rm -f debian/tmp/usr/bin/xrdshmap

	rm -f debian/tmp/usr/lib/python3/dist-packages/xrootd-*.*-info/direct_url.json

	rm -f debian/tmp/usr/lib/*/cmake/XRootD/uninstall.cmake

	[ "$(BUILD_DOC)" = "FALSE" ] || ( \
	LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}:$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages \
	PYTHONDONTWRITEBYTECODE=1 \
	make -C bindings/python/docs html && \
	mv bindings/python/docs/build/html bindings/python/docs/build/python )

	# Service unit files
	mkdir -p debian/tmp/usr/lib/systemd/system
	install -m 644 packaging/common/xrootd@.service debian/tmp/usr/lib/systemd/system
	install -m 644 packaging/common/xrootd@.socket debian/tmp/usr/lib/systemd/system
	install -m 644 packaging/common/xrdhttp@.socket debian/tmp/usr/lib/systemd/system
	install -m 644 packaging/common/cmsd@.service debian/tmp/usr/lib/systemd/system
	install -m 644 packaging/common/frm_xfrd@.service debian/tmp/usr/lib/systemd/system
	install -m 644 packaging/common/frm_purged@.service debian/tmp/usr/lib/systemd/system
	mkdir -p debian/tmp/usr/lib/tmpfiles.d
	install -m 644 packaging/rhel/xrootd.tmpfiles debian/tmp/usr/lib/tmpfiles.d/xrootd.conf
	mkdir -p debian/tmp/usr/lib/sysusers.d
	install -m 644 packaging/rhel/xrootd-sysusers.conf debian/tmp/usr/lib/sysusers.d/xrootd.conf

	# Server config
	mkdir -p debian/tmp/etc/xrootd
	install -m 644 -p packaging/common/xrootd-clustered.cfg \
	    debian/tmp/etc/xrootd/xrootd-clustered.cfg
	install -m 644 -p packaging/common/xrootd-standalone.cfg \
	    debian/tmp/etc/xrootd/xrootd-standalone.cfg
	install -m 644 -p packaging/common/xrootd-filecache-clustered.cfg \
	    debian/tmp/etc/xrootd/xrootd-filecache-clustered.cfg
	install -m 644 -p packaging/common/xrootd-filecache-standalone.cfg \
	    debian/tmp/etc/xrootd/xrootd-filecache-standalone.cfg
	sed 's!/usr/lib64/!!' packaging/common/xrootd-http.cfg > \
	    debian/tmp/etc/xrootd/xrootd-http.cfg

	# Client config
	mkdir -p debian/tmp/etc/xrootd/client.plugins.d
	install -m 644 -p packaging/common/client.conf \
	    debian/tmp/etc/xrootd/client.conf
	sed 's!/usr/lib/!!' packaging/common/client-plugin.conf.example > \
	    debian/tmp/etc/xrootd/client.plugins.d/client-plugin.conf.example
	sed -e 's!/usr/lib64/!!' -e 's!-5!!' packaging/common/recorder.conf > \
	    debian/tmp/etc/xrootd/client.plugins.d/recorder.conf
	sed 's!/usr/lib64/!!' packaging/common/http.client.conf.example > \
	    debian/tmp/etc/xrootd/client.plugins.d/xrdcl-http-plugin.conf

	chmod 644 debian/tmp/usr/share/xrootd/utils/XrdCmsNotify.pm
	sed 's!/usr/bin/env perl!/usr/bin/perl!' -i \
	    debian/tmp/usr/share/xrootd/utils/netchk \
	    debian/tmp/usr/share/xrootd/utils/XrdCmsNotify.pm \
	    debian/tmp/usr/share/xrootd/utils/XrdOlbMonPerf

	sed 's!/usr/bin/env bash!/bin/bash!' -i \
	    debian/tmp/usr/bin/xrootd-config

	mkdir -p debian/tmp/etc/xrootd/config.d

	mkdir -p debian/tmp/var/log/xrootd
	mkdir -p debian/tmp/var/spool/xrootd

	mkdir -p debian/tmp/etc/logrotate.d
	install -m 644 -p packaging/common/xrootd.logrotate \
	    debian/tmp/etc/logrotate.d/xrootd