252a21fbc9f884be2d767d1af343359f8ad82f6e
[ghc-hetmet.git] / ghc / ghc.spec.in
1 # RPM spec file for GHC
2 #
3 # Copyright [1998..2000] Manuel M. T. Chakravarty <chak@acm.org>
4 # Thanks to Zoltan Vorosbaranyi <vbzoli@vbzo.li> for suggestions in 
5 # earlier versions and Pixel <pixel@mandrakesoft.com> for coding tips.
6 #
7 # This file is subject to the same free software license as GHC.
8
9 # Values for @version@ and @patchlevel@ are set by the `configure' script.  
10 # SNAP releases are CVS snapshots.  Official releases should replace SNAP by
11 # an appropriate release numbers (they are usually numbered starting from 1).
12
13 %define version    @version@
14 %define patchlevel @patchlevel@
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.gz
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.6, ghc, stylesheets
30
31 %description
32 The Glorious Glasgow Haskell Compilation System (GHC) is a robust,
33 fully-featured, optimising compiler for the functional programming
34 language Haskell 98.  GHC compiles Haskell to either native code or
35 C. It implements numerous experimental language extensions to Haskell,
36 including concurrency, a foreign language interface, several
37 type-system extensions, exceptions, and so on. GHC comes with a
38 generational garbage collector, a space and time profiler, and a
39 comprehensive set of libraries.  This package includes HTML and PS
40 versions of the SGML-based documentation for GHC.  They are also available 
41 online at http://www.haskell.org/ghc/.
42
43 Haskell 98 is "the" standard lazy functional programming language.
44 More info plus the language definition is at http://www.haskell.org/.
45
46 %package prof
47 Summary: Profiling libraries for GHC
48 Group: Development/Libraries
49 Requires: ghc = %{PACKAGE_VERSION}
50
51 %description prof
52 Profiling libraries for Glorious Glasgow Haskell Compilation System (GHC).
53 They should be installed when GHC's profiling subsystem is needed.
54
55 %changelog
56
57 * Thu Jun 22 2000 Sven Panne
58 - removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
59
60 * Sun Apr 23 2000 Manuel Chakravarty
61 - revised for ghc 4.07; added suggestions from Pixel <pixel@mandrakesoft.com>
62 - added profiling package
63
64 * Tue Dec 7 1999 Manuel Chakravarty
65 - version for use from CVS
66
67 * Thu Sep 16 1999 Manuel Chakravarty
68 - modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
69   of patch files - instead emits a build.mk on-the-fly
70
71 * Sat Jul 31 1999 Manuel Chakravarty
72 - modified for GHC 4.04
73
74 * Wed Jun 30 1999 Manuel Chakravarty
75 - some more improvements from vbzoli
76
77 * Fri Feb 26 1999 Manuel Chakravarty
78 - modified for GHC 4.02
79
80 * Thu Dec 24 1998 Zoltan Vorosbaranyi 
81 - added BuildRoot
82 - files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
83
84 * Tue Jul 28 1998 Manuel Chakravarty
85 - original version
86
87 %prep
88 %setup -n fptools
89
90 # generate our own `build.mk'
91 #
92 # * this is a kludge
93 #
94 cat >mk/build.mk <<END
95 GhcLibWays = p
96 #SRC_HAPPY_OPTS += -agc # useful from Happy 1.7 onwards
97 SRC_HAPPY_OPTS += -c
98 END
99
100
101 %build
102 ./configure --prefix=%{prefix} --libdir=%{prefix}/lib/ghc-%{version}
103 make boot
104 make -C glafp-utils sgmlverb
105 make all
106 make -C docs ps html
107 make -C ghc/docs ps html
108
109 %install
110 # compress the non-html docs
111 #
112 for j in docs ghc/docs; do
113   dir=`pwd`
114   cd $j
115   for i in ps dvi sgml verb idx; do
116     find . -name '*.'$i -exec gzip -9 '{}' ';' -print
117   done
118   cd $dir
119 done
120 rm -rf $RPM_BUILD_ROOT
121 make prefix=$RPM_BUILD_ROOT%{prefix}\
122      libdir=$RPM_BUILD_ROOT%{prefix}/lib/ghc-%{version} install
123
124 # generate the file list for lib/ _excluding_ all files needed for profiling
125 # only
126 #
127 # * generating file lists in a BUILD_ROOT spec is a bit tricky: the file list
128 #   has to contain complete paths, _but_ without the BUILD_ROOT, we also do
129 #   _not_ want have directory names in the list; furthermore, we have to make
130 #   sure that any leading / is removed from %{prefix}/lib, as find has to 
131 #   interpret the argument as a relative path; however, we have to include the
132 #   leading / again in the final file list (otherwise, rpm complains)
133 # * isn't there an easier way to do all this?
134 #
135 dir=`pwd`
136 cd $RPM_BUILD_ROOT
137 libdir=`echo %{prefix}/lib | sed 's|^/||'`
138 find $libdir ! -type d ! -name '*.p_hi' ! -name '*_p.a' -print | sed 's|^|/|'\
139      >$dir/rpm-noprof-lib-files
140 cd $dir
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %files -f rpm-noprof-lib-files
146 %doc docs/
147 %doc ghc/ANNOUNCE ghc/README ghc/docs/
148 %{prefix}/bin/*
149
150 %files prof
151 %{prefix}/lib/ghc-%{version}/imports/*/*.p_hi
152 %{prefix}/lib/ghc-%{version}/libHS*_p.a