File: rules

package info (click to toggle)
libblkmaker 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 176 kB
  • ctags: 165
  • sloc: ansic: 1,306; makefile: 67; sh: 7
file content (53 lines) | stat: -rwxr-xr-x 1,598 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
PKG  = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))

API=-$(shell perl -ne 'print $$1 if m{LIBBLKMAKER_API_VERSION\],\s*\[([\d\.]+)\]}' configure.ac)
SO=-$(shell perl -ne 'print $$1 if m{LIBBLKMAKER_SO_VERSION\],\s*\[([\d]+)}' configure.ac)
#plib=$(PKG)$(API)$(SO)
plib=$(PKG)$(API)-6
pdev=$(PKG)$(API)-dev
pdbg=$(PKG)$(API)-dbg

# Ensure the build aborts when there are still references to undefined
# symbols: LDFLAGS += -Wl,-z,defs

# Make the linker work a bit harder so dynamic loading can be done
# faster: LDFLAGS += -Wl,-O1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,-O1

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

override_dh_auto_configure:
	dh_auto_configure -- --disable-silent-rules

override_dh_install:
	$(info I: library-name=$(plib))
	$(if $(wildcard debian/$(plib).symbols),,$(error invalid package/library name..))
	dh_install -p$(plib) --autodest    \
            usr/lib/*/lib*-[0-9]*.so.*
	dh_install -p$(pdev) --autodest      \
            usr/include/*/*                   \
            usr/lib/*/lib*-[0-9.]*.so          \
            usr/lib/*/pkgconfig/lib*-[0-9.]*.pc

override_dh_installdocs:
	dh_installdocs --link-doc=$(plib)

# not needed when .symbols present
#override_dh_makeshlibs:
#	dh_makeshlibs -v -V

override_dh_gencontrol:
	dh_gencontrol -v -- -Vplib=$(plib)