]> git.pld-linux.org Git - SPECS.git/blob - ghc-aeson-pretty.spec
SPECS updated Sun 1 Aug 20:28:02 CEST 2021
[SPECS.git] / ghc-aeson-pretty.spec
1 #
2 # Conditional build:
3 %bcond_without  prof    # profiling library
4 #
5 %define         pkgname aeson-pretty
6 Summary:        JSON pretty-printing library and command-line tool
7 Name:           ghc-%{pkgname}
8 Version:        0.8.8
9 Release:        2
10 License:        BSD
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
22 %if %{with prof}
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
29 %endif
30 BuildRequires:  rpmbuild(macros) >= 1.608
31 %requires_eq    ghc
32 Requires(post,postun):  /usr/bin/ghc-pkg
33 Requires:       ghc-aeson
34 Requires:       ghc-attoparsec >= 0.10
35 Requires:       ghc-cmdargs >= 0.7
36 Requires:       ghc-scientific
37 Requires:       ghc-vector
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 # debuginfo is not useful for ghc
41 %define         _enable_debug_packages  0
42
43 # don't compress haddock files
44 %define         _noautocompressdoc      *.haddock
45
46 %description
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.
49
50 The library provides the function "encodePretty". It is a drop-in
51 replacement for aeson's "encode" function, producing JSON-ByteStrings
52 for human readers.
53
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
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-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
68
69 %description prof
70 Profiling %{pkgname} library for GHC.  Should be installed when
71 GHC's profiling subsystem is needed.
72
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.
76
77 %prep
78 %setup -q -n %{pkgname}-%{version}
79
80 %build
81 runhaskell Setup.hs configure -v2 \
82         %{?with_prof:--enable-library-profiling} \
83         --prefix=%{_prefix} \
84         --libdir=%{_libdir} \
85         --libexecdir=%{_libexecdir} \
86         --docdir=%{_docdir}/%{name}-%{version}
87
88 runhaskell Setup.hs build
89 runhaskell Setup.hs haddock
90
91 %install
92 rm -rf $RPM_BUILD_ROOT
93 install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
94
95 runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
96
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}
101
102 runhaskell Setup.hs register \
103         --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %post
109 %ghc_pkg_recache
110
111 %postun
112 %ghc_pkg_recache
113
114 %files
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
123
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
129
130 %if %{with prof}
131 %files prof
132 %defattr(644,root,root,755)
133 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
134 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Aeson/Encode/*.p_hi
135 %endif
This page took 0.195772 seconds and 3 git commands to generate.