r3886: Auto commit for Debian build
[ctsim.git] / debian / rules
1 #!/usr/bin/make -f
2
3 export DH_COMPAT=4
4
5 pkg             := ctsim
6 pkg-p4          := ctsim-pentium4
7 pkg-athlon      := ctsim-athlon
8 pkg-help        := ctsim-help
9 pkg-doc         := ctsim-doc
10
11 prefix          := debian/$(pkg)
12 prefix-p4       := debian/$(pkg-p4)
13 prefix-athlon   := debian/$(pkg-athlon)
14 prefix-help     := debian/$(pkg-help)
15 prefix-doc      := debian/$(pkg-doc)
16
17 DESTDIR         := `pwd`/$(prefix)
18 DESTDIR-P4      := `pwd`/$(prefix-p4)
19 DESTDIR-ATHLON  := `pwd`/$(prefix-athlon)
20 HELPDIR         := `pwd`/$(prefix-help)/usr/share/ctsim
21 doc-dir         := usr/share/doc/$(pkg-doc)
22 pixmap-dir      := usr/X11R6/include/X11/pixmaps
23
24 configure: configure-stamp
25 configure-stamp:
26         dh_testdir
27         # Add here commands to configure the package.
28         touch configure-stamp
29
30
31 build-arch: configure-stamp build-arch-stamp
32 build-arch-stamp:
33         dh_testdir
34         # Add here commands to compile the package.
35         ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn
36         $(MAKE) all
37         ${MAKE} install
38         ${MAKE} clean
39         ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --mcpu=pentium4
40         $(MAKE) all
41         ${MAKE} install
42         ${MAKE} clean
43         ./configure --prefix=$(DESTDIR-P4)/usr --mandir=$(DESTDIR-P4)/usr/share/man --datadir=$(HELPDIR) --with-ctn --mcpu=athlon
44         $(MAKE) all
45         ${MAKE} install
46         touch build-arch-stamp
47
48 build-indep: configure-stamp  build-indep-stamp
49 build-indep-stamp:
50         dh_testdir
51         # Add here command to compile/build the arch indep package.
52         # It's ok not to do anything here, if you don't need to build
53         #  anything for this package.
54         #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
55         (cd docs; tar xzf html.tar.gz)
56         touch build-indep-stamp
57
58 build: build-arch build-indep
59
60 clean:
61         dh_testdir
62         dh_testroot
63         rm -f build-arch-stamp build-indep-stamp configure-stamp
64         # Add here commands to clean up after the build process.
65         -$(MAKE) distclean
66         find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
67         rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
68         dh_clean
69
70 install: DH_OPTIONS=
71 install: build
72         dh_testdir
73         dh_testroot
74         dh_clean -k
75         dh_installdirs
76         # Add here commands to install the package into debian/ctsim.
77         dh_installdirs -p $(pkg-help) $(pixmap-dir)
78         dh_install -p $(pkg-help) debian/ctsim.xpm $(pixmap-dir)
79         dh_install -p $(pkg-doc) docs/html $(doc-dir)
80         dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
81         gzip -9 docs/ctsim.pdf
82         dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
83         gunzip docs/ctsim.pdf.gz
84         chmod +x helical/*.sh tools/*.sh
85
86 # Build architecture-independent files here.
87 # Pass -i to all debhelper commands in this target to reduce clutter.
88 binary-indep: build install
89         dh_testdir -i
90         dh_testroot -i
91 #       dh_installdebconf -i
92         dh_installdocs -i
93         dh_installexamples -i
94         dh_installmenu -i
95 #       dh_installlogrotate -i
96 #       dh_installemacsen -i
97 #       dh_installpam -i
98 #       dh_installmime -i
99 #       dh_installinit -i
100         dh_installcron -i
101 #       dh_installman -i
102         dh_installinfo -i
103 #       dh_undocumented -i
104         dh_installchangelogs ChangeLog -i
105         dh_link -i
106         dh_compress -i
107         dh_fixperms -i
108         dh_installdeb -i
109 #       dh_perl -i
110         dh_gencontrol -i
111         dh_md5sums -i
112         dh_builddeb -i
113
114 # Build architecture-dependent files here.
115 binary-arch: build install
116         dh_testdir -a
117         dh_testroot -a
118 #       dh_installdebconf -a
119         dh_installdocs -a
120         dh_installexamples -a tools/sample-ctsim.sh helical/sample-helical.sh
121         dh_installmenu -a
122 #       dh_installlogrotate -a
123 #       dh_installemacsen -a
124 #       dh_installpam -a
125 #       dh_installmime -a
126 #       dh_installinit -a
127         dh_installcron -a
128 #       dh_installman -a
129         dh_installinfo -a
130 #       dh_undocumented -a
131         dh_installchangelogs ChangeLog -a
132         dh_strip -a
133         dh_link -a
134         dh_compress -a
135         dh_fixperms -a
136 #       dh_makeshlibs -a
137         dh_installdeb -a
138 #       dh_perl -a
139         dh_shlibdeps -a
140         dh_gencontrol -a
141         dh_md5sums -a
142         dh_builddeb -a
143
144 binary: binary-indep binary-arch
145
146 .PHONY: build clean binary-indep binary-arch binary install configure
147