ncurses 6.0 - patch 20170708
[ncurses.git] / package / debian / rules
index 49978d86ab115a5f92a9f1a60759e96376346eef..9d0eb980dee142148db06ff6f5fd15fc7dc98404 100755 (executable)
@@ -7,7 +7,7 @@
 #export DH_VERBOSE=1
 
 # packages
-PACKAGES.indep = # ncurses6-docs
+PACKAGES.indep = ncurses6-doc ncurses6-doc-html
 PACKAGES.arch  = ncurses6 ncursest6
 
 # These are used for cross-compiling and for saving the configure script
@@ -131,6 +131,10 @@ config-ncursest6-stamp:
                --with-pthread
        touch $@
 
+config-ncurses6-doc-stamp \
+config-ncurses6-doc-html-stamp: config-ncurses6-stamp
+       touch $@
+
 build-ncurses6-stamp: config-ncurses6-stamp
        dh_testdir
 
@@ -145,6 +149,10 @@ build-ncursest6-stamp: config-ncursest6-stamp
 
        touch $@
 
+build-ncurses6-doc-stamp \
+build-ncurses6-doc-html-stamp: build-ncurses6-stamp
+       touch $@
+
 install-ncurses6-stamp: build-ncurses6-stamp
        dh_testdir
        dh_testroot
@@ -171,6 +179,28 @@ install-ncursest6-stamp: build-ncursest6-stamp
 
        touch $@
 
+install-ncurses6-doc-stamp: build-ncurses6-stamp
+       dh_testdir
+       dh_testroot
+       dh_installdirs $(verbose)
+       dh_prep        $(verbose) -pncurses6-doc
+
+       $(MAKE) -C t/ncurses6 install.man DESTDIR=$(NCURSES6_DIR)-doc
+
+       touch $@
+
+HTML_DESTDIR=$(NCURSES6_DIR)-doc-html/usr/share/ncurses6-doc-html
+install-ncurses6-doc-html-stamp: build-ncurses6-stamp
+       dh_testdir
+       dh_testroot
+       dh_installdirs $(verbose)
+       dh_prep        $(verbose) -pncurses6-doc-html
+
+       cd doc/html && find * -type d | sort | xargs -I{} mkdir -p -v $(HTML_DESTDIR)/{}
+       cd doc/html && find * -type f -name '*.html' | sort | xargs -I{} install -m 644 -p -v -T {} $(HTML_DESTDIR)/{}
+
+       touch $@
+
 # Build architecture-independent files here.
 binary-indep: install-indep
 ifneq ($(PACKAGES.indep),)