File: rules

package info (click to toggle)
man2html 1.6g-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,724 kB
  • ctags: 3,346
  • sloc: ansic: 9,667; sh: 2,309; perl: 335; makefile: 327; awk: 305; lisp: 171; cs: 170; xml: 119
file content (67 lines) | stat: -rwxr-xr-x 2,459 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

DH_AUTO_OPTIONS := -v -Smakefile --parallel
DESTDIR         := $(CURDIR)/debian/tmp
TMPMAN          := debian/tmp.man
export DEBIAN_CFLAGS := -Wall -Wshadow $(shell getconf LFS_CFLAGS)

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
  CC := $(DEB_HOST_GNU_TYPE)-gcc
else
  CC := gcc
endif

%:
	dh "$@"

override_dh_auto_configure:
	./configure -d +fhs

override_dh_auto_build:
	dh_auto_build $(DH_AUTO_OPTIONS) -- makefiles CC=$(CC) 
	dh_auto_build $(DH_AUTO_OPTIONS) -- -C src version.h CC=$(CC)
	dh_auto_build $(DH_AUTO_OPTIONS) -- -C man2html CC=$(CC)
	dh_auto_build $(DH_AUTO_OPTIONS) -- -C debian/sources CC=$(CC)

override_dh_auto_clean:
	dh_auto_clean -v -Smakefile 
	$(MAKE) -C  debian/sources clean
	rm -rf $(TMPMAN)

override_dh_installdirs:
	for pkg in $(shell dh_listpackages); do      \
	        dh_installdirs -p$$pkg -P$(DESTDIR); \
	done
	dh_installdirs

override_dh_auto_install:	
	dh_auto_install $(DH_AUTO_OPTIONS) -- -C man2html install  install-hman
	dh_auto_install $(DH_AUTO_OPTIONS) -- -C debian/sources install
	
	chown root:www-data $(DESTDIR)/var/cache/man2html
	chmod 0775 $(DESTDIR)/var/cache/man2html

override_dh_installman:
	mkdir -p $(TMPMAN)
	
	find man man2html/locales  \( -name 'man2html.*' -o -name 'hman.*' \)                   \
	        | while read mp; do                                                             \
	        lang=`echo $$mp| sed -e 's|.*/\(..\)/[^/]*$$|\1|'` ;                            \
	        file="$(TMPMAN)/`basename $$mp`";                                               \
	        [ "$$lang" != "en"  ] || continue;                                              \
	        case $$mp in                                                                    \
	                *hman*) pkg=man2html ;;                                                 \
	                *) pkg=man2html-base ;;                                                 \
	        esac;                                                                           \
	        echo "Installing $$mp man page ($$lang) into package $$pkg" ;                   \
	        tr -d '\015' < "$$mp" > "$$file" || exit 1;                                     \
	        dh_installman --package $$pkg --language "$$lang" "$$file"  || exit 1;          \
	done
	dh_installman

override_dh_installdocs:
	dh_installdocs  --link-doc=man2html-base man2html/README man2html/TODO

override_dh_fixperms:
	dh_fixperms -X cache