3 %bcond_without prof # profiling library
5 %define pkgname network-bsd
6 Summary: POSIX network database (<netdb.h>) API
11 Group: Development/Languages
12 #Source0Download: http://hackage.haskell.org/package/network-bsd
13 Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
14 # Source0-md5: 53572973c4c5d52e19bcd1a1f71593c3
15 Patch0: ghc-network-3.1.patch
16 URL: http://hackage.haskell.org/package/network-bsd
17 BuildRequires: ghc >= 6.12.3
18 BuildRequires: ghc-network >= 3.0.0.0
20 BuildRequires: ghc-prof
21 BuildRequires: ghc-network-prof >= 3.0.0.0
23 BuildRequires: rpmbuild(macros) >= 1.608
25 Requires(post,postun): /usr/bin/ghc-pkg
26 Requires: ghc-network >= 3.0.0.0
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 # debuginfo is not useful for ghc
30 %define _enable_debug_packages 0
32 # don't compress haddock files
33 %define _noautocompressdoc *.haddock
36 This package provides Haskell bindings to the the POSIX network
37 database (<netdb.h>) API.
40 Summary: Profiling %{pkgname} library for GHC
41 Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC
42 Group: Development/Libraries
43 Requires: %{name} = %{version}-%{release}
44 Requires: ghc-network-prof >= 3.0.0.0
47 Profiling %{pkgname} library for GHC. Should be installed when
48 GHC's profiling subsystem is needed.
50 %description prof -l pl.UTF-8
51 Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
52 kiedy potrzebujemy systemu profilującego z GHC.
55 %setup -q -n %{pkgname}-%{version}
59 runhaskell Setup.hs configure -v2 \
60 %{?with_prof:--enable-library-profiling} \
63 --libexecdir=%{_libexecdir} \
64 --docdir=%{_docdir}/%{name}-%{version}
66 runhaskell Setup.hs build
67 runhaskell Setup.hs haddock --executables
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d
73 runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT
75 # work around automatic haddock docs installation
76 %{__rm} -rf %{name}-%{version}-doc
77 cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
78 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
80 runhaskell Setup.hs register \
81 --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
84 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
94 %doc CHANGELOG.md LICENSE %{name}-%{version}-doc/html
95 %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
96 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}
97 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so
98 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a
99 %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
101 %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Network
102 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Network/*.hi
103 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Network/*.dyn_hi
107 %defattr(644,root,root,755)
108 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a
109 %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Network/*.p_hi