Ticket #2343: ghc.spec

File ghc.spec, 14.4 KB (added by bos, 7 years ago)

Build instructions

Line 
1%define ghcver ghc682
2
3# speed up test builds by not building profiled libraries
4%define build_prof 1
5%define build_doc 1
6
7# Fixing packaging problems can be a tremendous pain because it
8# generally requires a complete rebuild, which takes hours.  To offset
9# the misery, do a complete build once using "rpmbuild -bc", then copy
10# your built tree to a directory of the same name suffixed with
11# ".built", using "cp -al".  Finally, set this variable, and it will
12# copy the already-built tree into place during build instead of
13# actually doing the build.
14#
15# Obviously, this can only work if you leave the build section
16# completely untouched between builds.
17%define package_debugging 0
18
19Name:           ghc
20Version:        6.8.2.20080603
21Release:        1%{?dist}
22Summary:        Glasgow Haskell Compilation system
23# See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239713
24ExcludeArch:    alpha ppc64
25License:        BSD
26Group:          Development/Languages
27Source0:        http://www.haskell.org/ghc/dist/stable/dist/ghc-%{version}-src.tar.bz2
28Source1:        http://www.haskell.org/ghc/dist/stable/dist/ghc-%{version}-src-extralibs.tar.bz2
29URL:            http://haskell.org/ghc/
30Requires:       %{ghcver} = %{version}-%{release}, chkconfig
31BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
32BuildRequires:  ghc, happy, sed
33BuildRequires:  gmp-devel, readline-devel
34# X11 is no longer in ghc extralibs
35#BuildRequires:  libX11-devel, libXt-devel
36BuildRequires:  freeglut-devel, openal-devel
37%if %{build_doc}
38# haddock generates docs in libraries
39BuildRequires: libxslt, docbook-style-xsl, haddock >= 0.8
40%endif
41
42%description
43GHC is a state-of-the-art programming suite for Haskell, a purely
44functional programming language.  It includes an optimising compiler
45generating good code for a variety of platforms, together with an
46interactive system for convenient, quick development.  The
47distribution includes space and time profiling facilities, a large
48collection of libraries, and support for various language
49extensions, including concurrency, exceptions, and a foreign language
50interface.
51
52%package -n %{ghcver}
53Summary:        Glasgow Haskell Compilation system
54Group:          Development/Languages
55Requires:       gcc gmp-devel readline-devel
56
57%description -n %{ghcver}
58GHC is a state-of-the-art programming suite for Haskell, a purely
59functional programming language.  It includes an optimising compiler
60generating good code for a variety of platforms, together with an
61interactive system for convenient, quick development.  The
62distribution includes space and time profiling facilities, a large
63collection of libraries, and support for various language
64extensions, including concurrency, exceptions, and a foreign language
65interfaces.
66
67This package contains all the main files and libraries of version %{version}.
68
69%if %{build_prof}
70%package -n %{ghcver}-prof
71Summary:        Profiling libraries for GHC
72Group:          Development/Libraries
73Requires:       %{ghcver} = %{version}-%{release}
74Obsoletes:      ghc-prof
75
76%description -n %{ghcver}-prof
77Profiling libraries for Glorious Glasgow Haskell Compilation System
78(GHC).  They should be installed when GHC's profiling subsystem is
79needed.
80%endif
81
82%package doc
83Summary:        Documentation for GHC
84Group:          Development/Languages
85Requires:       %{name} = %{version}-%{release}
86
87%description doc
88Preformatted documentation for the Glorious Glasgow Haskell
89Compilation System (GHC) and its libraries.  It should be installed if
90you like to have local access to the documentation in HTML format.
91
92# the debuginfo subpackage is currently empty anyway, so don't generate it
93%define debug_package %{nil}
94%define __spec_install_post /usr/lib/rpm/brp-compress
95
96%prep
97%setup -q -n %{name}-%{version} -b1
98
99%build
100%if %{package_debugging}
101cd ..
102rm -rf %{name}-%{version}
103cp -al %{name}-%{version}.built %{name}-%{version}
104cd %{name}-%{version}
105exit 0
106%endif
107
108%if !%{build_prof}
109echo "GhcLibWays=" >> mk/build.mk
110echo "GhcRTSWays=thr debug" >> mk/build.mk
111%endif
112
113./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
114  --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
115  --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
116  --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
117  --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir}
118
119cat <<HADDOCK_PATH_HACK >> mk/build.mk
120docdir  := %{_docdir}/%{name}-%{version}
121htmldir := $(docdir)
122dvidir  := $(docdir)
123pdfdir  := $(docdir)
124psdir   := $(docdir)
125HADDOCK_PATH_HACK
126
127# drop truncated copy of header (#222865)
128rm libraries/network/include/Typeable.h
129
130make %{_smp_mflags} all
131%if %{build_doc}
132make %{_smp_mflags} html
133make %{_smp_mflags} -C libraries HADDOCK_DOCS=YES
134( cd libraries/Cabal && docbook2html doc/Cabal.xml --output doc/Cabal )
135%endif
136
137%install
138rm -rf $RPM_BUILD_ROOT
139
140make DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/%{name}-%{version} install
141
142%if %{build_doc}
143make DESTDIR=${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version} XMLDocWays="html" HADDOCK_DOCS=YES install-docs
144if [ -d ${RPM_BUILD_ROOT}/%{_docdir}/%{name}/libraries ]; then
145  mv ${RPM_BUILD_ROOT}/%{_docdir}/%{name}/libraries \
146    ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version}
147fi
148cp libraries/*.html ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version}/libraries
149%endif
150
151SRC_TOP=$PWD
152rm -f rpm-*-filelist rpm-*.files
153( cd $RPM_BUILD_ROOT
154  find .%{_libdir}/%{name}-%{version} \( -type d -fprintf $SRC_TOP/rpm-dir.files "%%%%dir %%p\n" \) -o \( -type f \( -name '*.p_hi' -o -name '*_p.a' \) -fprint $SRC_TOP/rpm-prof.files \) -o \( -not -name 'package.conf' -fprint $SRC_TOP/rpm-lib.files \)
155)
156
157# make paths absolute (filter "./usr" to "/usr")
158sed -i -e "s|\.%{_prefix}|%{_prefix}|" rpm-*.files
159
160cat rpm-dir.files rpm-lib.files > rpm-base-filelist
161%if %{build_prof}
162cat rpm-dir.files rpm-prof.files > rpm-prof-filelist
163%endif
164
165# create package.conf.old
166touch $RPM_BUILD_ROOT%{_libdir}/ghc-%{version}/package.conf.old
167
168mv ${RPM_BUILD_ROOT}%{_bindir}/hsc2hs ${RPM_BUILD_ROOT}%{_bindir}/hsc2hs-ghc
169
170%clean
171rm -rf $RPM_BUILD_ROOT
172
173
174%post
175/usr/bin/chcon -t unconfined_execmem_exec_t %{_bindir}/{hasktags,runghc,runhaskell} >/dev/null 2>&1 || :
176
177# Alas, GHC, Hugs, and nhc all come with different set of tools in
178# addition to a runFOO:
179#
180#   * GHC:  hsc2hs
181#   * Hugs: hsc2hs, cpphs
182#   * nhc:  cpphs
183#
184# Therefore it is currently not possible to use --slave below to form
185# link groups under a single name 'runhaskell'. Either these tools
186# should be disentangled from the Haskell implementations, or all
187# implementations should have the same set of tools. *sigh*
188
189update-alternatives --install %{_bindir}/runhaskell runhaskell \
190  %{_bindir}/runghc 500
191update-alternatives --install %{_bindir}/hsc2hs hsc2hs \
192  %{_bindir}/hsc2hs-ghc 500
193
194%post -n %{ghcver}
195/usr/bin/chcon -t unconfined_execmem_exec_t %{_libdir}/ghc-%{version}/{ghc-%{version},ghc-pkg.bin,hsc2hs-bin} >/dev/null 2>&1 || :
196
197
198%preun
199if test "$1" = 0; then
200  update-alternatives --remove runhaskell %{_bindir}/runghc
201  update-alternatives --remove hsc2hs     %{_bindir}/hsc2hs-ghc
202fi
203
204
205%files
206%defattr(-,root,root,-)
207%{_bindir}/*
208%exclude %{_bindir}/ghc*%{version}
209%doc %{_mandir}/man1/ghc.*
210
211
212%files -n %{ghcver} -f rpm-base-filelist
213%defattr(-,root,root,-)
214%doc ANNOUNCE HACKING LICENSE README
215%{_bindir}/ghc*%{version}
216%config(noreplace) %{_libdir}/ghc-%{version}/package.conf
217%ghost %{_libdir}/ghc-%{version}/package.conf.old
218
219
220%if %{build_prof}
221%files -n %{ghcver}-prof -f rpm-prof-filelist
222%defattr(-,root,root,-)
223%endif
224
225
226%if %{build_doc}
227%files doc
228%defattr(-,root,root,-)
229%{_docdir}/%{name}-%{version}
230%endif
231
232
233%changelog
234* Tue Apr  8 2008 Jens Petersen <[email protected]> - 6.8.2-10
235- another rebuild attempt
236
237* Thu Feb 14 2008 Jens Petersen <[email protected]> - 6.8.2-9
238- remove unrecognized --docdir and --htmldir from configure
239- drop old buildrequires on libX11-devel and libXt-devel
240- rebuild with gcc43
241
242* Sun Jan 06 2008 Bryan O'Sullivan <[email protected]> - 6.8.2-7
243- More attempts to fix docdir
244
245* Sun Jan 06 2008 Bryan O'Sullivan <[email protected]> - 6.8.2-6
246- Fix docdir
247
248* Tue Dec 12 2007 Bryan O'Sullivan <[email protected]> - 6.8.2-1
249- Update to 6.8.2
250
251* Fri Nov 23 2007 Bryan O'Sullivan <[email protected]> - 6.8.1-2
252- Exclude alpha
253
254* Thu Nov  8 2007 Bryan O'Sullivan <[email protected]> - 6.8.1-2
255- Drop bit-rotted attempts at making package relocatable
256
257* Sun Nov  4 2007 Michel Salim <[email protected]> - 6.8.1-1
258- Update to 6.8.1
259
260* Sat Sep 29 2007 Bryan O'Sullivan <[email protected]> - 6.8.0.20070928-2
261- add happy to BuildRequires
262
263* Sat Sep 29 2007 Bryan O'Sullivan <[email protected]> - 6.8.0.20070928-1
264- prepare for GHC 6.8.1 by building a release candidate snapshot
265
266* Thu May 10 2007 Bryan O'Sullivan <[email protected]> - 6.6.1-3
267- install man page for ghc
268
269* Thu May 10 2007 Bryan O'Sullivan <[email protected]> - 6.6.1-2
270- exclude ppc64 for now, due to lack of time to bootstrap
271
272* Wed May  9 2007 Bryan O'Sullivan <[email protected]> - 6.6.1-1
273- update to 6.6.1 release
274
275* Mon Jan 22 2007 Jens Petersen <[email protected]> - 6.6-2
276- remove truncated duplicate Typeable.h header in network package
277  (Bryan O'Sullivan, #222865)
278
279* Fri Nov  3 2006 Jens Petersen <[email protected]> - 6.6-1
280- update to 6.6 release
281- buildrequire haddock >= 0.8
282- fix summary of ghcver package (Michel Salim, #209574)
283
284* Thu Sep 28 2006 Jens Petersen <[email protected]> - 6.4.2-4
285- turn on docs generation again
286
287* Mon Sep 25 2006 Jens Petersen <[email protected]> - 6.4.2-3.fc6
288- ghost package.conf.old (Gérard Milmeister)
289- set unconfined_execmem_exec_t context on executables with ghc rts (#195821)
290- turn off building docs until haddock is back
291
292* Sat Apr 29 2006 Jens Petersen <[email protected]> - 6.4.2-2.fc6
293- buildrequire libXt-devel so that the X11 package and deps get built
294  (Garrett Mitchener, #190201)
295
296* Thu Apr 20 2006 Jens Petersen <[email protected]> - 6.4.2-1.fc6
297- update to 6.4.2 release
298
299* Thu Mar  2 2006 Jens Petersen <[email protected]> - 6.4.1-3.fc5
300- buildrequire libX11-devel instead of xorg-x11-devel (Kevin Fenzi, #181024)
301- make ghc-doc require ghc (Michel Salim, #180449)
302
303* Tue Oct 11 2005 Jens Petersen <[email protected]> - 6.4.1-2.fc5
304- turn on build_doc since haddock is now in Extras
305- no longer specify ghc version to build with (Ville Skyttä, #170176)
306
307* Tue Sep 20 2005 Jens Petersen <[email protected]> - 6.4.1-1.fc5
308- 6.4.1 release
309  - the following patches are now upstream: ghc-6.4-powerpc.patch,
310    rts-GCCompact.h-x86_64.patch, ghc-6.4-dsforeign-x86_64-1097471.patch,
311    ghc-6.4-rts-adjustor-x86_64-1097471.patch
312  - builds with gcc4 so drop %%_with_gcc32
313  - x86_64 build restrictions (no ghci and split objects) no longer apply
314
315* Tue May 31 2005 Jens Petersen <[email protected]>
316- add %%dist to release
317
318* Thu May 12 2005 Jens Petersen <[email protected]> - 6.4-8
319- initial import into Fedora Extras
320
321* Thu May 12 2005 Jens Petersen <[email protected]>
322- add build_prof and build_doc switches for -doc and -prof subpackages
323- add _with_gcc32 switch since ghc-6.4 doesn't build with gcc-4.0
324
325* Wed May 11 2005 Jens Petersen <[email protected]> - 6.4-7
326- make package relocatable (ghc#1084122)
327  - add post install scripts to replace prefix in driver scripts
328- buildrequire libxslt and docbook-style-xsl instead of docbook-utils and flex
329
330* Fri May  6 2005 Jens Petersen <[email protected]> - 6.4-6
331- add ghc-6.4-dsforeign-x86_64-1097471.patch and
332  ghc-6.4-rts-adjustor-x86_64-1097471.patch from trunk to hopefully fix
333  ffi support on x86_64 (Simon Marlow, ghc#1097471)
334- use XMLDocWays instead of SGMLDocWays to build documentation fully
335
336* Mon May  2 2005 Jens Petersen <[email protected]> - 6.4-5
337- add rts-GCCompact.h-x86_64.patch to fix GC issue on x86_64 (Simon Marlow)
338
339* Thu Mar 17 2005 Jens Petersen <[email protected]> - 6.4-4
340- add ghc-6.4-powerpc.patch (Ryan Lortie)
341- disable building interpreter rather than install and delete on x86_64
342
343* Wed Mar 16 2005 Jens Petersen <[email protected]> - 6.4-3
344- make ghc require ghcver of same ver-rel
345- on x86_64 remove ghci for now since it doesn't work and all .o files
346
347* Tue Mar 15 2005 Jens Petersen <[email protected]> - 6.4-2
348- ghc requires ghcver (Amanda Clare)
349
350* Sat Mar 12 2005 Jens Petersen <[email protected]> - 6.4-1
351- 6.4 release
352  - x86_64 build no longer unregisterised
353- use sed instead of perl to tidy filelists
354- buildrequire ghc64 instead of ghc-6.4
355- no epoch for ghc64-prof's ghc64 requirement
356- install docs directly in docdir
357
358* Fri Jan 21 2005 Jens Petersen <[email protected]> - 6.2.2-2
359- add x86_64 port
360  - build unregistered and without splitobjs
361  - specify libdir to configure and install
362- rename ghc-prof to ghcXYZ-prof, which obsoletes ghc-prof
363
364* Mon Dec  6 2004 Jens Petersen <[email protected]> - 6.2.2-1
365- move ghc requires to ghcXYZ
366
367* Wed Nov 24 2004 Jens Petersen <[email protected]> - 6.2.2-0.fdr.1
368- ghc622
369  - provide ghc = %%version
370- require gcc, gmp-devel and readline-devel
371
372* Fri Oct 15 2004 Gerard Milmeister <[email protected]> - 6.2.2-0.fdr.1
373- New Version 6.2.2
374
375* Mon Mar 22 2004 Gerard Milmeister <[email protected]> - 6.2.1-0.fdr.1
376- New Version 6.2.1
377
378* Tue Dec 16 2003 Gerard Milmeister <[email protected]> - 6.2-0.fdr.1
379- New Version 6.2
380
381* Tue Dec 16 2003 Gerard Milmeister <[email protected]> - 6.0.1-0.fdr.3
382- A few minor specfile tweaks
383
384* Mon Dec 15 2003 Gerard Milmeister <[email protected]> - 6.0.1-0.fdr.2
385- Different file list generation
386
387* Mon Oct 20 2003 Gerard Milmeister <[email protected]> - 6.0.1-0.fdr.1
388- First Fedora release
389- Added generated html docs, so that haddock is not needed
390
391* Wed Sep 26 2001 Manuel Chakravarty
392- small changes for 5.04
393
394* Wed Sep 26 2001 Manuel Chakravarty
395- split documentation off into a separate package
396- adapt to new docbook setup in RH7.1
397
398* Mon Apr 16 2001 Manuel Chakravarty
399- revised for 5.00
400- also runs autoconf automagically if no ./configure found
401
402* Thu Jun 22 2000 Sven Panne
403- removed explicit usage of hslibs/docs, it belongs to ghc/docs/set
404
405* Sun Apr 23 2000 Manuel Chakravarty
406- revised for ghc 4.07; added suggestions from Pixel <[email protected]>
407- added profiling package
408
409* Tue Dec 7 1999 Manuel Chakravarty
410- version for use from CVS
411
412* Thu Sep 16 1999 Manuel Chakravarty
413- modified for GHC 4.04, patchlevel 1 (no more 62 tuple stuff); minimises use
414  of patch files - instead emits a build.mk on-the-fly
415
416* Sat Jul 31 1999 Manuel Chakravarty
417- modified for GHC 4.04
418
419* Wed Jun 30 1999 Manuel Chakravarty
420- some more improvements from vbzoli
421
422* Fri Feb 26 1999 Manuel Chakravarty
423- modified for GHC 4.02
424
425* Thu Dec 24 1998 Zoltan Vorosbaranyi
426- added BuildRoot
427- files located in /usr/local/bin, /usr/local/lib moved to /usr/bin, /usr/lib
428
429* Tue Jul 28 1998 Manuel Chakravarty
430- original version