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