File: rules

package info (click to toggle)
serf 1.3.9-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,512 kB
  • sloc: ansic: 17,233; python: 241; makefile: 65; sh: 50
file content (58 lines) | stat: -rwxr-xr-x 1,740 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
#!/usr/bin/make -f
# -*- makefile -*-

DEB_BUILD_MAINT_OPTIONS=hardening=+all
DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs
include /usr/share/dpkg/default.mk

libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
libpkg = libserf-1-1

parallel =
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    parallel = -j $(NUMJOBS)
endif

silent =
ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
    silent = --silent
endif

%:
	dh $@

.PHONY: build
build: build-arch build-indep
override_dh_auto_build:
	scons $(parallel) $(silent) GSSAPI=/usr CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LINKFLAGS="$(LDFLAGS)" PREFIX=/usr LIBDIR=$(libdir)

ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	if ! [ -d debian/distcerts ]; then \
	    mkdir -p debian/testcerts/private debian/distcerts; \
	    cp test/server/*.pem test/server/serfclientcert.p12 debian/distcerts/; \
	    (cd debian/testcerts && python3 ../create_certs.py); \
	    cp debian/testcerts/*.pem debian/testcerts/private/serfserverkey.pem debian/testcerts/serfclientcert.p12 test/server/; \
	fi
	scons $(silent) check CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LINKFLAGS="$(LDFLAGS)"
endif

override_dh_auto_clean:
	rm -rf debian/testcerts
	if [ -d debian/distcerts ]; then \
	    rm test/server/*.pem test/server/*.p12; \
	    cp debian/distcerts/* test/server/; \
	fi
	scons -c

override_dh_auto_install:
	scons $(silent) install PREFIX=$(CURDIR)/debian/tmp/usr LIBDIR=$(CURDIR)/debian/tmp$(libdir)
	chrpath -d $(CURDIR)/debian/tmp/$(libdir)/*.so.*

override_dh_installchangelogs:
	dh_installchangelogs CHANGES

override_dh_shlibdeps:
	dh_shlibdeps
	sed -i 's:libserf-private\(, *\)\?::' debian/*.substvars