[project @ 2004-02-12 02:04:59 by mthomas]
[ghc-hetmet.git] / ghc / ghc.spec.in
1 # RPM spec file for GHC                                          -*-rpm-spec-*-
2 #
3 # Copyright [1998..2002] The GHC Team
4 #
5 # Thanks to Zoltan Vorosbaranyi <vbzoli@vbzo.li> for suggestions in 
6 # earlier versions and Pixel <pixel@mandrakesoft.com> for coding tips.
7 #
8 # This file is subject to the same free software license as GHC.
9
10 # Values for @version@ is set by the `configure' script.  SNAP releases are 
11 # CVS snapshots.  Official releases should replace SNAP by an appropriate 
12 # release numbers (they are usually numbered starting from 1).
13
14 %define version    @version@
15 %define release    SNAP
16 %define prefix     /usr
17
18 Summary: Glasgow Haskell Compilation system
19 Name: ghc
20 Version: %{version}
21 Release: %{release}
22 Copyright: BSD style w/o adv. clause
23 Group: Development/Languages
24 Source: http://haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
25 URL: http://haskell.org/ghc/
26 BuildRoot: /var/tmp/ghc-%{version}-%{release}-root
27 Requires: gmp-devel
28 Provides: haskell
29 BuildRequires: happy >= 1.13, ghc >= 4.08, haddock, docbook-utils
30
31 %description
32 Haskell is the standard purely functional programming language; the
33 current language version is Haskell 98, agreed in December 1998.
34
35 GHC is a state-of-the-art programming suite for Haskell.  Included is
36 an optimising compiler generating good code for a variety of
37 platforms, together with an interactive system for convenient, quick
38 development.  The distribution includes space and time profiling
39 facilities, a large collection of libraries, and support for various
40 language extensions, including concurrency, exceptions, and foreign
41 language interfaces (C, C++, whatever).
42
43 A wide variety of Haskell related resources (tutorials, libraries,
44 specifications, documentation, compilers, interpreters, references,
45 contact information, links to research groups) are available from the
46 Haskell home page at <http://www.haskell.org/>.
47
48 %package prof
49 Summary: Profiling libraries for GHC
50 Group: Development/Libraries
51 Requires: ghc = %{PACKAGE_VERSION}-%{release}
52
53 %description prof
54 Profiling libraries for Glorious Glasgow Haskell Compilation System (GHC).
55 They should be installed when GHC's profiling subsystem is needed.
56
57 %package doc
58 Summary: Documentation for GHC
59 Group: Documentation
60
61 %description doc
62 Preformatted documentation for the Glorious Glasgow Haskell Compilation System 
63 (GHC) and its libraries.  It should be installed if you like to have local
64 access to the documentation in PostScript and HTML format.  Alternatively,
65 the documentation is available online at
66
67   http://haskell.org/ghc/documentation.html
68
69 %changelog
70
71 * Tue Aug 19 2003 Sven Panne
72 - use autoreconf
73
74 * Wed Sep 26 2001 Manuel Chakravarty
75 - small changes for 5.04
76
77 * Wed Sep 26 2001 Manuel Chakravarty
78 - split documentation off into a separate package
79 - adapt to new docbook setup in RH7.1
80
81 * Mon Apr 16 2001 Manuel Chakravarty
82 - revised for 5.00
83 - also runs autoconf automagically if no ./configure found
84
85 * Thu Jun 22 2000 Sven Panne
86 - removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
87
88 * Sun Apr 23 2000 Manuel Chakravarty
89 - revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
90 - added profiling package
91
92 * Tue Dec 7 1999 Manuel Chakravarty
93 - version for use from CVS
94
95 * Thu Sep 16 1999 Manuel Chakravarty
96 - modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
97   of patch files - instead emits a build.mk on-the-fly
98
99 * Sat Jul 31 1999 Manuel Chakravarty
100 - modified for GHC 4.04
101
102 * Wed Jun 30 1999 Manuel Chakravarty
103 - some more improvements from vbzoli
104
105 * Fri Feb 26 1999 Manuel Chakravarty
106 - modified for GHC 4.02
107
108 * Thu Dec 24 1998 Zoltan Vorosbaranyi 
109 - added BuildRoot
110 - files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
111
112 * Tue Jul 28 1998 Manuel Chakravarty
113 - original version
114
115 %prep
116 %setup
117
118 # generate our own `build.mk'
119 #
120 # * this is a kludge (is it still needed?)
121 #
122 cat >mk/build.mk <<END
123 GhcLibWays = p
124 SRC_HAPPY_OPTS += -agc
125 #GhcWithInterpreter=NO
126 GhcWithInterpreter=YES
127 END
128
129 # run autoheader and autoconf if necessary
130 #
131 test -f configure || autoreconf
132
133 %build
134 ./configure --prefix=%{prefix}
135 make boot
136 make all ps html
137  
138 %install
139 rm -rf $RPM_BUILD_ROOT
140
141 # FIXME: this is necessary due to brokenness in ghc-5.00/mk/target.mk
142 make prefix=$RPM_BUILD_ROOT%{prefix} install-dirs
143
144 make prefix=$RPM_BUILD_ROOT%{prefix} install
145
146 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/doc/ghc-%{version}
147 cp ghc/ANNOUNCE ghc/README $RPM_BUILD_ROOT%{prefix}/share/doc/ghc-%{version}
148
149 make prefix=$RPM_BUILD_ROOT%{prefix} datadir=$RPM_BUILD_ROOT%{prefix}/share/doc/ghc-%{version} SGMLDocWays="html ps" install-docs
150
151 # generate the file list for lib/ _excluding_ all files needed for profiling
152 # only
153 #
154 # * generating file lists in a BUILD_ROOT spec is a bit tricky: the file list
155 #   has to contain complete paths, _but_ without the BUILD_ROOT, we also do
156 #   _not_ want have directory names in the list; furthermore, we have to make
157 #   sure that any leading / is removed from %{prefix}/lib, as find has to 
158 #   interpret the argument as a relative path; however, we have to include the
159 #   leading / again in the final file list (otherwise, rpm complains)
160 # * isn't there an easier way to do all this?
161 #
162 dir=`pwd`
163 cd $RPM_BUILD_ROOT
164 libdir=`echo %{prefix}/lib | sed 's|^/||'`
165 find $libdir ! -type d ! -name '*.p_hi' ! -name '*_p.a' -print | sed 's|^|/|'\
166      >$dir/rpm-noprof-lib-files
167 find $libdir ! -type d \( -name '*.p_hi' -or -name '*_p.a' \) -print | sed 's|^|/|'\
168      >$dir/rpm-prof-lib-files
169 cd $dir
170
171 %clean
172 rm -rf $RPM_BUILD_ROOT
173
174 %files -f rpm-noprof-lib-files
175 %defattr(-,root,root)
176 %doc %{prefix}/share/doc/ghc-%{version}/ANNOUNCE
177 %doc %{prefix}/share/doc/ghc-%{version}/README
178 %{prefix}/bin/*
179
180 %files prof -f rpm-prof-lib-files
181 %defattr(-,root,root)
182
183 %files doc
184 %defattr(-,root,root)
185 %doc %{prefix}/share/doc/ghc-%{version}/*.ps
186 %doc %{prefix}/share/doc/ghc-%{version}/html