]> git.pld-linux.org Git - packages/ghc-json.git/blob - ghc-json.spec
4577fde819025b0796fcd362c8b5d3545b207fcd
[packages/ghc-json.git] / ghc-json.spec
1 #
2 # Conditional build:
3 %bcond_without  prof    # profiling library
4 #
5 %define         pkgname json
6 Summary:        Support for serialising Haskell to and from JSON
7 Summary(pl.UTF-8):      Obsługa serializacji Haskella do i z formatu JSON
8 Name:           ghc-%{pkgname}
9 Version:        0.10
10 Release:        1
11 License:        BSD
12 Group:          Development/Languages
13 #Source0Download: http://hackage.haskell.org/package/json
14 Source0:        http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
15 # Source0-md5:  a30006f2e673b29852be7c001cfc2bfa
16 URL:            http://hackage.haskell.org/package/json
17 BuildRequires:  ghc >= 6.12.3
18 BuildRequires:  ghc-array
19 BuildRequires:  ghc-base >= 3
20 BuildRequires:  ghc-bytestring
21 BuildRequires:  ghc-containers
22 BuildRequires:  ghc-mtl
23 BuildRequires:  ghc-text
24 %if %{with prof}
25 BuildRequires:  ghc-prof >= 6.12.3
26 BuildRequires:  ghc-array-prof
27 BuildRequires:  ghc-base-prof >= 3
28 BuildRequires:  ghc-bytestring-prof
29 BuildRequires:  ghc-containers-prof
30 BuildRequires:  ghc-mtl-prof
31 BuildRequires:  ghc-text-prof
32 %endif
33 BuildRequires:  rpmbuild(macros) >= 1.608
34 Requires(post,postun):  /usr/bin/ghc-pkg
35 %requires_eq    ghc
36 Requires:       ghc-array
37 Requires:       ghc-base >= 3
38 Requires:       ghc-bytestring
39 Requires:       ghc-containers
40 Requires:       ghc-mtl
41 Requires:       ghc-text
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 # debuginfo is not useful for ghc
45 %define         _enable_debug_packages  0
46
47 # don't compress haddock files
48 %define         _noautocompressdoc      *.haddock
49
50 %description
51 This library provides a parser and pretty printer for converting
52 between Haskell values and JSON.
53
54 %description -l pl.UTF-8
55 Ta biblioteka udostępnia parser oraz funkcję wypisującą (pretty
56 printer) do konwersji między wartościami Haskella a formatem JSON.
57
58 %package prof
59 Summary:        Profiling %{pkgname} library for GHC
60 Summary(pl.UTF-8):      Biblioteka profilująca %{pkgname} dla GHC.
61 Group:          Development/Libraries
62 Requires:       %{name} = %{version}-%{release}
63 Requires:       ghc-array-prof
64 Requires:       ghc-base-prof >= 3
65 Requires:       ghc-bytestring-prof
66 Requires:       ghc-containers-prof
67 Requires:       ghc-mtl-prof
68 Requires:       ghc-text-prof
69
70 %description prof
71 Profiling %{pkgname} library for GHC. Should be installed when GHC's
72 profiling subsystem is needed.
73
74 %description prof -l pl.UTF-8
75 Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
76 kiedy potrzebujemy systemu profilującego z GHC.
77
78 %prep
79 %setup -q -n %{pkgname}-%{version}
80
81 %build
82 runhaskell Setup.hs configure -v2 \
83         %{?with_prof:--enable-library-profiling} \
84         --prefix=%{_prefix} \
85         --libdir=%{_libdir} \
86         --libexecdir=%{_libexecdir} \
87         --docdir=%{_docdir}/%{name}-%{version}
88
89 runhaskell Setup.hs build
90 runhaskell Setup.hs haddock --executables
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94 install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
95
96 runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
97
98 # work around automatic haddock docs installation
99 %{__rm} -rf %{name}-%{version}-doc
100 cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
101 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
102
103 runhaskell Setup.hs register \
104         --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
105
106 %clean
107 rm -rf $RPM_BUILD_ROOT
108
109 %post
110 %ghc_pkg_recache
111
112 %postun
113 %ghc_pkg_recache
114
115 %files
116 %defattr(644,root,root,755)
117 %doc CHANGES %{name}-%{version}-doc/*
118 %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
119 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}
120 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSjson-%{version}-*.so
121 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSjson-%{version}-*.a
122 %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSjson-%{version}-*_p.a
123 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text
124 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.hi
125 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.dyn_hi
126 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/JSON
127 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/JSON/*.hi
128 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/JSON/*.dyn_hi
129
130 %files prof
131 %defattr(644,root,root,755)
132 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSjson-%{version}-*_p.a
133 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.p_hi
134 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/JSON/*.p_hi
This page took 0.100092 seconds and 2 git commands to generate.