File: rules

package info (click to toggle)
libmath-prime-util-perl 0.73-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,800 kB
  • sloc: perl: 24,676; ansic: 11,471; python: 24; makefile: 18
file content (25 lines) | stat: -rwxr-xr-x 990 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')

%:
	dh $@

override_dh_auto_install:
	dh_auto_install
	mv $(TMP)/usr/bin/primes.pl $(TMP)/usr/bin/primes
	mkdir -p $(TMP)/usr/share/man/man1
	PERL5LIB=$(TMP)/$(ARCHLIB) help2man -n 'Display all primes' --no-info --no-discard-stderr $(TMP)/usr/bin/primes | gzip -9 > $(TMP)/usr/share/man/man1/primes.1.gz
	PERL5LIB=$(TMP)/$(ARCHLIB) help2man -n 'Print prime factors' --no-info --no-discard-stderr $(TMP)/usr/bin/factor.pl | gzip -9 > $(TMP)/usr/share/man/man1/factor.pl.1.gz
	find $(TMP)/usr/bin -type f -print0 | \
		 xargs -r0 sed -i -e '1s|^#!/usr/bin/env perl|#!/usr/bin/perl|'

override_dh_installexamples:
	dh_installexamples
	find $(TMP)/usr/share/doc/$(PACKAGE)/examples -type f -name "*.pl" -print0 | \
		xargs -r0 sed -i -e '1s|^#!/usr/bin/env perl|#!/usr/bin/perl|'