~ubuntu-branches/debian/lenny/haskell-utils/lenny

« back to all changes in this revision

Viewing changes to scripts/8/rules

  • Committer: Bazaar Package Importer
  • Author(s): Ian Lynagh (wibble)
  • Date: 2008-02-21 02:30:03 UTC
  • mfrom: (2.1.8 hardy)
  • Revision ID: james.westby@ubuntu.com-20080221023003-x73ww9m1rjpbiewh
Tags: 1.11
* We now make tight (build-)deps for the Cabal packages we depend on.
  This means that we can't have problems caused by cross-module
  inlining, or even Cabal version numbers becoming mismatched.
  Closes: #432799.
* Ignore dotfiles in varfile directories.
  In particular, this means that we ignore things like vim swapfiles.
  Closes: #445627.
* Fix the doc directory used in libghc6-PACKAGE-doc.postrm.
  Closes: #463998.
* Move the ghc6 version dependency logic into this package, and
  ignore what the ghc6 package tells us. This allows us to vary it,
  in particular make changes to the supported arches list, without
  having to do another ghc6 build on all platforms.
* All platforms now support ghc6, so make library build-deps just
      ghc6 (>= 6.8.2),                ghc6 (<< 6.8.2+)
  rather than
      ghc6 (>= 6.8.2) [$ghc6_arches], ghc6 (<< 6.8.2+) [$ghc6_arches]
* Changes in Debian packaging scripts 10 over 9:
  * We now use ${impl:ghc6:lib_build_deps} rather than ${ghc6_lib_bdeps}.
    Closes: #460077.
  * We now use ${impl:ghc6:*_deps} rather than ${ghc6_*_deps} and
    hardcoded, unversioned deps.
  * Call canonicalise-comma-list on the depends and suggests fields in
    control.in. This works around bugs in lintian, where it gets
    confused and starts giving spurious warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# Generic Haskell cabal library debian/rules v8 by Ian Lynagh,
 
3
# based on the example by Joey Hess.
 
4
# This file is public domain software.
 
5
 
 
6
# Uncomment this to turn on verbose mode.
 
7
#export DH_VERBOSE=1
 
8
 
 
9
# Get the Cabal package name. Assumes that the Debian package name is standard.
 
10
CABAL_PACKAGE = $(shell dpkg-parsechangelog | sed "1s/source: haskell-//i; q")
 
11
 
 
12
GHC6_PACKAGE      = libghc6-$(CABAL_PACKAGE)-dev
 
13
GHC6_PROF_PACKAGE = libghc6-$(CABAL_PACKAGE)-prof
 
14
GHC6_DOC_PACKAGE  = libghc6-$(CABAL_PACKAGE)-doc
 
15
 
 
16
# Find ghc. The ghc in the path might point to some other version of
 
17
# GHC, so use ghc6 if it exists (which it ought to when building for
 
18
# Debian)
 
19
GHC := $(firstword $(shell bash -c "type -p ghc6 ghc"))
 
20
 
 
21
CONFIGURE_OPTS  = --enable-library-vanilla \
 
22
                  --enable-library-profiling \
 
23
                  --enable-library-for-ghci
 
24
ifneq '$(findstring $(shell dpkg-architecture -qDEB_HOST_ARCH), i386 amd64)' ''
 
25
CONFIGURE_OPTS += --enable-split-objs
 
26
endif
 
27
 
 
28
build: build-stamp
 
29
build-stamp:
 
30
        dh_testdir
 
31
 
 
32
        update-haskell-control --check
 
33
        $(GHC) --make Setup.hs -o setup-ghc
 
34
        ./setup-ghc configure --ghc --with-compiler=$(GHC) --prefix=/usr --datadir=/usr/share/doc/ghc6-doc/html/cabal_libraries --datasubdir=$(CABAL_PACKAGE) $(CONFIGURE_OPTS)
 
35
        ./setup-ghc build
 
36
        ./setup-ghc haddock
 
37
 
 
38
        touch $@
 
39
 
 
40
FILES = -type f
 
41
PROF_FILE = \( -name "*.p_*" -o -name "lib*_p.a" \)
 
42
 
 
43
install: install-stamp
 
44
install-stamp: build-stamp
 
45
        dh_testdir
 
46
        dh_testroot
 
47
        dh_clean -k
 
48
        dh_installdirs
 
49
 
 
50
        ./setup-ghc copy --destdir=debian/tmp/
 
51
        find debian/tmp/usr/lib -type f ! $(PROF_FILE) \
 
52
                                         > debian/$(GHC6_PACKAGE).install
 
53
        find debian/tmp -type d -empty  >> debian/$(GHC6_PACKAGE).install
 
54
        find debian/tmp/usr/lib -type f   $(PROF_FILE) \
 
55
                                         > debian/$(GHC6_PROF_PACKAGE).install
 
56
        echo "debian/tmp/usr/share/doc"  > debian/$(GHC6_DOC_PACKAGE).install
 
57
 
 
58
        ./setup-ghc register --gen-script
 
59
        ./setup-ghc unregister --gen-script
 
60
        mkdir -p         debian/$(GHC6_PACKAGE)/usr/lib/$(GHC6_PACKAGE)
 
61
        mv register.sh   debian/$(GHC6_PACKAGE)/usr/lib/$(GHC6_PACKAGE)
 
62
        mv unregister.sh debian/$(GHC6_PACKAGE)/usr/lib/$(GHC6_PACKAGE)
 
63
 
 
64
        touch $@
 
65
 
 
66
update-generated-files:
 
67
        update-debian-haskell-files
 
68
        update-haskell-control
 
69
        sed "s/@PACKAGE@/$(GHC6_PACKAGE)/g" debian/$(GHC6_PACKAGE).prerm.in \
 
70
                                          > debian/$(GHC6_PACKAGE).prerm
 
71
        sed "s/@PACKAGE@/$(GHC6_PACKAGE)/g" debian/$(GHC6_PACKAGE).postinst.in \
 
72
                                          > debian/$(GHC6_PACKAGE).postinst
 
73
 
 
74
clean:
 
75
        dh_testdir
 
76
        dh_testroot
 
77
        rm -f build-stamp install-stamp binary-common-stamp
 
78
 
 
79
        -./setup-ghc clean
 
80
        rm -f Setup.o Setup.hi setup-ghc
 
81
        rm -f debian/*.install
 
82
 
 
83
        dh_clean
 
84
 
 
85
# Build architecture-dependent files here.
 
86
binary-common: binary-common-stamp
 
87
binary-common-stamp: install-stamp
 
88
        dh_testdir
 
89
        dh_testroot
 
90
        dh_installchangelogs
 
91
        dh_installdocs
 
92
        dh_installexamples
 
93
        dh_install --fail-missing
 
94
        # Nasty hack as Cabal doesn't let us tell it where to put the docs
 
95
        mkdir debian/$(GHC6_DOC_PACKAGE)/usr/share/doc/ghc6-doc/html/libraries/
 
96
        ln -s ../cabal_libraries/$(CABAL_PACKAGE)/doc/html/ debian/$(GHC6_DOC_PACKAGE)/usr/share/doc/ghc6-doc/html/libraries/$(CABAL_PACKAGE)
 
97
#       dh_installmenu
 
98
#       dh_installdebconf       
 
99
#       dh_installlogrotate
 
100
#       dh_installemacsen
 
101
#       dh_installcatalogs
 
102
#       dh_installpam
 
103
#       dh_installmime
 
104
#       dh_installinit
 
105
#       dh_installcron
 
106
#       dh_installinfo
 
107
#       dh_undocumented
 
108
        dh_installman
 
109
        dh_link
 
110
        dh_strip
 
111
        dh_compress -X.haddock
 
112
        dh_fixperms
 
113
#       dh_perl
 
114
#       dh_python
 
115
#       dh_makeshlibs
 
116
        dh_installdeb
 
117
        dh_shlibdeps
 
118
        dh_gencontrol
 
119
        dh_md5sums
 
120
        dh_builddeb
 
121
 
 
122
# binary-indep and binary-arch both build everything, as otherwise
 
123
# # "dh_install --fail-missing" falls over
 
124
 
 
125
# Build architecture-independent files here.
 
126
binary-indep: binary-common-stamp
 
127
# We have nothing to do by default.
 
128
 
 
129
# Build architecture-dependent files here.
 
130
binary-arch: binary-common-stamp
 
131
 
 
132
binary: binary-indep binary-arch
 
133
.PHONY: build clean binary-indep binary-arch binary-common binary install