482dc94a9498fbb164e88edf6bcf04935e7bcd71
[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 * Wed Sep 26 2001 Manuel Chakravarty
72 - small changes for 5.04
73
74 * Wed Sep 26 2001 Manuel Chakravarty
75 - split documentation off into a separate package
76 - adapt to new docbook setup in RH7.1
77
78 * Mon Apr 16 2001 Manuel Chakravarty
79 - revised for 5.00
80 - also runs autoconf automagically if no ./configure found
81
82 * Thu Jun 22 2000 Sven Panne
83 - removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
84
85 * Sun Apr 23 2000 Manuel Chakravarty
86 - revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
87 - added profiling package
88
89 * Tue Dec 7 1999 Manuel Chakravarty
90 - version for use from CVS
91
92 * Thu Sep 16 1999 Manuel Chakravarty
93 - modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
94   of patch files - instead emits a build.mk on-the-fly
95
96 * Sat Jul 31 1999 Manuel Chakravarty
97 - modified for GHC 4.04
98
99 * Wed Jun 30 1999 Manuel Chakravarty
100 - some more improvements from vbzoli
101
102 * Fri Feb 26 1999 Manuel Chakravarty
103 - modified for GHC 4.02
104
105 * Thu Dec 24 1998 Zoltan Vorosbaranyi 
106 - added BuildRoot
107 - files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
108
109 * Tue Jul 28 1998 Manuel Chakravarty
110 - original version
111
112 %prep
113 %setup
114
115 # generate our own `build.mk'
116 #
117 # * this is a kludge (is it still needed?)
118 #
119 cat >mk/build.mk <<END
120 GhcLibWays = p
121 SRC_HAPPY_OPTS += -agc
122 #GhcWithInterpreter=NO
123 GhcWithInterpreter=YES
124 END
125
126 # run autoconf if necessary
127 #
128 [ ! -x configure ] && autoconf && cd ghc && autoconf
129
130 %build
131 ./configure --prefix=%{prefix}
132 make boot
133 make all ps html
134  
135 %install
136 rm -rf $RPM_BUILD_ROOT
137
138 # FIXME: this is necessary due to brokenness in ghc-5.00/mk/target.mk
139 make prefix=$RPM_BUILD_ROOT%{prefix} install-dirs
140
141 make prefix=$RPM_BUILD_ROOT%{prefix} install
142
143 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/doc/ghc-%{version}
144 cp ghc/ANNOUNCE ghc/README $RPM_BUILD_ROOT%{prefix}/share/doc/ghc-%{version}
145
146 make prefix=$RPM_BUILD_ROOT%{prefix} datadir=$RPM_BUILD_ROOT%{prefix}/share/doc/ghc-%{version} SGMLDocWays="html ps" install-docs
147
148 # generate the file list for lib/ _excluding_ all files needed for profiling
149 # only
150 #
151 # * generating file lists in a BUILD_ROOT spec is a bit tricky: the file list
152 #   has to contain complete paths, _but_ without the BUILD_ROOT, we also do
153 #   _not_ want have directory names in the list; furthermore, we have to make
154 #   sure that any leading / is removed from %{prefix}/lib, as find has to 
155 #   interpret the argument as a relative path; however, we have to include the
156 #   leading / again in the final file list (otherwise, rpm complains)
157 # * isn't there an easier way to do all this?
158 #
159 dir=`pwd`
160 cd $RPM_BUILD_ROOT
161 libdir=`echo %{prefix}/lib | sed 's|^/||'`
162 find $libdir ! -type d ! -name '*.p_hi' ! -name '*_p.a' -print | sed 's|^|/|'\
163      >$dir/rpm-noprof-lib-files
164 find $libdir ! -type d \( -name '*.p_hi' -or -name '*_p.a' \) -print | sed 's|^|/|'\
165      >$dir/rpm-prof-lib-files
166 cd $dir
167
168 %clean
169 rm -rf $RPM_BUILD_ROOT
170
171 %files -f rpm-noprof-lib-files
172 %defattr(-,root,root)
173 %doc %{prefix}/share/doc/ghc-%{version}/ANNOUNCE
174 %doc %{prefix}/share/doc/ghc-%{version}/README
175 %{prefix}/bin/*
176
177 %files prof -f rpm-prof-lib-files
178 %defattr(-,root,root)
179
180 %files doc
181 %defattr(-,root,root)
182 %doc %{prefix}/share/doc/ghc-%{version}/*.ps
183 %doc %{prefix}/share/doc/ghc-%{version}/html