lintian warning fixes
[ctsim.git] / debian / rules
1 #!/usr/bin/make -f
2
3 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
4         CFLAGS += -g
5 endif
6 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
7         INSTALL_PROGRAM += -s
8 endif
9
10 host_arch       := $(shell dpkg-architecture -qDEB_HOST_ARCH)
11
12 pkg             := ctsim
13 pkg-help        := ctsim-help
14 pkg-doc         := ctsim-doc
15
16 ctsim-shared    := usr/share/ctsim
17
18 prefix          := debian/$(pkg)
19 prefix-help     := debian/$(pkg-help)
20 prefix-doc      := debian/$(pkg-doc)
21
22 DESTDIR         := `pwd`/$(prefix)
23 HELPDIR         := `pwd`/$(prefix-help)/$(ctsim-shared)
24 doc-dir         := usr/share/doc/$(pkg-doc)
25 pixmap-dir      := usr/share/pixmaps
26 desktop-dir     := usr/share/applications
27
28 configure: configure-stamp
29 configure-stamp:
30         dh_testdir
31         autoreconf
32         touch configure.in && touch aclocal.m4 && touch configure
33         ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn -with-x --without-lam
34         touch configure-stamp
35
36
37 build-arch: configure-stamp build-arch-stamp
38 build-arch-stamp:
39         dh_testdir
40         # Add here commands to compile the package.
41         $(MAKE) all
42         touch build-arch-stamp
43
44 build-indep: configure-stamp  build-indep-stamp
45 build-indep-stamp:
46         dh_testdir
47         # Add here command to compile/build the arch indep package.
48         # It's ok not to do anything here, if you don't need to build
49         #  anything for this package.
50         #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
51         (cd docs; tar xzf html.tar.gz)
52         touch build-indep-stamp
53
54 build: build-arch build-indep
55
56 clean:
57         dh_testdir
58         dh_testroot
59         rm -f build-arch-stamp build-indep-stamp configure-stamp
60         if [ -f Makefile -a -f config.status ]; then $(MAKE) clean; fi
61         find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
62         rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
63         # Ensure up-to-date versions of config.sub and config.guess
64         -test -r /usr/share/misc/config.sub && cp -f /usr/share/misc/config.sub config.sub
65         -test -r /usr/share/misc/config.guess && cp -f /usr/share/misc/config.guess config.guess
66         -rm -f configure-stamp build-indep-stamp build-arch-stamp
67         -test -r Makefile && $(MAKE) clean
68         dh_clean
69
70 install: DH_OPTIONS=
71 install: build
72         dh_testdir
73         dh_testroot
74         dh_prep
75         dh_installdirs
76         #
77         dh_installdirs -p $(pkg-help) $(ctsim-shared)
78         ${MAKE} install
79         dh_installdirs -p $(pkg) $(pixmap-dir)
80         dh_installdirs -p $(pkg) $(desktop-dir)
81         dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
82         dh_install -p $(pkg) debian/ctsim.desktop $(desktop-dir)
83         dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
84         dh_install -p $(pkg-doc) docs/html $(doc-dir)
85         dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
86         gzip -9 docs/ctsim.pdf
87         dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
88         gunzip docs/ctsim.pdf.gz
89         chmod +x helical/*.sh tools/*.sh
90
91 # Pass -i to all debhelper commands in this target to reduce clutter.
92 binary-indep: build install
93         dh_testdir -i
94         dh_testroot -i
95         dh_installdocs -i
96         dh_installexamples -i
97         dh_installmenu -i
98         dh_installcron -i
99         dh_installinfo -i
100         dh_installchangelogs ChangeLog -i
101         dh_link -i
102         dh_compress -i
103         dh_fixperms -i
104         dh_installdeb -i
105         dh_gencontrol -i
106         dh_md5sums -i
107         dh_builddeb -i
108
109 # Build architecture-dependent files here.
110 binary-arch: build install
111         dh_testdir -a
112         dh_testroot -a
113         dh_installdocs -a
114         dh_installexamples -p $(pkg) tools/sample-ctsim.sh helical/sample-helical.sh
115         dh_installchangelogs ChangeLog -a
116         dh_strip -a
117         dh_link -a
118         dh_compress -a
119         dh_fixperms -a
120         dh_installmenu -a
121         dh_installdeb -a
122         dh_shlibdeps -a
123         dh_gencontrol -a
124         dh_md5sums -a
125         dh_builddeb -a
126
127 binary: binary-indep binary-arch
128
129 .PHONY: build clean binary-indep binary-arch binary install configure