]> git.pld-linux.org Git - SPECS.git/blob - ghc-safe-exceptions.spec
SPECS updated Sun 1 Aug 20:13:02 CEST 2021
[SPECS.git] / ghc-safe-exceptions.spec
1 #
2 # Conditional build:
3 %bcond_without  prof    # profiling library
4 #
5 %define         pkgname safe-exceptions
6 Summary:        Safe, consistent, and easy exception handling
7 Name:           ghc-%{pkgname}
8 Version:        0.1.7.0
9 Release:        1
10 License:        MIT
11 Group:          Development/Languages
12 #Source0Download: http://hackage.haskell.org/package/safe-exceptions
13 Source0:        http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
14 # Source0-md5:  a1ef100de8fcb54a3d7b5564fa295f1a
15 Patch0:         ghc-8.10.patch
16 URL:            http://hackage.haskell.org/package/safe-exceptions
17 BuildRequires:  ghc >= 6.12.3
18 %if %{with prof}
19 BuildRequires:  ghc-prof
20 %endif
21 BuildRequires:  rpmbuild(macros) >= 1.608
22 %requires_eq    ghc
23 Requires(post,postun):  /usr/bin/ghc-pkg
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 # debuginfo is not useful for ghc
27 %define         _enable_debug_packages  0
28
29 # don't compress haddock files
30 %define         _noautocompressdoc      *.haddock
31
32 %description
33 Runtime exceptions - as exposed in base by the Control.Exception
34 module - have long been an intimidating part of the Haskell ecosystem.
35 This package, and this README for the package, are intended to
36 overcome this. It provides a safe and simple API on top of the
37 existing exception handling machinery. The API is equivalent to
38 the underlying implementation in terms of power but encourages best
39 practices to minimize the chances of getting the exception handling
40 wrong. By doing so and explaining the corner cases clearly, the hope
41 is to turn what was previously something scary into an aspect of
42 Haskell everyone feels safe using.
43
44 %package prof
45 Summary:        Profiling %{pkgname} library for GHC
46 Summary(pl.UTF-8):      Biblioteka profilująca %{pkgname} dla GHC
47 Group:          Development/Libraries
48 Requires:       %{name} = %{version}-%{release}
49
50 %description prof
51 Profiling %{pkgname} library for GHC.  Should be installed when
52 GHC's profiling subsystem is needed.
53
54 %description prof -l pl.UTF-8
55 Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
56 kiedy potrzebujemy systemu profilującego z GHC.
57
58 %prep
59 %setup -q -n %{pkgname}-%{version}
60 %patch0 -p1
61
62 %build
63 runhaskell Setup.hs configure -v2 \
64         %{?with_prof:--enable-library-profiling} \
65         --prefix=%{_prefix} \
66         --libdir=%{_libdir} \
67         --libexecdir=%{_libexecdir} \
68         --docdir=%{_docdir}/%{name}-%{version}
69
70 runhaskell Setup.hs build
71 runhaskell Setup.hs haddock --executables
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
76
77 runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
78
79 # work around automatic haddock docs installation
80 %{__rm} -rf %{name}-%{version}-doc
81 cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
82 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
83
84 runhaskell Setup.hs register \
85         --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %post
91 %ghc_pkg_recache
92
93 %postun
94 %ghc_pkg_recache
95
96 %files
97 %defattr(644,root,root,755)
98 %doc COOKBOOK.md ChangeLog.md LICENSE README.md %{name}-%{version}-doc/html
99 %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
100 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}
101 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so
102 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a
103 %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
104
105 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control
106 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception
107 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception/*.hi
108 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception/*.dyn_hi
109
110 %if %{with prof}
111 %files prof
112 %defattr(644,root,root,755)
113 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
114 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Exception/*.p_hi
115 %endif
This page took 0.040929 seconds and 3 git commands to generate.