3 %bcond_without prof # profiling library
5 %define pkgname aeson-pretty
6 Summary: JSON pretty-printing library and command-line tool
11 Group: Development/Languages
12 #Source0Download: http://hackage.haskell.org/package/aeson-pretty
13 Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
14 # Source0-md5: 2c323511f2ce49171a6312b579f73ef2
15 URL: http://hackage.haskell.org/package/aeson-pretty
16 BuildRequires: ghc >= 6.12.3
17 BuildRequires: ghc-aeson
18 BuildRequires: ghc-attoparsec >= 0.10
19 BuildRequires: ghc-cmdargs >= 0.7
20 BuildRequires: ghc-scientific
21 BuildRequires: ghc-vector
23 BuildRequires: ghc-prof
24 BuildRequires: ghc-aeson-prof
25 BuildRequires: ghc-attoparsec-prof >= 0.10
26 BuildRequires: ghc-cmdargs-prof >= 0.7
27 BuildRequires: ghc-scientific-prof
28 BuildRequires: ghc-vector-prof
30 BuildRequires: rpmbuild(macros) >= 1.608
32 Requires(post,postun): /usr/bin/ghc-pkg
34 Requires: ghc-attoparsec >= 0.10
35 Requires: ghc-cmdargs >= 0.7
36 Requires: ghc-scientific
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 # debuginfo is not useful for ghc
41 %define _enable_debug_packages 0
43 # don't compress haddock files
44 %define _noautocompressdoc *.haddock
47 A JSON pretty-printing library compatible with aeson as well as a
48 command-line tool to improve readabilty of streams of JSON data.
50 The library provides the function "encodePretty". It is a drop-in
51 replacement for aeson's "encode" function, producing JSON-ByteStrings
54 The command-line tool reads JSON from stdin and writes prettified JSON
55 to stdout. It also offers a complementary "compact"-mode, essentially
56 the opposite of pretty-printing. If you specify -flib-only like this
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-aeson-prof
64 Requires: ghc-attoparsec-prof >= 0.10
65 Requires: ghc-cmdargs-prof >= 0.7
66 Requires: ghc-scientific-prof
67 Requires: ghc-vector-prof
70 Profiling %{pkgname} library for GHC. Should be installed when
71 GHC's profiling subsystem is needed.
73 %description prof -l pl.UTF-8
74 Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
75 kiedy potrzebujemy systemu profilującego z GHC.
78 %setup -q -n %{pkgname}-%{version}
81 runhaskell Setup.hs configure -v2 \
82 %{?with_prof:--enable-library-profiling} \
85 --libexecdir=%{_libexecdir} \
86 --docdir=%{_docdir}/%{name}-%{version}
88 runhaskell Setup.hs build
89 runhaskell Setup.hs haddock
92 rm -rf $RPM_BUILD_ROOT
93 install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
95 runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
97 # work around automatic haddock docs installation
98 %{__rm} -rf %{name}-%{version}-doc
99 cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
100 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
102 runhaskell Setup.hs register \
103 --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
106 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc README.markdown %{name}-%{version}-doc/*
117 %attr(755,root,root) %{_bindir}/aeson-pretty
118 %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
119 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}
120 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so
121 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a
122 %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
124 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data
125 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Aeson
126 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Aeson/Encode
127 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Aeson/Encode/*.hi
128 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Aeson/Encode/*.dyn_hi
132 %defattr(644,root,root,755)
133 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
134 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Aeson/Encode/*.p_hi