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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
## fix FTBFS@ppc64: https://github.com/lizardfs/lizardfs/issues/249
ifneq (,$(filter $(DEB_HOST_ARCH),armel mips mipsel powerpc powerpcspe sparc hppa m68k sh4))
DEB_LDFLAGS_MAINT_APPEND = -latomic
endif
# minimise needless linking
export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed
export XSLTPROCFLAGS=--nonet
%:
dh $@ --buildsystem=cmake --builddirectory=build --with python3,bash-completion
override_dh_auto_clean:
$(RM) -rv external/gtest
dh_auto_clean
override_dh_auto_configure:
## copy gtest sources
mkdir -p external/gtest
cp -Rv /usr/src/googletest/googletest/* external/gtest/
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_VERBOSE_ASCIIDOC=ON \
-DENABLE_DEBIAN_PATHS=YES \
-DENABLE_TCMALLOC=NO \
-DENABLE_UTILS=YES \
-DGENERATE_GIT_INFO=NO \
;
# -DENABLE_TESTS=YES
override_dh_auto_install:
dh_auto_install
## rename config files
#for i in debian/tmp/etc/saunafs/*.cfg.dist; do \
# mv -n -v "$$i" "$${i%%.dist}" \
#;done
override_dh_gencontrol:
dh_gencontrol -- -Vmy:Built-Using="$(foreach pkg,googletest,$(word 2,$(shell dpkg --status $(pkg) | grep ^Package)) (=$(word 2,$(shell dpkg --status $(pkg) | grep Version))),)"
override_dh_installchangelogs:
dh_installchangelogs NEWS
override_dh_installinit:
dh_installinit --no-start
override_dh_installsystemd:
dh_installsystemd --no-stop-on-upgrade --no-enable --no-start
dh_installsystemd --no-stop-on-upgrade --no-enable --no-start -psaunafs-uraft --name=saunafs-uraft-master
override_dh_strip:
dh_strip --dbgsym-migration='saunafs-dbg (<< 3.10.0~)'
## http://wiki.debian.org/onlyjob/get-orig-source
include /usr/share/dpkg/pkg-info.mk
.PHONY: get-orig-source
PKD = $(abspath $(dir $(MAKEFILE_LIST)))
VER ?= $(shell sh -c 'printf "$${1%%+dfsg*}"' -- "$(DEB_VERSION_UPSTREAM)")
get-orig-source: $(DEB_SOURCE)_$(VER).orig.tar.xz $(info I: $(DEB_SOURCE)_$(VER))
@
UURL = https://github.com/leil/saunafs
$(DEB_SOURCE)_$(VER).orig.tar.xz:
$(if $(wildcard $(DEB_SOURCE)-$(VER)),$(error $(DEB_SOURCE)-$(VER) exist, aborting..))
@echo "# Downloading..."
wget --tries=3 --timeout=40 --read-timeout=40 --continue -O $@ \
$(UURL)/archive/v$(VER).tar.gz \
|| uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-current-version $(PKD)
mk-origtargz --repack --repack-suffix "" --compression xz --directory . $@
|