File: rules

package info (click to toggle)
findimagedupes 2.20.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 828 kB
  • sloc: perl: 1,066; makefile: 46; sh: 32
file content (38 lines) | stat: -rwxr-xr-x 1,292 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
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
pkg=findimagedupes
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

execute_before_dh_auto_configure:
	# Preserve files from modifications.
	cp Makefile Makefile.orig
	cp findimagedupes findimagedupes.orig
	# Autogenerate the C code from inline in findimagedupes.
	cp debian/C.pm.stub C.pm
	sed -n '/^__C__$$/,$$p' findimagedupes >> C.pm
	# Inject Debian invented Makefile.PL
	cp debian/Makefile.PL.stub Makefile.PL
	# Prepare upstream version number, but from Debian changelog;
	# see the "dist" target from upstream Makefile (and #1023939).
	echo $(DEB_VERSION) | cut -f 1 -d - > VERSION
	./patchver

execute_before_dh_auto_build:
	# Bug #531145: Removing installation instructions from the manpage, as
	# they are useless if the package is installed. Upstream has no other
	# documentation, so this section will stay in upstream's version.
	if grep -q '^=head1 INSTALLATION' $(pkg) \
	; then sed -i '/^=head1 INSTALLATION/,/^=head1 /{/^=head1 OPTIONS/p;d;}' $(pkg) \
	; fi

execute_before_dh_clean:
	[ ! -f findimagedupes.orig ] || mv findimagedupes.orig findimagedupes
	[ ! -f Makefile.orig ] || mv Makefile.orig Makefile
	rm -f C.pm Makefile.PL
	dh_clean

override_dh_auto_clean:
	@echo "I: dh_auto_clean step is disabled"