Make doc and src use the version from changelog.
[carnet-upgrade.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 # check if locale is available or use a local copy
13 ifeq ($(wildcard /usr/share/perl5/DebianDoc_SGML/Locale/hr_HR.UTF-8),)
14 perlenv = PERL5LIB=../debian/perl5
15 endif
16
17 PKG_VERSION = $(shell dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p')
18
19 build: build-stamp
20
21 build-stamp: doc/carnet-upgrade-src.sgml
22         dh_testdir
23
24         # Update package version in documentation
25         sed -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' doc/carnet-upgrade-src.sgml \
26                 > doc/carnet-upgrade.sgml
27
28         # Build txt docs
29         (cd doc; $(perlenv) debiandoc2text -l hr_HR.UTF-8 carnet-upgrade.sgml)
30
31         # Build one page html docs
32         rm -rf doc/carnet-upgrade.html
33         (cd doc; $(perlenv) debiandoc2html -l hr_HR.UTF-8 \
34                 -1 carnet-upgrade.sgml)
35         mv doc/carnet-upgrade.html/index.html doc/index.html
36         rmdir doc/carnet-upgrade.html
37         mv doc/index.html doc/carnet-upgrade.html
38
39         # Build pdf docs
40         (cd doc; $(perlenv) debiandoc2pdf -l hr_HR.UTF-8 \
41                 -s ../debian/fix_latex carnet-upgrade.sgml)
42         rm doc/carnet-upgrade.tpt
43
44         touch $@
45
46 clean:
47         dh_testdir
48         dh_testroot
49         rm -f build-stamp
50
51         # Clean up after the build process.
52         rm -rf doc/carnet-upgrade.{txt,html,pdf,tpt,sgml}
53
54         dh_clean 
55
56 install: build
57         dh_testdir
58         dh_testroot
59         dh_clean -k 
60         dh_installdirs
61
62         # Install the package.
63
64 # Build architecture-independent files here.
65 binary-indep: build install
66         dh_testdir
67         dh_testroot
68         dh_installchangelogs 
69         dh_installdocs
70         dh_installexamples
71         dh_install
72         # Update package version in source
73         sed -i -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' \
74                 debian/carnet-upgrade/usr/share/carnet-upgrade/cn-upgrade
75         # Remove documentation template
76         rm -f debian/carnet-upgrade/usr/share/doc/carnet-upgrade/carnet-upgrade-src.sgml
77 #       dh_installmenu
78         dh_installdebconf       
79 #       dh_installlogrotate
80 #       dh_installemacsen
81 #       dh_installpam
82 #       dh_installmime
83 #       dh_python
84 #       dh_installinit
85 #       dh_installcron
86 #       dh_installinfo
87         dh_installman
88         dh_link
89         dh_strip
90         dh_compress
91         dh_fixperms
92 #       dh_perl
93 #       dh_makeshlibs
94         dh_installdeb
95         dh_shlibdeps
96         dh_gencontrol
97         dh_md5sums
98         dh_builddeb
99
100 # Build architecture-dependent files here.
101 binary-arch: build install
102 # We have nothing to do here.
103
104 binary: binary-indep
105 .PHONY: build clean binary-indep binary-arch binary install