~ubuntu-branches/ubuntu/trusty/happy/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Ian Lynagh (wibble)
  • Date: 2006-10-26 22:52:14 UTC
  • mfrom: (1.2.2 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20061026225214-6jmf0n3ykkc9elyw
Tags: 1.16~rc2-1
* New upstream (release candidate) version.
* Removed happy/ prefixes from various paths in debian/rules and
  debian/docs.
* doc/configure generated by autoconf is in the Debian diff.
* Build using cabal:
  * Various debian/rules changes.
  * Create debian/get_version.hs for extracting the version from the cabal
    file.
  * Requires ghc6 >= 6.4.2.
  * No longer tries to detect platform. Closes: #340325, #332979.
  * Removed autotool-dev build-dep.
* Add 'XSLTPROC_OPTS = --nonet' to doc/config.mk.in.
* Remove src/Parser.ly and src/AttrGrammarParser.ly before cleaning so
  the generated files don't get cleaned.
* Set Standards-Version to 3.7.2 (no changes needed).
* Removed PS and DVI stanzas from debian/doc-base as we don't build
  the documentation those ways.
* Removed content-free postinst and prerm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/make -f
2
 
# -*- no_mode -*-
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.
6
6
 
7
7
# Uncomment this to turn on verbose mode.
8
8
#export DH_VERBOSE=1
9
9
 
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)
15
 
else
16
 
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
17
 
endif
18
 
 
19
 
version        := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \([^-]*\)-.*/\1/p')
20
 
 
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
25
 
 
26
 
CONFIGURE_OPTS := --prefix=/usr
27
 
 
28
 
%: %.in
29
 
        sed -e 's%@DOCDIR@%$(docdir)%g' \
30
 
            -e 's%@VERSION@%$(version)%g' \
31
 
            -e 's%@LIBDIR@%/usr/lib/happy-$(version)%g' \
32
 
          $< > $@
33
 
 
34
 
debian/happy-$(version).1:
35
 
        echo ".so man1/happy.1" > $@
36
 
 
37
 
autotools:
38
 
        rm -f config.sub
39
 
        rm -f config.guess
40
 
        ln -s /usr/share/misc/config.sub .
41
 
        ln -s /usr/share/misc/config.guess .
42
 
 
43
 
config.status: autotools
44
 
        ./configure $(confflags) $(CONFIGURE_OPTS)
45
 
 
46
 
build: $(manpages)
47
 
build-stamp: config.status
48
 
        dh_testdir
49
 
        touch configure
50
 
 
51
 
        $(MAKE) all
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
55
 
        
 
10
configure: configure-stamp
 
11
configure-stamp:
 
12
        dh_testdir
 
13
 
 
14
        ghc6 --make Setup.lhs -o setup
 
15
        ./setup configure --prefix=/usr --with-compiler=/usr/bin/ghc6
 
16
        touch doc/configure
 
17
        chmod +x doc/configure
 
18
        cd doc && ./configure --prefix=/usr
 
19
        ghc6 --make debian/get_version.hs -o debian/get_version
 
20
        touch configure-stamp
 
21
 
 
22
build: build-stamp
 
23
build-stamp: configure-stamp
 
24
        dh_testdir
 
25
 
 
26
        ./setup build
 
27
        $(MAKE) -C doc html
 
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
 
32
 
56
33
        touch build-stamp
57
34
 
58
35
clean:
59
36
        dh_testdir
60
37
        dh_testroot
61
 
        rm -f build-stamp install-stamp
62
 
        rm -f config.sub
63
 
        rm -f config.guess
64
 
        touch configure
65
 
        
66
 
        -$(MAKE) distclean;
67
 
        
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
 
39
        
 
40
        -$(MAKE) -C doc clean
 
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
 
44
        -./setup clean
 
45
        rm -f Setup.o Setup.hi setup
 
46
        rm -f debian/get_version.o debian/get_version.hi debian/get_version
 
47
        rm -f doc/happy.1
 
48
        # Hacks:
 
49
        rm -f doc/config.log doc/config.status doc/config.mk
69
50
        
70
51
        dh_clean
71
52
 
74
55
        dh_testdir
75
56
        dh_testroot
76
57
        dh_clean -k
77
 
        dh_installdirs
78
 
 
79
 
        $(MAKE) -C happy install prefix=$(builddir)/usr
80
 
 
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
 
59
 
 
60
        ./setup copy --destdir=`pwd`/debian/`dh_listpackages`
 
61
 
 
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/
88
64
 
89
65
        touch install-stamp
90
66
 
91
67
# Build architecture-independent files here.
92
68
binary-indep: build install
93
 
# We have nothing to do by default.
 
69
        @:
94
70
 
95
71
# Build architecture-dependent files here.
96
72
binary-arch: build install
97
73
        dh_testdir
98
74
        dh_testroot
99
75
        dh_installdocs
100
 
        dh_installman debian/happy-$(version).1 happy/doc/happy.1
 
76
        dh_installman doc/happy.1
101
77
        dh_installchangelogs 
102
78
        dh_strip
103
79
        dh_compress
108
84
        dh_md5sums
109
85
        dh_builddeb
110
86
 
111
 
source diff:                                                                  
112
 
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
113
 
 
114
87
binary: binary-indep binary-arch
115
 
.PHONY: build clean binary-indep binary-arch binary autotools
 
88
.PHONY: build clean binary-indep binary-arch binary install
 
89