File: rules

package info (click to toggle)
libgphoto2 2.5.12-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 26,708 kB
  • ctags: 13,757
  • sloc: ansic: 121,832; sh: 5,154; xml: 4,811; perl: 975; makefile: 637; yacc: 337; lex: 92; cpp: 22; sed: 16
file content (89 lines) | stat: -rwxr-xr-x 3,406 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

DOC_IMG=$(CURDIR)/debian/libgphoto2-dev-doc/usr/share/doc/libgphoto2-6/libgphoto2-api.html

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -fPIE -pie

### soname version - libgphoto2-major:
major=6

### Architecture handling:
CONFIGURE_OPTIONS += --without-libusb
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifeq ($(DEB_HOST_ARCH_OS),hurd)
  CONFIGURE_OPTIONS += --without-libusb-1.0
endif

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

### Overrides:
override_dh_auto_configure:
	dh_auto_configure -- CFLAGS="$(CFLAGS) -fPIE" CXXFLAGS="$(CXXFLAGS) -fPIE" --with-drivers=all --enable-static $(CONFIGURE_OPTIONS)

override_dh_auto_install:
	LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
	# Remove upstream 0-byte files to make lintian happy. Print them first:
	find debian/tmp -size 0 -print
	find debian/tmp -size 0 -delete
	# Remove the COPYING file, debian/copyright is there already:
	find debian/tmp -name COPYING -delete
	# Remove the recursive symlink:
	rm debian/tmp/usr/include/gphoto2/gphoto2
	# new path for obsolete gphoto2-* scripts
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2-dev/bin
	cp -a debian/tmp/usr/bin/gphoto2-* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2-dev/bin
		
override_dh_install:
	dh_install --list-missing -X.la
	# Double-check that and act accordingly:
	-test -e debian/tmp/usr/lib/udev/check-mtp-device && \
		mkdir -p debian/libgphoto2-port12/lib/udev && \
		mv debian/tmp/usr/lib/udev/check-mtp-device \
			debian/libgphoto2-port12/lib/udev/check-mtp-device
	# Using rdfind and symlinks to transform duplicated files in softlinks
	rdfind -makesymlinks true -makeresultsfile false $(DOC_IMG)
	symlinks -cr $(DOC_IMG)

ifeq ($(DEB_HOST_ARCH_OS),linux)
override_dh_installudev:
	# No longer needed with current udev. But check with non-Linux architectures stuff:
	# rm debian/libgphoto2-2/lib/udev/check-ptp-camera
	# Generate the udev file, get it installed, and clean:
	CAMLIBS=`ls -d debian/libgphoto2-$(major)/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/2*` ./packaging/generic/print-camera-list udev-rules version 201 mode 0664 group plugdev > debian/libgphoto2-$(major).udev
	mkdir -p debian/libgphoto2-$(major)/lib/udev/hwdb.d/
	CAMLIBS=`ls -d debian/libgphoto2-$(major)/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/2*` ./packaging/generic/print-camera-list hwdb > debian/libgphoto2-$(major)/lib/udev/hwdb.d/20-libgphoto2-$(major).hwdb
	dh_installudev
	rm debian/libgphoto2-$(major).udev
endif

override_dh_fixperms:
	dh_fixperms --exclude usbcam

override_dh_makeshlibs:
	dh_makeshlibs -plibgphoto2-$(major) -X/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/
	dh_makeshlibs -plibgphoto2-port12 -X/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2_port/

override_dh_shlibdeps:
	dh_shlibdeps -ldebian/libgphoto2-$(major)/usr/lib/:debian/libgphoto2-port12/usr/lib/

override_dh_installchangelogs:
	dh_installchangelogs NEWS

ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
override_dh_strip:
	dh_strip
	find . -name '*.a' \( \! -name '*_g.a' \) \
	-exec strip --strip-debug \
	--remove-section=.comment \
	--remove-section=.note {} \;
endif

ifeq (linux,$(DEB_HOST_ARCH_OS))
override_dh_gencontrol:
	dh_gencontrol
	dh_gencontrol -plibgphoto2-$(major) -- -Vudev-hotplug='udev (>= 201)'
endif

%:
	dh $@ --with autoreconf