| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 8 |
|
| 9 |
## fix FTBFS@ppc64: https://github.com/lizardfs/lizardfs/issues/249 |
| 10 |
ifneq (,$(filter $(DEB_HOST_ARCH),armel mips mipsel powerpc powerpcspe sparc hppa m68k sh4)) |
| 11 |
DEB_LDFLAGS_MAINT_APPEND = -latomic |
| 12 |
endif |
| 13 |
|
| 14 |
# minimise needless linking |
| 15 |
export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed |
| 16 |
|
| 17 |
export XSLTPROCFLAGS=--nonet |
| 18 |
|
| 19 |
%: |
| 20 |
dh $@ --buildsystem=cmake --builddirectory=build --with python3,bash-completion |
| 21 |
|
| 22 |
override_dh_auto_clean: |
| 23 |
$(RM) -rv external/gtest |
| 24 |
dh_auto_clean |
| 25 |
|
| 26 |
override_dh_auto_configure: |
| 27 |
## copy gtest sources |
| 28 |
mkdir -p external/gtest |
| 29 |
cp -Rv /usr/src/googletest/googletest/* external/gtest/ |
| 30 |
dh_auto_configure -- \ |
| 31 |
-DCMAKE_BUILD_TYPE=Release \ |
| 32 |
-DCMAKE_INSTALL_PREFIX="/" \ |
| 33 |
-DCMAKE_VERBOSE_MAKEFILE=ON \ |
| 34 |
-DENABLE_VERBOSE_ASCIIDOC=ON \ |
| 35 |
-DENABLE_DEBIAN_PATHS=YES \ |
| 36 |
-DENABLE_TCMALLOC=NO \ |
| 37 |
-DENABLE_UTILS=YES \ |
| 38 |
-DGENERATE_GIT_INFO=NO \ |
| 39 |
; |
| 40 |
-DENABLE_TESTS=NO |
| 41 |
|
| 42 |
override_dh_auto_install: |
| 43 |
dh_auto_install |
| 44 |
## rename config files |
| 45 |
#for i in debian/tmp/etc/saunafs/*.cfg.dist; do \ |
| 46 |
# mv -n -v "$$i" "$${i%%.dist}" \ |
| 47 |
#;done |
| 48 |
|
| 49 |
override_dh_gencontrol: |
| 50 |
dh_gencontrol -- -Vmy:Built-Using="$(foreach pkg,googletest,$(word 2,$(shell dpkg --status $(pkg) | grep ^Package)) (=$(word 2,$(shell dpkg --status $(pkg) | grep Version))),)" |
| 51 |
|
| 52 |
override_dh_installchangelogs: |
| 53 |
dh_installchangelogs NEWS |
| 54 |
|
| 55 |
override_dh_installinit: |
| 56 |
dh_installinit --no-start |
| 57 |
|
| 58 |
override_dh_installsystemd: |
| 59 |
dh_installsystemd --no-stop-on-upgrade --no-enable --no-start |
| 60 |
dh_installsystemd --no-stop-on-upgrade --no-enable --no-start -psaunafs-uraft --name=saunafs-uraft-master |
| 61 |
|
| 62 |
override_dh_strip: |
| 63 |
dh_strip --dbgsym-migration='saunafs-dbg (<< 3.10.0~)' |
| 64 |
|
| 65 |
## http://wiki.debian.org/onlyjob/get-orig-source |
| 66 |
include /usr/share/dpkg/pkg-info.mk |
| 67 |
.PHONY: get-orig-source |
| 68 |
PKD = $(abspath $(dir $(MAKEFILE_LIST))) |
| 69 |
VER ?= $(shell sh -c 'printf "$${1%%+dfsg*}"' -- "$(DEB_VERSION_UPSTREAM)") |
| 70 |
|
| 71 |
get-orig-source: $(DEB_SOURCE)_$(VER).orig.tar.xz $(info I: $(DEB_SOURCE)_$(VER)) |
| 72 |
@ |
| 73 |
|
| 74 |
UURL = https://github.com/leil/saunafs |
| 75 |
$(DEB_SOURCE)_$(VER).orig.tar.xz: |
| 76 |
$(if $(wildcard $(DEB_SOURCE)-$(VER)),$(error $(DEB_SOURCE)-$(VER) exist, aborting..)) |
| 77 |
@echo "# Downloading..." |
| 78 |
wget --tries=3 --timeout=40 --read-timeout=40 --continue -O $@ \ |
| 79 |
$(UURL)/archive/v$(VER).tar.gz \ |
| 80 |
|| uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-current-version $(PKD) |
| 81 |
mk-origtargz --repack --repack-suffix "" --compression xz --directory . $@ |