3 %bcond_without prof # profiling library
5 %define pkgname base-compat-batteries
6 Summary: base-compat with extra batteries
11 Group: Development/Languages
12 #Source0Download: http://hackage.haskell.org/package/base-compat-batteries
13 Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
14 # Source0-md5: c1975c1d453094193426762a9c59f786
15 URL: http://hackage.haskell.org/package/base-compat-batteries
16 BuildRequires: ghc >= 6.12.3
17 BuildRequires: ghc-base-compat = 0.11.1
19 BuildRequires: ghc-prof
20 BuildRequires: ghc-base-compat-prof = 0.11.1
22 BuildRequires: rpmbuild(macros) >= 1.608
24 Requires(post,postun): /usr/bin/ghc-pkg
25 Requires: ghc-base-compat = 0.11.1
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 # debuginfo is not useful for ghc
29 %define _enable_debug_packages 0
31 # don't compress haddock files
32 %define _noautocompressdoc *.haddock
35 Provides functions available in later versions of base to a wider
36 range of compilers, without requiring you to use CPP pragmas in your
39 This package provides the same API as the base-compat library, but
40 depends on compatibility packages (such as semigroups) to offer a
41 wider support window than base-compat, which has no dependencies.
42 Most of the modules in this library have the same names as in
43 base-compat to make it easier to switch between the two. There also
44 exist versions of each module with the suffix .Repl.Batteries, which
45 are distinct from anything in base-compat, to allow for easier use in
49 Summary: Profiling %{pkgname} library for GHC
50 Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC
51 Group: Development/Libraries
52 Requires: %{name} = %{version}-%{release}
53 Requires: ghc-base-compat-prof = 0.11.1
56 Profiling %{pkgname} library for GHC. Should be installed when
57 GHC's profiling subsystem is needed.
59 %description prof -l pl.UTF-8
60 Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
61 kiedy potrzebujemy systemu profilującego z GHC.
64 %setup -q -n %{pkgname}-%{version}
67 runhaskell Setup.lhs configure -v2 \
68 %{?with_prof:--enable-library-profiling} \
71 --libexecdir=%{_libexecdir} \
72 --docdir=%{_docdir}/%{name}-%{version}
74 runhaskell Setup.lhs build
75 runhaskell Setup.lhs haddock --executables
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
81 runhaskell Setup.lhs copy --destdir=$RPM_BUILD_ROOT
83 # work around automatic haddock docs installation
84 %{__rm} -rf %{name}-%{version}-doc
85 cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
86 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
88 find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -type d | %{__sed} "s|$RPM_BUILD_ROOT|%dir |" > %{name}.files
89 find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}.files
90 find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.dyn_hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}.files
91 find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.p_hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}-prof.files
93 runhaskell Setup.lhs register \
94 --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
97 rm -rf $RPM_BUILD_ROOT
105 %files -f %{name}.files
106 %defattr(644,root,root,755)
107 %doc CHANGES.markdown README.markdown %{name}-%{version}-doc/*
108 %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
109 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so
110 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a
111 %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
114 %files prof -f %{name}-prof.files
115 %defattr(644,root,root,755)
116 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a