git.iko.soy/typeable/pandoc
on fb07803 help sign in
137 lines 3.2 kB history raw
1#!/usr/bin/make -f
2#
3# debian/rules for pandoc.
4# Copyright � 2006 Recai Okta� <roktasATdebian.org>
5#
6# This file is based on John Goerzen's Cabal Debian template.
7# See http://www.n-heptane.com/nhlab/repos/cabalDebianTemplate/
8#
9# Licensed under the GNU General Public License, version 2.
10# See the file 'http://www.gnu.org/copyleft/gpl.txt'.
12THIS := $(shell sed -ne 's/^Source: \(.*\)/\1/p' debian/control)
13PREFIX := /usr
14DESTDIR := debian/$(THIS)
15DATADIR := $(THIS)
16DOCDIR := doc/$(THIS)
18# Uncomment this to turn on verbose mode.
19#export DH_VERBOSE=1
21ifeq (1,$(DH_VERBOSE))
22HCFLAGS+=-v
23endif
25# Handle noopt in DEB_BUILD_OPTIONS. Emulate CFLAGS (as HCFLAGS).
26ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
27HCFLAGS+=-O0
28else
29# No optimisation seems optimum.
30HCFLAGS+=-O0
31endif
33# Export all variables which will be used in various stages of build process.
34export PREFIX DESTDIR DATADIR DOCDIR HCFLAGS
36# Special code dealing with ghc 6.6 -> 6.8 transition.
37.PHONY: cabalbackup cabalrestore
38cabalbackup: $(THIS).cabal.ghccurrent
39$(THIS).cabal.ghccurrent:
40 if [ -f $(THIS).cabal.ghc66 ]; then \
41 mv $(THIS).cabal $(THIS).cabal.ghccurrent; \
42 cp $(THIS).cabal.ghc66 $(THIS).cabal; \
43 fi
44cabalrestore:
45 if [ -f $(THIS).cabal.ghc66 ] && [ -f $(THIS).cabal.ghccurrent ]; then \
46 mv $(THIS).cabal.ghccurrent $(THIS).cabal; \
47 fi
49configure: configure-stamp
50configure-stamp: cabalbackup
51 dh_testdir
52 $(MAKE) configure
54 touch configure-stamp
56build: build-stamp
57build-stamp: configure-stamp
58 dh_testdir
60 touch build-stamp
62clean:
63 dh_testdir
64 dh_testroot
65 $(MAKE) clean
66 rm -rf setup Setup.hi Setup.ho Setup.o .*config* dist html
67 rm -f build-stamp configure-stamp
69 dh_clean
71install: build
72 dh_testdir
73 dh_testroot
74 dh_clean -k
75 dh_installdirs -a
77 dh_haskell -a
79 # Hack! Cabal builds executables while building libraries. Move these
80 # files to top dir where the Makefile install target expects to find.
81 # See "BUGS" section at the following document:
82 # http://www.n-heptane.com/nhlab/repos/cabalDebianTemplate/INSTRUCTIONS.txt
83 find debian/libghc6-$(THIS)-dev -type d -name 'bin' -true | \
84 while read bin; do mv $$bin/* .; rm -rf $$bin; done
85 $(MAKE) install-program
87build-indep: build-indep-stamp
88build-indep-stamp:
89 dh_testdir
90 $(MAKE) build-lib-doc
92install-indep: build-indep
93 dh_testdir
94 dh_testroot
95 dh_clean -k
96 dh_installdirs -i
98 dh_haskell -i
100# Build architecture-independent files here.
101binary-indep: build-indep install-indep
102 dh_testdir
103 dh_testroot
104 dh_installchangelogs -i
105 dh_installdocs -i
106 dh_installexamples -i
107 dh_installman -i
108 dh_link -i
109 dh_strip -i
110 dh_compress -i
111 dh_fixperms -i
112 dh_installdeb -i
113 dh_shlibdeps -i
114 dh_gencontrol -i
115 dh_md5sums -i
116 dh_builddeb -i
118# Build architecture-dependent files here.
119binary-arch: build install
120 dh_testdir
121 dh_testroot
122 dh_installchangelogs -a
123 dh_installdocs -a
124 dh_installexamples -a
125 dh_installman -a
126 dh_link -a
127 dh_strip -a -Xhtml2 -Xmarkdown2 -Xlatex2 -Xrst2
128 dh_compress -a
129 dh_fixperms -a
130 dh_installdeb -a
131 dh_shlibdeps -a
132 dh_gencontrol -a
133 dh_md5sums -a
134 dh_builddeb -a
136binary: binary-indep binary-arch cabalrestore
137.PHONY: build clean binary-indep binary-arch binary install build-indep install-indep