git.iko.soy/typeable/pandoc
on 2df432d help sign in
126 lines 2.9 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 configure-stamp
43build: build-stamp
44build-stamp: configure-stamp
45 dh_testdir
47 touch build-stamp
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 # Remove empty directories, which lintian complains about.
67 find debian/libghc6-$(THIS)-dev -type d -name 'include' -empty -delete
68 # Hack! Cabal builds executables while building libraries. Move these
69 # files to top dir where the Makefile install target expects to find.
70 # See "BUGS" section at the following document:
71 # http://www.n-heptane.com/nhlab/repos/cabalDebianTemplate/INSTRUCTIONS.txt
72 find debian/libghc6-$(THIS)-dev -type d -name 'bin' -true | \
73 while read bin; do mv $$bin/* .; rm -rf $$bin; done
74 $(MAKE) install-program
76build-indep: build-indep-stamp
77build-indep-stamp:
78 dh_testdir
79 $(MAKE) build-lib-doc
81install-indep: build-indep
82 dh_testdir
83 dh_testroot
84 dh_clean -k
85 dh_installdirs -i
87 dh_haskell -i
89# Build architecture-independent files here.
90binary-indep: build-indep install-indep
91 dh_testdir
92 dh_testroot
93 dh_installchangelogs -i
94 dh_installdocs -i
95 dh_installexamples -i
96 dh_installman -i
97 dh_link -i
98 dh_strip -i
99 dh_compress -i
100 dh_fixperms -i
101 dh_installdeb -i
102 dh_shlibdeps -i
103 dh_gencontrol -i
104 dh_md5sums -i
105 dh_builddeb -i
107# Build architecture-dependent files here.
108binary-arch: build install
109 dh_testdir
110 dh_testroot
111 dh_installchangelogs -a
112 dh_installdocs -a
113 dh_installexamples -a
114 dh_installman -a
115 dh_link -a
116 dh_strip -a -Xhtml2 -Xmarkdown2 -Xlatex2 -Xrst2
117 dh_compress -a
118 dh_fixperms -a
119 dh_installdeb -a
120 dh_shlibdeps -a
121 dh_gencontrol -a
122 dh_md5sums -a
123 dh_builddeb -a
125binary: binary-indep binary-arch
126.PHONY: build clean binary-indep binary-arch binary install build-indep install-indep