Delete empty pages from pdf
[carnet-upgrade.git] / debian / rules
1 #!/usr/bin/make -f
2 # See debhelper(7) (uncomment to enable)
3 # output every command that modifies files on the build system.
4 #export DH_VERBOSE = 1
5
6 %:
7         dh $@
8
9 PKG_VERSION = $(shell dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p')
10
11 override_dh_auto_build:
12         # Update package version in documentation
13         sed -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' doc/carnet-upgrade-src.sgml \
14                 > doc/carnet-upgrade.sgml
15
16         # Build txt docs
17         (cd doc; debiandoc2text -l hr_HR.UTF-8 carnet-upgrade.sgml)
18
19         # Build one page html docs
20         rm -rf doc/carnet-upgrade.html
21         (cd doc; debiandoc2html -l hr_HR.UTF-8 -1 carnet-upgrade.sgml)
22         mv doc/carnet-upgrade.html/index.html doc/index.html
23         rmdir doc/carnet-upgrade.html
24         mv doc/index.html doc/carnet-upgrade.html
25
26         # Build pdf docs
27         (cd doc; debiandoc2pdf -l hr_HR.UTF-8 -s ../debian/fix_latex carnet-upgrade.sgml)
28         rm doc/carnet-upgrade.tpt
29
30 override_dh_install:
31         dh_install
32
33         # Update package version in source
34         sed -i -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' \
35                 debian/carnet-upgrade/usr/share/carnet-upgrade/cn-upgrade
36         # Remove documentation template
37         rm -f debian/carnet-upgrade/usr/share/doc/carnet-upgrade/carnet-upgrade-src.sgml