File: rules

package info (click to toggle)
pciutils 1:3.5.2-1
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 3,340 kB
  • ctags: 2,099
  • sloc: ansic: 10,662; sh: 388; perl: 384; makefile: 263
file content (100 lines) | stat: -rwxr-xr-x 3,065 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
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/make -f

export DH_VERBOSE=1

#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
export PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config
export HOST=$(DEB_HOST_GNU_CPU)-$(DEB_HOST_ARCH_OS)
CROSS=CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- HOST=$(HOST)
endif

ifeq ($(DEB_HOST_ARCH_OS),linux)
LINUX_FEATURES=LIBKMOD=yes HWDB=yes
endif

PATHS := LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) PREFIX=/usr SBINDIR=/usr/bin IDSDIR=/usr/share/misc

update-ids:
	# get a new version of pci.ids, this should only be run by the
	# maintainer, since we don't want different builds of the same
	# source to end up with different versions
	./update-pciids.sh
	rm -f pci.ids.old
	#gunzip pci.ids.gz

build-arch: build
build-indep: build
build:
	dh_testdir
	OPT="$(CFLAGS)" $(MAKE) $(CROSS) $(PATHS) SHARED=yes $(LINUX_FEATURES)

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) $(PATHS) clean
	rm -f lspci-udeb
	dh_clean

# Build architecture-independent files here.
binary-indep:

# Build architecture-dependent files here.
binary-arch: build 
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -a

	$(MAKE) $(CROSS) $(PATHS) install DESTDIR=debian/pciutils STRIP=

	# pciutils
	gunzip debian/pciutils/usr/share/misc/pci.ids.gz
	mv debian/pciutils/usr/bin/update-pciids debian/pciutils/usr/sbin

	# libpci-dev
	mkdir -p debian/libpci-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
	install -m 644 lib/libpci.a debian/libpci-dev/usr/lib/$(DEB_HOST_MULTIARCH)
	install -m 644 lib/pci.h lib/header.h lib/config.h lib/types.h \
			debian/libpci-dev/usr/include/pci/
	install -m 644 lib/libpci.pc debian/libpci-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/
	ln -s /lib/$(DEB_HOST_MULTIARCH)/libpci.so.3.5.2 debian/libpci-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libpci.so

	# libpci3
	mkdir -p debian/libpci3/lib/$(DEB_HOST_MULTIARCH)
	install -m 644 lib/libpci.so* debian/libpci3/lib/$(DEB_HOST_MULTIARCH)
	ln -s libpci.so.3.5.2 debian/libpci3/lib/$(DEB_HOST_MULTIARCH)/libpci.so.3

	# pciutils-udeb
	# Reduce by removing subsystem ids and comments.
	perl -ne 'print unless /^(\s*#|\s*$|\t\t)/' < pci.ids |gzip -9n > debian/pciutils-udeb/usr/share/misc/pci.ids.gz
	chmod 644 debian/pciutils-udeb/usr/share/misc/pci.ids.gz

	# libpci3-udeb
	install -m 644 lib/libpci.so* debian/libpci3-udeb/lib/
	ln -s libpci.so.3.5.2 debian/libpci3-udeb/lib/libpci.so.3

	dh_installdocs
	dh_installexamples example.c
	dh_installmenu
	dh_installman -ppciutils
	dh_installchangelogs -a ChangeLog
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -V 'libpci3 (>= 1:3.5.2-1)' --add-udeb=libpci3-udeb
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: update-ids build clean binary-indep binary-arch binary source diff