File: rules

package info (click to toggle)
libmtp 1.0.3-1%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,024 kB
  • ctags: 2,871
  • sloc: ansic: 17,749; sh: 10,337; makefile: 145; python: 26; perl: 13
file content (75 lines) | stat: -rwxr-xr-x 2,256 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
#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_DH_INSTALL_SOURCEDIR = debian/tmp
DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
XP = xsltproc -''-nonet
SOVERSION = 8
SUBSTFILES = debian/libmtp$(SOVERSION).docs	\
	debian/libmtp$(SOVERSION).install	\
	debian/libmtp$(SOVERSION).preinst	\
	debian/libmtp$(SOVERSION).postinst
UDEVFILES = 45-libmtp$(SOVERSION).rules 20-libmtp$(SOVERSION).fdi

debdir = $(CURDIR)/debian
debver = $(shell perl -ne '/([\d.-]+)/;print "$$1"; last' \
		debian/changelog)

# Replace SOVERSION string in debian/ files
libmtp$(SOVERSION).%: libmtp.%.in
	sed "s/@SOVERSION@/$(SOVERSION)/g" < $<	> $@
%: %.in
	sed "s/@SOVERSION@/$(SOVERSION)/g" < $<	> $@

makebuilddir/libmtp$(SOVERSION):: $(SUBSTFILES) debian/control
	# Save file modified by configure
	test -e src/gphoto2-endian.h-orig \
		|| cp src/gphoto2-endian.h src/gphoto2-endian.h-orig

install/libmtp-doc::
	# Rename some man files and remove others
	chmod +x debian/sanitize-manpage.pl
	( cd doc/man/man3/ ;						\
	  rm -f _* ;							\
	  for i in $$(ls *.3 | grep -v ^mtp_) ; do			\
		../../../debian/sanitize-manpage.pl < $$i > mtp_$$i ;	\
	  done )

binary-install/libmtp-dev::
	rm -f debian/libmtp-dev/usr/lib/libmtp.la

build/libmtp$(SOVERSION)::
	# Fix mode of udev lifting script
	chmod +x libmtp.sh
	# Adapt upstream udev rules file to Debian standards
	perl -pi -e 's/MODE.*/MODE="660", GROUP="audio"/ if /MODE/' \
		libmtp.rules
	# Rename udev files
	for f in $(UDEVFILES) ; do				\
		cp libmtp.$${f#*.} $$f ;			\
	done

binary-predeb/libmtp$(SOVERSION)::
ifeq (linux,$(DEB_HOST_ARCH_OS))
	echo "udev=udev" >> debian/libmtp$(SOVERSION).substvars
endif
	# Remove rpath from the library
	chrpath --delete $(debdir)/libmtp$(SOVERSION)/usr/lib/libmtp.so.*.*

mtp-tools.1: debian/mtp-tools.dbk
	# Build and install the man page for mtp-tools
	$(XP) $(DB2MAN) $<

build/mtp-tools:: mtp-tools.1

binary-predeb/mtp-tools::
	# Remove rpath from programs
	chrpath --delete $(debdir)/mtp-tools/usr/bin/*

clean::
	rm -f mtp-tools.1 $(SUBSTFILES) $(UDEVFILES)
	# Restore original file
	test ! -e src/gphoto2-endian.h-orig \
		|| mv src/gphoto2-endian.h-orig src/gphoto2-endian.h