File: rules

package info (click to toggle)
radiant 2.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,048 kB
  • sloc: perl: 5,393; sh: 323; makefile: 35
file content (44 lines) | stat: -rwxr-xr-x 1,571 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

# DH_VERBOSE := 1

include /usr/share/dpkg/default.mk

MANDIR=$(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1/
HELP2MAN = help2man --no-info --version-string="$(DEB_VERSION_UPSTREAM)" --no-discard-stderr --help-option=" "
# --help-option=" -h" # does not work in all cases

%:
	dh $@

override_dh_install:
	dh_install
	debian/install.pl -prefix debian/$(DEB_SOURCE)/usr -taxonomy /var/lib/$(DEB_SOURCE)/taxonomy -scriptpath "../share/perl5/KronaTools/scripts"
	for pl in `find debian -name "*.pl"` ; do \
	    sed -i '1s?^#!/usr/bin/env.*perl?#!/usr/bin/perl?' $${pl} ; \
	done

override_dh_installman_does_not_work__giving_up:
	dh_installman
	mkdir -p $(MANDIR)
	set -x ; \
	for script in debian/$(DEB_SOURCE)/usr/bin/* ; do \
	    name=`basename $${script}` ; \
	    pscript=`echo $${name} | sed 's:^kt\(.*\):\1.pl:'` ; \
	    pl="KronaTools/scripts/$${pscript}" ; \
	    title=`$${pl} | grep -A 2 '^Description:' | tail -n 1` ; \
	    if [ "$${title}" = "" ] ; then \
	        title=`$${pl} | grep -A2 -- \" - $${pscript} \" | tail -n1` ; \
	    fi ; \
	    if [ "$${title}" = "" ] ; then \
	        title="$${name} from KronaTools package" ; \
	    fi ; \
	    NAME=`echo $${name} | tr 'a-z' 'A-Z'` ; \
	    PSCRIPT=`echo $${pscript} | tr 'a-z' 'A-Z'` ; \
	    $(HELP2MAN) --name="$${title}" $${pl} | \
	        sed -e '/^.[IP]P/{;N;s/^.[IP]P\n____.*//;}' \
	            -e '/^.[IP]P/{;N;s/^.[IP]P\n____.*//;}' \
	            -e "s/$${pscript}/$${name}/g" \
	            -e "s/$${PSCRIPT}/$${NAME}/g" \
	        > $(MANDIR)/$${name}.1 ; \
	done