3 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
6 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
10 host_arch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
13 pkg-help := ctsim-help
16 ctsim-shared := usr/share/ctsim
18 prefix := debian/$(pkg)
19 prefix-help := debian/$(pkg-help)
20 prefix-doc := debian/$(pkg-doc)
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
28 configure: configure-stamp
31 ./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn -with-x --without-lam
35 build-arch: configure-stamp build-arch-stamp
38 # Add here commands to compile the package.
40 touch build-arch-stamp
42 build-indep: configure-stamp build-indep-stamp
45 # Add here command to compile/build the arch indep package.
46 # It's ok not to do anything here, if you don't need to build
47 # anything for this package.
48 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
49 (cd docs; tar xzf html.tar.gz)
50 touch build-indep-stamp
52 build: build-arch build-indep
57 rm -f build-arch-stamp build-indep-stamp configure-stamp
58 if [ -f Makefile -a -f config.status ]; then $(MAKE) clean; fi
59 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
60 rm -f debian/ctsim.postinst.* debian/ctsim.prerm.*
61 # Ensure up-to-date versions of config.sub and config.guess
62 -test -r /usr/share/misc/config.sub && cp -f /usr/share/misc/config.sub config.sub
63 -test -r /usr/share/misc/config.guess && cp -f /usr/share/misc/config.guess config.guess
64 -rm -f configure-stamp build-indep-stamp build-arch-stamp
65 -test -r Makefile && $(MAKE) clean
75 dh_installdirs -p $(pkg-help) $(ctsim-shared)
77 dh_installdirs -p $(pkg) $(pixmap-dir)
78 dh_installdirs -p $(pkg) $(desktop-dir)
79 dh_install -p $(pkg) debian/ctsim.xpm $(pixmap-dir)
80 dh_install -p $(pkg) debian/ctsim.desktop $(desktop-dir)
81 dh_install -p $(pkg-help) docs/ctsim.htb $(ctsim-shared)
82 dh_install -p $(pkg-doc) docs/html $(doc-dir)
83 dh_link -p $(pkg-doc) $(doc-dir)/html/$(pkg)_contents.html $(doc-dir)/html/index.html
84 gzip -9 docs/ctsim.pdf
85 dh_install -p $(pkg-doc) docs/ctsim.pdf.gz $(doc-dir)
86 gunzip docs/ctsim.pdf.gz
87 chmod +x helical/*.sh tools/*.sh
89 # Pass -i to all debhelper commands in this target to reduce clutter.
90 binary-indep: build install
98 dh_installchangelogs ChangeLog -i
107 # Build architecture-dependent files here.
108 binary-arch: build install
112 dh_installexamples -p $(pkg) tools/sample-ctsim.sh helical/sample-helical.sh
113 dh_installchangelogs ChangeLog -a
125 binary: binary-indep binary-arch
127 .PHONY: build clean binary-indep binary-arch binary install configure