[project @ 2001-04-16 03:01:04 by chak]
[ghc-hetmet.git] / ghc / ghc.spec.in
1 # RPM spec file for GHC
2 #
3 # Copyright [1998..2001] 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: autoconf, happy >= 1.9, ghc, stylesheets
30
31 %description
32 Haskell is a standard lazy 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}
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 %changelog
58
59 * Mon Apr 16 2001 Manuel Chakravarty
60 - revised for 5.00
61 - also runs autoconf automagically if no ./configure found
62
63 * Thu Jun 22 2000 Sven Panne
64 - removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
65
66 * Sun Apr 23 2000 Manuel Chakravarty
67 - revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
68 - added profiling package
69
70 * Tue Dec 7 1999 Manuel Chakravarty
71 - version for use from CVS
72
73 * Thu Sep 16 1999 Manuel Chakravarty
74 - modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
75   of patch files - instead emits a build.mk on-the-fly
76
77 * Sat Jul 31 1999 Manuel Chakravarty
78 - modified for GHC 4.04
79
80 * Wed Jun 30 1999 Manuel Chakravarty
81 - some more improvements from vbzoli
82
83 * Fri Feb 26 1999 Manuel Chakravarty
84 - modified for GHC 4.02
85
86 * Thu Dec 24 1998 Zoltan Vorosbaranyi 
87 - added BuildRoot
88 - files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
89
90 * Tue Jul 28 1998 Manuel Chakravarty
91 - original version
92
93 %prep
94 %setup
95
96 # generate our own `build.mk'
97 #
98 # * this is a kludge (is it still needed?)
99 #
100 cat >mk/build.mk <<END
101 GhcLibWays = p
102 SRC_HAPPY_OPTS += -agc
103 #GhcWithInterpreter=No
104 GhcWithInterpreter=YES
105 END
106
107 # run autoconf if necessary
108 #
109 [ ! -x configure ] && autoconf && cd ghc && autoconf
110
111 %build
112 ./configure --prefix=%{prefix} --libdir=%{prefix}/lib/ghc-%{version}
113 make boot
114 make -C glafp-utils sgmlverb
115 make all
116 make -C docs ps html
117 make -C ghc/docs ps html
118
119 %install
120 # compress the non-html docs
121 #
122 for j in docs ghc/docs; do
123   dir=`pwd`
124   cd $j
125   for i in ps dvi sgml verb idx; do
126     find . -name '*.'$i -exec gzip -9 '{}' ';' -print
127   done
128   cd $dir
129 done
130 rm -rf $RPM_BUILD_ROOT
131 make prefix=$RPM_BUILD_ROOT%{prefix}\
132      libdir=$RPM_BUILD_ROOT%{prefix}/lib/ghc-%{version} install
133
134 # generate the file list for lib/ _excluding_ all files needed for profiling
135 # only
136 #
137 # * generating file lists in a BUILD_ROOT spec is a bit tricky: the file list
138 #   has to contain complete paths, _but_ without the BUILD_ROOT, we also do
139 #   _not_ want have directory names in the list; furthermore, we have to make
140 #   sure that any leading / is removed from %{prefix}/lib, as find has to 
141 #   interpret the argument as a relative path; however, we have to include the
142 #   leading / again in the final file list (otherwise, rpm complains)
143 # * isn't there an easier way to do all this?
144 #
145 dir=`pwd`
146 cd $RPM_BUILD_ROOT
147 libdir=`echo %{prefix}/lib | sed 's|^/||'`
148 find $libdir ! -type d ! -name '*.p_hi' ! -name '*_p.a' -print | sed 's|^|/|'\
149      >$dir/rpm-noprof-lib-files
150 cd $dir
151
152 %clean
153 rm -rf $RPM_BUILD_ROOT
154
155 %files -f rpm-noprof-lib-files
156 %doc docs/
157 %doc ghc/ANNOUNCE ghc/README ghc/docs/
158 %{prefix}/bin/*
159
160 %files prof
161 %{prefix}/lib/ghc-%{version}/imports/*/*.p_hi
162 %{prefix}/lib/ghc-%{version}/libHS*_p.a