File: rules

package info (click to toggle)
lizardfs 3.10.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,072 kB
  • ctags: 9,596
  • sloc: cpp: 83,275; sh: 8,951; python: 3,872; ansic: 332; pascal: 128; makefile: 60
file content (90 lines) | stat: -rwxr-xr-x 2,978 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
#!/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),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 --parallel --with systemd,python2,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           \
               -DENABLE_TESTS=YES

override_dh_auto_install:
	dh_auto_install
	## rename config files
	for i in debian/tmp/etc/lizardfs/*.cfg.dist; do \
	    mv -n -v "$$i" "$${i%%.dist}"          \
	;done

override_dh_python2:
	dh_python2
	dh_python2 /usr/share/mfscgi

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_compress:
	## See #781131
	dh_compress --exclude="examples/mfsexports.cfg" --exclude="examples/mfsmaster.cfg"

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_installinit:
	dh_installinit --no-start

override_dh_systemd_start:
	dh_systemd_start --no-start

override_dh_systemd_enable:
	dh_systemd_enable --no-enable

override_dh_strip:
	dh_strip --dbgsym-migration='lizardfs-dbg (<< 3.10.0~)'

## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
PKD   = $(abspath $(dir $(MAKEFILE_LIST)))
PKG   = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
VER  ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog -SVersion | perl -ne 'print $$1 if m{^(?:\d+:)?(\d.*)(?:\-\d+.*)};')
REV   = $(shell sh -c 'printf "$${1\#\#*\.0\.}"' -- "$(VER)")

get-orig-source: $(PKG)_$(VER).orig.tar.xz $(info I: $(PKG)_$(VER))
	@

UURL = https://github.com/lizardfs/lizardfs
$(PKG)_$(VER).orig.tar.xz:
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Downloading..."
	wget --tries=3 --timeout=40 --read-timeout=40 --continue -O $@ \
          $(UURL)/archive/$(REV).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 . $@