File: rules

package info (click to toggle)
manpages-ja 0.5.0.0.20210215%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 28,568 kB
  • sloc: perl: 161; makefile: 58
file content (72 lines) | stat: -rwxr-xr-x 3,753 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
#!/usr/bin/make -f

PKD   = $(abspath $(dir $(MAKEFILE_LIST)))
PKG   = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
UVER  = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
DTYPE = +dfsg
VER  ?= $(subst $(DTYPE),,$(UVER))

%:
	dh $@

override_dh_auto_build:
	( echo \$$DESTDIR/usr/share/man/ja; echo 0; echo; echo; echo y; yes c ) | $(MAKE) config

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
	# newgrp(1) should not be derived from util-linux, but from shadow, while overlapped with login package
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/newgrp.1
	# su(1) should be derived from util-linux since buster, not its original ancient version
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/su.1
	# These manpages should not be derived from util-linux, but from shadow, while overlapped with passwd package
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/chfn.1
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/chsh.1
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man8/vigr.8
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man8/vipw.8
	# passwd(5) should not be derived from LDP, but from shadow, while overlapped with passwd package
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man5/passwd.5
	# cal(1) should be derived from bsdmainutils, not from util-linux
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/cal.1
	# rename(1) should not be derived from util-linux (see #439935)
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/rename.1
	# overlapping manpages in dhcp3-common package
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man5/dhclient.conf.5
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man5/dhclient.leases.5
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man5/dhcp-options.5
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man5/dhcp-eval.5
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man8/dhclient-script.8
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man8/dhclient.8
	# Install the translated pages as Japanese version
	# since jless-specific description is removed from them.
	install debian/jless.1 $(CURDIR)/debian/tmp/usr/share/man/ja/man1
	install debian/jlesskey.1 $(CURDIR)/debian/tmp/usr/share/man/ja/man1
	# GNU thinks chroot is in bin, Debian thinks it is in sbin; mimic coreutils package
	sed 's/"1"/"8"/' $(CURDIR)/debian/tmp/usr/share/man/ja/man1/chroot.1 > $(CURDIR)/debian/tmp/usr/share/man/ja/man8/chroot.8
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/chroot.1
	# Move tcpdump(1) to tcpdump(8).
	mv $(CURDIR)/debian/tmp/usr/share/man/ja/man1/tcpdump.1 $(CURDIR)/debian/tmp/usr/share/man/ja/man8/tcpdump.8
	# glibc doesn't implement setproctitle(3).
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man3/setproctitle.3
	# gasp is no longer available
	rm -f $(CURDIR)/debian/tmp/usr/share/man/ja/man1/gasp.1

get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
	@

$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Extracting..."
	mkdir $(PKG)-$(VER) \
		&& tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
		|| $(RM) -r $(PKG)-$(VER)
	@echo "# Cleaning-up..."
	cd $(PKG)-$(VER) \
		&& $(RM) -r -v \
		manual/procps/man1/top.1 manual/LDP_man-pages/man7/uri.7
	#$(RM) -v $(PKG)_$(VER).orig.tar.*
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
		| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
		&& $(RM) -r "$(PKG)-$(VER)"