2fb76e905fa719c7b273893d8aca04de42c18b84
[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-arch build-indep
20 build-arch: build-stamp
21 build-indep: build-stamp
22
23 build-stamp: doc/carnet-upgrade-src.sgml
24         dh_testdir
25
26         # Update package version in documentation
27         sed -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' doc/carnet-upgrade-src.sgml \
28                 > doc/carnet-upgrade.sgml
29
30         # Build txt docs
31         (cd doc; $(perlenv) debiandoc2text -l hr_HR.UTF-8 carnet-upgrade.sgml)
32
33         # Build one page html docs
34         rm -rf doc/carnet-upgrade.html
35         (cd doc; $(perlenv) debiandoc2html -l hr_HR.UTF-8 \
36                 -1 carnet-upgrade.sgml)
37         mv doc/carnet-upgrade.html/index.html doc/index.html
38         rmdir doc/carnet-upgrade.html
39         mv doc/index.html doc/carnet-upgrade.html
40
41         # Build pdf docs
42         (cd doc; $(perlenv) debiandoc2pdf -l hr_HR.UTF-8 \
43                 -s ../debian/fix_latex carnet-upgrade.sgml)
44         rm doc/carnet-upgrade.tpt
45
46         touch $@
47
48 clean:
49         dh_testdir
50         dh_testroot
51         rm -f build-stamp
52
53         # Clean up after the build process.
54         rm -rf doc/carnet-upgrade.{txt,html,pdf,tpt,sgml}
55
56         dh_clean 
57
58 install: build
59         dh_testdir
60         dh_testroot
61         dh_clean
62         dh_installdirs
63
64         # Install the package.
65
66 # Build architecture-independent files here.
67 binary-indep: build install
68         dh_testdir
69         dh_testroot
70         dh_installchangelogs 
71         dh_installdocs
72         dh_installexamples
73         dh_install
74         # Update package version in source
75         sed -i -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' \
76                 debian/carnet-upgrade/usr/share/carnet-upgrade/cn-upgrade
77         # Remove documentation template
78         rm -f debian/carnet-upgrade/usr/share/doc/carnet-upgrade/carnet-upgrade-src.sgml
79 #       dh_installmenu
80         dh_installdebconf       
81 #       dh_installlogrotate
82 #       dh_installemacsen
83 #       dh_installpam
84 #       dh_installmime
85 #       dh_python
86 #       dh_installinit
87 #       dh_installcron
88 #       dh_installinfo
89         dh_installman
90         dh_link
91         dh_strip
92         dh_compress
93         dh_fixperms
94 #       dh_perl
95 #       dh_makeshlibs
96         dh_installdeb
97         dh_shlibdeps
98         dh_gencontrol
99         dh_md5sums
100         dh_builddeb
101
102 # Build architecture-dependent files here.
103 binary-arch: build install
104 # We have nothing to do here.
105
106 binary: binary-indep
107 .PHONY: build clean binary-indep binary-arch binary install