#!/usr/bin/make -f # -*- makefile -*- export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow BUILD_DOC = $(if $(filter xrootd-doc,$(shell dh_listpackages)),TRUE,FALSE) CEPH = $(if $(filter xrootd-ceph-plugins,$(shell dh_listpackages)),ON,OFF) EC = $(if $(filter libxrdec6,$(shell dh_listpackages)),ON,OFF) TESTING = $(if $(filter nocheck,$(DEB_BUILD_PROFILES)),OFF,ON) %: dh $@ --with python3 --buildsystem cmake override_dh_auto_configure: # Delete bundled dependencies rm -f src/XrdXml/tinyxml/tiny* rm -rf vendor/bats rm -rf vendor/googletest dh_auto_configure -- \ -DFORCE_ENABLED:BOOL=ON \ -DENABLE_TESTS:BOOL=$(TESTING) \ -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 && \ cp -p docs/images/xrootd-logo.png doxydoc/html ) POSIX_TEST_BROKEN = $(if $(filter $(DEB_HOST_ARCH),alpha armel armhf i386 hppa hurd-i386 loong64 m68k powerpc sh4 sparc64),1,0) 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 ... # https://github.com/xrootd/xrootd/issues/2559 # ... and for loong64 # https://github.com/xrootd/xrootd/issues/2560 # CurlReadFixture.PrefetchTimeoutTest and # CurlWriteFixture.PutTimeoutTest fail on slow builders touch testfile if ( setfattr -n user.testattr -v testvalue testfile ) ; then \ if [ $(POSIX_TEST_BROKEN) -eq 1 ] ; then \ POSIXTEST='XRootD::posix|' ; \ fi ; \ dh_auto_test -- ARGS+="-E '\ $${POSIXTEST}\ CurlReadFixture.PrefetchTimeoutTest|\ CurlWriteFixture.PutTimeoutTest|\ XrdCl::FileSystemTest.PlugInTest|\ XrdCl::FileTest.PlugInTest|\ S3.*Fixture|\ XrdClS3::s3|\ XRootD::authenticated_cluster|\ XRootD::badredir|\ XRootD::cluster::test'" ; \ else \ echo "Extended file attributes not supported by file system" ; \ echo "*** NOT RUNNING TESTS ***" ; \ 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 python/docs html && \ mv python/docs/build/html python/docs/build/python ) # Service unit files mkdir -p debian/tmp/usr/lib/systemd/system install -m 644 -p systemd/xrootd@.service \ debian/tmp/usr/lib/systemd/system install -m 644 -p systemd/xrootd@.socket \ debian/tmp/usr/lib/systemd/system install -m 644 -p systemd/xrdhttp@.socket \ debian/tmp/usr/lib/systemd/system install -m 644 -p systemd/cmsd@.service \ debian/tmp/usr/lib/systemd/system install -m 644 -p systemd/frm_xfrd@.service \ debian/tmp/usr/lib/systemd/system install -m 644 -p systemd/frm_purged@.service \ debian/tmp/usr/lib/systemd/system mkdir -p debian/tmp/usr/lib/sysusers.d install -m 644 -p systemd/xrootd-sysusers.conf \ debian/tmp/usr/lib/sysusers.d/xrootd.conf # Server config mkdir -p debian/tmp/etc/xrootd install -m 644 -p config/xrootd-clustered.cfg \ debian/tmp/etc/xrootd/xrootd-clustered.cfg install -m 644 -p config/xrootd-standalone.cfg \ debian/tmp/etc/xrootd/xrootd-standalone.cfg install -m 644 -p config/xrootd-filecache-clustered.cfg \ debian/tmp/etc/xrootd/xrootd-filecache-clustered.cfg install -m 644 -p config/xrootd-filecache-standalone.cfg \ debian/tmp/etc/xrootd/xrootd-filecache-standalone.cfg install -m 644 -p config/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 config/client.conf \ debian/tmp/etc/xrootd/client.conf install -m 644 -p config/client.plugins.d/http.conf \ debian/tmp/etc/xrootd/client.plugins.d/http.conf install -m 644 -p config/client.plugins.d/recorder.conf \ debian/tmp/etc/xrootd/client.plugins.d/recorder.conf install -m 644 -p config/client.plugins.d/s3.conf \ debian/tmp/etc/xrootd/client.plugins.d/s3.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 config/xrootd.logrotate \ debian/tmp/etc/logrotate.d/xrootd