git.iko.soy/typeable/pandoc
on c2e207a help sign in
124 lines 2.7 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
36configure: configure-stamp
37configure-stamp:
38 dh_testdir
39 $(MAKE) configure
41 touch $@
43build: build-stamp
44build-stamp: configure-stamp
45 dh_testdir
47 touch $@
49clean:
50 dh_testdir
51 dh_testroot
52 $(MAKE) clean
53 rm -rf setup Setup.hi Setup.ho Setup.o .*config* dist html
54 rm -f build-stamp configure-stamp
56 dh_clean
58install: build
59 dh_testdir
60 dh_testroot
61 dh_clean -k
62 dh_installdirs -a
64 dh_haskell -a
66 # Hack! Cabal builds executables while building libraries. Move these
67 # files to top dir where the Makefile install target expects to find.
68 # See "BUGS" section at the following document:
69 # http://www.n-heptane.com/nhlab/repos/cabalDebianTemplate/INSTRUCTIONS.txt
70 find debian/libghc6-$(THIS)-dev -type d -name 'bin' -true | \
71 while read bin; do mv $$bin/* .; rm -rf $$bin; done
72 $(MAKE) install-program
74build-indep: build-indep-stamp
75build-indep-stamp:
76 dh_testdir
77 $(MAKE) build-lib-doc
79install-indep: build-indep
80 dh_testdir
81 dh_testroot
82 dh_clean -k
83 dh_installdirs -i
85 dh_haskell -i
87# Build architecture-independent files here.
88binary-indep: build-indep install-indep
89 dh_testdir
90 dh_testroot
91 dh_installchangelogs -i
92 dh_installdocs -i
93 dh_installexamples -i
94 dh_installman -i
95 dh_link -i
96 dh_strip -i
97 dh_compress -i
98 dh_fixperms -i
99 dh_installdeb -i
100 dh_shlibdeps -i
101 dh_gencontrol -i
102 dh_md5sums -i
103 dh_builddeb -i
105# Build architecture-dependent files here.
106binary-arch: build install
107 dh_testdir
108 dh_testroot
109 dh_installchangelogs -a
110 dh_installdocs -a
111 dh_installexamples -a
112 dh_installman -a
113 dh_link -a
114 dh_strip -a -Xhtml2 -Xmarkdown2 -Xlatex2 -Xrst2
115 dh_compress -a
116 dh_fixperms -a
117 dh_installdeb -a
118 dh_shlibdeps -a
119 dh_gencontrol -a
120 dh_md5sums -a
121 dh_builddeb -a
123binary: binary-indep binary-arch
124.PHONY: build clean binary-indep binary-arch binary install build-indep install-indep