3
2
# Made with the aid of dh_make, by Craig Small
4
3
# debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
5
4
# Some lines taken from debmake, by Cristoph Lameter.
5
# Largely rewritten for the Cabalised happy by Ian Lynagh in 2006.
7
7
# Uncomment this to turn on verbose mode.
10
# From /usr/share/doc/autotools-dev/examples/rules.gz:
11
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
14
confflags += --build $(DEB_HOST_GNU_TYPE)
16
confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
19
version := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \([^-]*\)-.*/\1/p')
21
# don't mess with this!
22
builddir := $(CURDIR)/debian/happy
23
docdir := /usr/share/doc/happy
24
manpages := happy/doc/happy.1 debian/happy-$(version).1
26
CONFIGURE_OPTS := --prefix=/usr
29
sed -e 's%@DOCDIR@%$(docdir)%g' \
30
-e 's%@VERSION@%$(version)%g' \
31
-e 's%@LIBDIR@%/usr/lib/happy-$(version)%g' \
34
debian/happy-$(version).1:
35
echo ".so man1/happy.1" > $@
40
ln -s /usr/share/misc/config.sub .
41
ln -s /usr/share/misc/config.guess .
43
config.status: autotools
44
./configure $(confflags) $(CONFIGURE_OPTS)
47
build-stamp: config.status
52
#$(MAKE) -C happy/doc ps html
53
$(MAKE) -C happy/doc html
54
find happy/examples -name CVS -prune -o -type f -a -print0 | xargs -0r chmod a-x
10
configure: configure-stamp
14
ghc6 --make Setup.lhs -o setup
15
./setup configure --prefix=/usr --with-compiler=/usr/bin/ghc6
17
chmod +x doc/configure
18
cd doc && ./configure --prefix=/usr
19
ghc6 --make debian/get_version.hs -o debian/get_version
23
build-stamp: configure-stamp
28
sed -e "s#@LIBDIR@#/usr/share/happy-`debian/get_version`#g" \
29
-e "s#@DOCDIR@#/usr/share/doc/happy#g" \
30
-e "s#@VERSION@#`debian/get_version`#g" \
31
doc/happy.1.in > doc/happy.1
61
rm -f build-stamp install-stamp
68
-$(RM) $(manpages) mk/config.mk mk/config.h mk/stamp-h happy/doc/happy.out
38
rm -f configure-stamp build-stamp install-stamp
41
# Remove these so setup clean doesn't remove the generated files
42
rm -f src/Parser.ly src/AttrGrammarParser.ly
43
ghc6 --make Setup.lhs -o setup
45
rm -f Setup.o Setup.hi setup
46
rm -f debian/get_version.o debian/get_version.hi debian/get_version
49
rm -f doc/config.log doc/config.status doc/config.mk
79
$(MAKE) -C happy install prefix=$(builddir)/usr
81
#for d in sgml dvi ps html; do mkdir -p $(builddir)/$(docdir)/$$d; done
82
mkdir -p $(builddir)/$(docdir)/html
83
#cp -a happy/doc/*.sgml $(builddir)/$(docdir)/sgml/
84
#cp -a happy/doc/*.dvi $(builddir)/$(docdir)/dvi/
85
#cp -a happy/doc/*.ps $(builddir)/$(docdir)/ps/
86
cp -a happy/doc/happy/* $(builddir)/$(docdir)/html/
87
cp -a happy/examples $(builddir)/$(docdir)
58
dh_installdirs usr/share/doc/happy/html
60
./setup copy --destdir=`pwd`/debian/`dh_listpackages`
62
cp -a doc/happy/* `pwd`/debian/`dh_listpackages`/usr/share/doc/happy/html/
63
cp -a examples `pwd`/debian/`dh_listpackages`/usr/share/doc/happy/
89
65
touch install-stamp
91
67
# Build architecture-independent files here.
92
68
binary-indep: build install
93
# We have nothing to do by default.
95
71
# Build architecture-dependent files here.
96
72
binary-arch: build install
100
dh_installman debian/happy-$(version).1 happy/doc/happy.1
76
dh_installman doc/happy.1
101
77
dh_installchangelogs