ghc/cabal-binlib-template.spec.in
Jens Petersen ad8913e5ff - update macros.ghc to latest proposed revised packaging guidelines:
- use runghc
- drop trivial cabal_build and cabal_haddock macros
- ghc_register_pkg and ghc_unregister_pkg replace ghc_preinst_script,
    ghc_postinst_script, ghc_preun_script, and ghc_postun_script
- lib templates' prof subpackage requires main library again
- make cabal2spec work on .cabal files too, and read and check name and
    version directly from .cabal file
- ghc-prof does not need to own libraries/ dirs owned by main package
2008-12-01 05:46:36 +00:00

126 lines
2.4 KiB
RPMSpec

%define ghc_version @GHC_VERSION@
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}
%define pkg_docdir %{_docdir}/ghc/libraries/%{name}
%define build_prof 1
%define build_doc 1
# ghc does not emit debug information
%define debug_package %{nil}
Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?dist}
Summary: *FIXME*
Group: *FIXME*
License: BSD?
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name}
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
Provides: %{name}-devel = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# ghc has only been bootstrapped on the following archs:
ExclusiveArch: i386 x86_64 ppc
BuildRequires: ghc = %{ghc_version}
%if %{build_prof}
BuildRequires: ghc-prof = %{ghc_version}
%endif
%description
*FIXME*
%package -n ghc-%{name}
Summary: Haskell %{name} library *FIXME*
Group: Development/Libraries
Provides: ghc-%{name}-devel = %{version}-%{release}
Requires: ghc = %{ghc_version}
Requires(post): ghc = %{ghc_version}
Requires(preun): ghc = %{ghc_version}
Requires(postun): ghc = %{ghc_version}
%description -n ghc-%{name}
Haskell %{name} library for ghc-%{ghc_version}. *FIXME*
%if %{build_prof}
%package prof
Summary: Profiling libraries for ghc-%{name}
Group: Development/Libraries
Requires: ghc-%{name} = %{version}-%{release}
Requires: ghc-prof = %{ghc_version}
%description prof
This package contains profiling libraries for ghc %{ghc_version}.
%endif
%prep
%setup -q -n %{name}-%{version}
%build
%cabal_configure --ghc \
%if %{build_prof}
-p
%else
%{nil}
%endif
%cabal build
%if %{build_doc}
%cabal haddock
%endif
%ghc_gen_scripts
%install
rm -rf $RPM_BUILD_ROOT
%cabal_install
%ghc_install_scripts
%ghc_gen_filelists %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%ghc_register_pkg
%if %{build_doc}
%ghc_reindex_haddock
%endif
%preun
if [ "$1" -eq 0 ] ; then
%ghc_unregister_pkg
fi
%postun
if [ "$1" -eq 0 ] ; then
%if %{build_doc}
%ghc_reindex_haddock
%endif
fi
%files -f %{name}.files
%defattr(-,root,root,-)
%doc LICENSE
%if %{build_doc}
%{pkg_docdir}
%endif
%if %{build_prof}
%files prof -f %{name}-prof.files
%defattr(-,root,root,-)
%endif
%changelog
* @DATE@ @PACKAGER@ <@EMAIL@> - @VERSION@-1
- initial packaging for Fedora created by cabal2spec