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