[project @ 2004-06-06 11:22:28 by panne]
[ghc-hetmet.git] / ghc / ghc.spec.in
1 # RPM spec file for GHC                                          -*-rpm-spec-*-
2 #
3 # Copyright [1998..2004] 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 %define name    ghc
11 %define version @version@
12 %define release @release@
13
14 Name:           %{name}
15 Version:        %{version}
16 Release:        %{release}
17 License:        BSD-like
18 Group:          Development/Languages/Haskell
19 URL:            http://haskell.org/ghc/
20 Source:         http://haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
21 Packager:       Sven Panne <sven.panne@aedion.de>
22 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
23 Prefix:         %{_prefix}
24 Requires:       gmp, readline
25 BuildRequires:  alex >= 2.0, happy >= 1.14, ghc >= 5, haddock, docbk31, jade, jadetex, dvips, gmp, readline-devel
26 Provides:       haskell
27 Summary:        The Glasgow Haskell Compiler
28
29 %description
30 Haskell is the standard lazy purely functional programming language.
31 The current language version is Haskell 98, agreed in December 1998,
32 with a revised version published in January 2003.
33
34 GHC is a state-of-the-art programming suite for Haskell. Included is
35 an optimising compiler generating good code for a variety of
36 platforms, together with an interactive system for convenient, quick
37 development. The distribution includes space and time profiling
38 facilities, a large collection of libraries, and support for various
39 language extensions, including concurrency, exceptions, and foreign
40 language interfaces (C, C++, whatever).
41
42 A wide variety of Haskell related resources (tutorials, libraries,
43 specifications, documentation, compilers, interpreters, references,
44 contact information, links to research groups) are available from the
45 Haskell home page at http://haskell.org/.
46
47 Authors:
48 --------
49     Krasimir Angelov <ka2_mail@yahoo.com>
50     Manuel Chakravarty <chak@cse.unsw.edu.au>
51     Koen Claessen <koen@cs.chalmers.se>
52     Robert Ennals <Robert.Ennals@cl.cam.ac.uk>
53     Sigbjorn Finne <sof@galconn.com>
54     Gabrielle Keller <keller@cvs.haskell.org>
55     Marcin Kowalczyk <qrczak@knm.org.pl>
56     Jeff Lewis <jeff@galconn.com>
57     Ian Lynagh <igloo@earth.li>
58     Simon Marlow <simonmar@microsoft.com>
59     Sven Panne <sven.panne@aedion.de>
60     Ross Paterson <ross@soi.city.ac.uk>
61     Simon Peyton Jones <simonpj@microsoft.com>
62     Don Stewart <dons@cse.unsw.edu.au>
63     Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
64     Wolfgang Thaller <wolfgang.thaller@gmx.net>
65     Andrew Tolmach <apt@cs.pdx.edu>
66     Keith Wansbrough <Keith.Wansbrough@cl.cam.ac.uk>
67     Michael Weber <michael.weber@post.rwth-aachen.de>
68     plus a dozen helping hands...
69
70 %package prof
71 Requires:       ghc = %{version}-%{release}
72 Summary:        Profiling libraries for GHC
73 Group:          Development/Libraries
74
75 %description prof
76 Profiling libraries for Glorious Glasgow Haskell Compilation System
77 (GHC).  They should be installed when GHC's profiling subsystem is
78 needed.
79
80 %package doc
81 Summary:        Documentation for GHC
82 Group:          Documentation
83
84 %description doc
85 Preformatted documentation for the Glorious Glasgow Haskell
86 Compilation System (GHC) and its libraries. It should be installed if
87 you like to have local access to the documentation in PostScript and
88 HTML format. Alternatively, the documentation is available online at
89
90   http://haskell.org/ghc/documentation.html
91
92 %prep
93 %setup
94
95 %build
96 test -f configure || autoreconf
97 ./configure --prefix=%{prefix}
98 make
99 make ps html
100  
101 %install
102 make prefix=${RPM_BUILD_ROOT}%{prefix} install
103 make datadir=`pwd` install-docs
104
105 # generate the file list for lib/ _excluding_ all files needed for profiling
106 # only
107 #
108 # * generating file lists in a BUILD_ROOT spec is a bit tricky: the file list
109 #   has to contain complete paths, _but_ without the BUILD_ROOT, we also do
110 #   _not_ want have directory names in the list; furthermore, we have to make
111 #   sure that any leading / is removed from %{prefix}/lib, as find has to 
112 #   interpret the argument as a relative path; however, we have to include the
113 #   leading / again in the final file list (otherwise, rpm complains)
114 # * isn't there an easier way to do all this?
115 #
116 dir=`pwd`
117 cd ${RPM_BUILD_ROOT}
118 libdir=`echo %{prefix}/lib | sed 's|^/||'`
119 find $libdir ! -type d !  -name '*.p_hi' !   -name '*_p.a'    -print | sed 's|^|/|' > $dir/rpm-noprof-lib-files
120 find $libdir ! -type d \( -name '*.p_hi' -or -name '*_p.a' \) -print | sed 's|^|/|' > $dir/rpm-prof-lib-files
121 cd $dir
122
123 %clean
124 rm -rf ${RPM_BUILD_ROOT}
125
126 %files -f rpm-noprof-lib-files
127 %defattr(-,root,root)
128 %doc %{prefix}/share/doc/ghc-%{version}/ANNOUNCE
129 %doc %{prefix}/share/doc/ghc-%{version}/README
130 %{prefix}/bin/*
131
132 %files prof -f rpm-prof-lib-files
133 %defattr(-,root,root)
134
135 %files doc
136 %defattr(-,root,root)
137
138 %doc docs/building/building
139 %doc docs/building/building.ps
140
141 %doc docs/docbook-cheat-sheet/docbook-cheat-sheet
142 %doc docs/docbook-cheat-sheet/docbook-cheat-sheet.ps
143
144 %doc ghc/docs/ext-core/core.ps
145
146 %doc ghc/docs/storage-mgt/ldv.ps
147
148 %doc ghc/docs/storage-mgt/rp.ps
149
150 %doc ghc/docs/storage-mgt/sm.ps
151
152 %doc ghc/docs/users_guide/users_guide
153 %doc ghc/docs/users_guide/users_guide.ps
154
155 %doc hslibs/doc/hslibs
156 %doc hslibs/doc/hslibs.ps
157
158 %doc ghc/ANNOUNCE
159 %doc ghc/LICENSE
160 %doc ghc/README
161
162 %doc html/*