[project @ 2004-06-05 18:01:00 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 purely functional programming language; the
34 current language version is Haskell 98, agreed in December 1998.
35
36 GHC is a state-of-the-art programming suite for Haskell. Included is
37 an optimising compiler generating good code for a variety of
38 platforms, together with an interactive system for convenient, quick
39 development. The distribution includes space and time profiling
40 facilities, a large collection of libraries, and support for various
41 language extensions, including concurrency, exceptions, and foreign
42 language interfaces (C, C++, whatever).
43
44 A wide variety of Haskell related resources (tutorials, libraries,
45 specifications, documentation, compilers, interpreters, references,
46 contact information, links to research groups) are available from the
47 Haskell home page at http://haskell.org/.
48
49 %package prof
50 Summary: Profiling libraries for GHC
51 Group: Development/Libraries
52 Requires: ghc = %{PACKAGE_VERSION}-%{release}
53
54 %description prof
55 Profiling libraries for Glorious Glasgow Haskell Compilation System
56 (GHC).  They should be installed when GHC's profiling subsystem is
57 needed.
58
59 %package doc
60 Summary: Documentation for GHC
61 Group: Documentation
62
63 %description doc
64 Preformatted documentation for the Glorious Glasgow Haskell
65 Compilation System (GHC) and its libraries. It should be installed if
66 you like to have local access to the documentation in PostScript and
67 HTML format. Alternatively, the documentation is available online at
68
69   http://haskell.org/ghc/documentation.html
70
71 %prep
72 %setup
73
74 %build
75 test -f configure || autoreconf
76 ./configure --prefix=%{prefix}
77 make
78 make ps html
79  
80 %install
81 make prefix=${RPM_BUILD_ROOT}%{prefix} install
82
83 mkdir -p ${RPM_BUILD_ROOT}%{prefix}/share/doc/ghc-%{version}
84 cp ghc/ANNOUNCE ghc/README ${RPM_BUILD_ROOT}%{prefix}/share/doc/ghc-%{version}
85
86 make prefix=${RPM_BUILD_ROOT}%{prefix} datadir=${RPM_BUILD_ROOT}%{prefix}/share/doc/ghc-%{version} SGMLDocWays="html ps" install-docs
87
88 # generate the file list for lib/ _excluding_ all files needed for profiling
89 # only
90 #
91 # * generating file lists in a BUILD_ROOT spec is a bit tricky: the file list
92 #   has to contain complete paths, _but_ without the BUILD_ROOT, we also do
93 #   _not_ want have directory names in the list; furthermore, we have to make
94 #   sure that any leading / is removed from %{prefix}/lib, as find has to 
95 #   interpret the argument as a relative path; however, we have to include the
96 #   leading / again in the final file list (otherwise, rpm complains)
97 # * isn't there an easier way to do all this?
98 #
99 dir=`pwd`
100 cd ${RPM_BUILD_ROOT}
101 libdir=`echo %{prefix}/lib | sed 's|^/||'`
102 find $libdir ! -type d !  -name '*.p_hi' !   -name '*_p.a'    -print | sed 's|^|/|' > $dir/rpm-noprof-lib-files
103 find $libdir ! -type d \( -name '*.p_hi' -or -name '*_p.a' \) -print | sed 's|^|/|' > $dir/rpm-prof-lib-files
104 cd $dir
105
106 %clean
107 rm -rf ${RPM_BUILD_ROOT}
108
109 %files -f rpm-noprof-lib-files
110 %defattr(-,root,root)
111 %doc %{prefix}/share/doc/ghc-%{version}/ANNOUNCE
112 %doc %{prefix}/share/doc/ghc-%{version}/README
113 %{prefix}/bin/*
114
115 %files prof -f rpm-prof-lib-files
116 %defattr(-,root,root)
117
118 %files doc
119 %defattr(-,root,root)
120 %doc %{prefix}/share/doc/ghc-%{version}/*.ps
121 %doc %{prefix}/share/doc/ghc-%{version}/html