File: rules

package info (click to toggle)
infinipath-psm 3.3+20.604758e7-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 2,364 kB
  • sloc: ansic: 34,270; makefile: 358; asm: 47; sh: 18
file content (59 lines) | stat: -rwxr-xr-x 2,036 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
#!/usr/bin/make -f

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_HOST_ARCH),amd64)
  ARCH := x86_64
else
  ARCH := $(DEB_HOST_ARCH)
endif

PSM_LIB_MAJOR := $(shell printf "%d" `sed -n 's/^\#define.*PSM_VERNO_MAJOR.*0x0\?\([1-9a-f]\?[0-9a-f]\+\).*/\1/p' $(CURDIR)/psm.h`)
PSM_LIB_MINOR := $(shell printf "%d" `sed -n 's/^\#define.*PSM_VERNO_MINOR.*\(0x[0-9a-f]\+\).*/\1/p' $(CURDIR)/psm.h`)
PSM_LIB_VERSION := ${PSM_LIB_MAJOR}.${PSM_LIB_MINOR}


MAKE_OPTIONS := INSTALL_PREFIX=/usr libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
  PSM_HAVE_SCIF=0 USE_PSM_UUID=0 arch=$(ARCH)

%:
	dh $@ --parallel

debian/%.postinst: debian/%.postinst.in
	sed 	-e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' 	\
		-e 's/@PSM_LIB_VERSION@/${PSM_LIB_VERSION}/g'		\
		-e 's/@PSM_LIB_MAJOR@/${PSM_LIB_MAJOR}/g'		\
		$< > $@

debian/%.prerm: debian/%.prerm.in
	sed	-e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g'	\
		-e 's/@PSM_LIB_VERSION@/${PSM_LIB_VERSION}/g'		\
		-e 's/@PSM_LIB_MAJOR@/${PSM_LIB_MAJOR}/g'		\
		$< > $@

debian/%.postrm: debian/%.postrm.in
	sed	-e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g'	\
		-e 's/@PSM_LIB_VERSION@/${PSM_LIB_VERSION}/g'		\
		-e 's/@PSM_LIB_MAJOR@/${PSM_LIB_MAJOR}/g'		\
		$< > $@

override_dh_auto_build: debian/libpsm-infinipath1.postinst debian/libpsm-infinipath1.prerm debian/libpsm-infinipath1.postrm
	$(MAKE) $(MAKE_OPTIONS)

override_dh_strip:
	dh_strip --dbg-package=libpsm-infinipath1-dbg

override_dh_auto_install:
	$(MAKE) install $(MAKE_OPTIONS) DESTDIR=$$PWD/debian/tmp
	mkdir debian/tmp/usr/lib/libpsm1/
	mv debian/tmp/usr/lib/*/libpsm_infinipath.so.${PSM_LIB_VERSION}  debian/tmp/usr/lib/libpsm1/

override_dh_auto_test:

override_dh_auto_clean:
	$(MAKE) $(MAKE_OPTIONS) distclean
	-rm -f include/linux-i386/linux-i386 include/linux-ppc/linux-ppc
	-[ ! -f debian/libpsm-infinipath1.postinst ] || rm debian/libpsm-infinipath1.postinst
	-[ ! -f debian/libpsm-infinipath1.prerm ] || rm debian/libpsm-infinipath1.prerm