]>
Commit | Line | Data |
---|---|---|
13c8b5c8 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname hxt | |
6 | Summary: A collection of tools for processing XML with Haskell | |
7 | Name: ghc-%{pkgname} | |
8 | Version: 9.3.1.18 | |
61d86e04 | 9 | Release: 2 |
13c8b5c8 JR |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/hxt | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: fc58dede9d9df529486d91d015bfec63 | |
15 | URL: http://hackage.haskell.org/package/hxt | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | BuildRequires: ghc-hxt-charproperties >= 9.1 | |
18 | BuildRequires: ghc-hxt-regex-xmlschema >= 9.2 | |
19 | BuildRequires: ghc-hxt-unicode >= 9.0.1 | |
20 | BuildRequires: ghc-network >= 2.4 | |
21 | BuildRequires: ghc-network-uri >= 2.6 | |
22 | %if %{with prof} | |
23 | BuildRequires: ghc-prof | |
24 | BuildRequires: ghc-hxt-charproperties-prof >= 9.1 | |
25 | BuildRequires: ghc-hxt-regex-xmlschema-prof >= 9.2 | |
26 | BuildRequires: ghc-hxt-unicode-prof >= 9.0.1 | |
27 | BuildRequires: ghc-network-prof >= 2.4 | |
28 | BuildRequires: ghc-network-uri-prof >= 2.6 | |
29 | %endif | |
30 | BuildRequires: rpmbuild(macros) >= 1.608 | |
31 | %requires_eq ghc | |
32 | Requires(post,postun): /usr/bin/ghc-pkg | |
33 | Requires: ghc-hxt-charproperties >= 9.1 | |
34 | Requires: ghc-hxt-regex-xmlschema >= 9.2 | |
35 | Requires: ghc-hxt-unicode >= 9.0.1 | |
36 | Requires: ghc-network >= 2.4 | |
37 | Requires: ghc-network-uri >= 2.6 | |
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 | The Haskell XML Toolbox bases on the ideas of HaXml and HXML, but | |
48 | introduces a more general approach for processing XML with Haskell. | |
49 | The Haskell XML Toolbox uses a generic data model for representing XML | |
50 | documents, including the DTD subset and the document subset, in | |
51 | Haskell. It contains a validating XML parser, a HTML parser, namespace | |
52 | support, an XPath expression evaluator, an XSLT library, a RelaxNG | |
53 | schema validator and funtions for serialization and deserialization | |
54 | of user defined data. The library makes extensive use of the arrow | |
55 | approach for processing XML. | |
56 | ||
57 | %package prof | |
58 | Summary: Profiling %{pkgname} library for GHC | |
59 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
60 | Group: Development/Libraries | |
61 | Requires: %{name} = %{version}-%{release} | |
62 | Requires: ghc-hxt-charproperties-prof >= 9.1 | |
63 | Requires: ghc-hxt-regex-xmlschema-prof >= 9.2 | |
64 | Requires: ghc-hxt-unicode-prof >= 9.0.1 | |
65 | Requires: ghc-network-prof >= 2.4 | |
66 | Requires: ghc-network-uri-prof >= 2.6 | |
67 | ||
68 | %description prof | |
69 | Profiling %{pkgname} library for GHC. Should be installed when | |
70 | GHC's profiling subsystem is needed. | |
71 | ||
72 | %description prof -l pl.UTF-8 | |
73 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
74 | kiedy potrzebujemy systemu profilującego z GHC. | |
75 | ||
76 | %prep | |
77 | %setup -q -n %{pkgname}-%{version} | |
78 | ||
79 | %build | |
80 | runhaskell Setup.lhs configure -v2 \ | |
81 | %{?with_prof:--enable-library-profiling} \ | |
82 | --prefix=%{_prefix} \ | |
83 | --libdir=%{_libdir} \ | |
84 | --libexecdir=%{_libexecdir} \ | |
85 | --docdir=%{_docdir}/%{name}-%{version} | |
86 | ||
87 | runhaskell Setup.lhs build | |
88 | runhaskell Setup.lhs haddock --executables | |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
93 | ||
94 | runhaskell Setup.lhs copy --destdir=$RPM_BUILD_ROOT | |
95 | ||
96 | # work around automatic haddock docs installation | |
97 | %{__rm} -rf %{name}-%{version}-doc | |
98 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
99 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
100 | ||
101 | runhaskell Setup.lhs register \ | |
102 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
103 | ||
104 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -type d | %{__sed} "s|$RPM_BUILD_ROOT|%dir |" > %{name}.files | |
105 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}.files | |
106 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.dyn_hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}.files | |
107 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.p_hi' | %{__sed} "s|$RPM_BUILD_ROOT||" > %{name}-prof.files | |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %post | |
113 | %ghc_pkg_recache | |
114 | ||
115 | %postun | |
116 | %ghc_pkg_recache | |
117 | ||
118 | %files -f %{name}.files | |
119 | %defattr(644,root,root,755) | |
120 | %doc %{name}-%{version}-doc/* | |
121 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
122 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so | |
123 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
124 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
125 | ||
126 | %if %{with prof} | |
127 | %files prof -f %{name}-prof.files | |
128 | %defattr(644,root,root,755) | |
129 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
130 | %endif |