From Fedora Project Wiki

< PackagingDrafts‎ | Haskell

Revision as of 00:53, 14 November 2008 by Petersen (talk | contribs) (Library Only Template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Library Only Template

This is a sample spec file for a Haskell Cabal package. This sample demonstrates how to package a Haskell Cabal package that is only a library. It was generated automatically using cabal-rpm. It contains a few minor bugs, including missing dependency declarations. This is due to a limitation in cabal-rpm that needs to be fixed.

Consequently, it's been edited. The changes can be seen in the changelog below.

%define pkg_name someHaLib
%define ghc_version 6.10.1
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version}
%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name}

# Haskell compilers do not emit debug information
%define debug_package %{nil}

Name: ghc-%{pkg_name}
Version: version
Release: 1%{?dist}
License: BSD
Group: Development/Libraries
Summary: Summary of %{pkg_name} library
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}, ghc-prof = %{ghc_version}, haddock
BuildRequires: ...
Requires: ghc = %{ghc_version}
Requires: ...
Requires(pre): ghc = %{ghc_version}
Requires(preun): ghc = %{ghc_version}
Requires(post): ghc = %{ghc_version}
Requires(postun): ghc = %{ghc_version}

Description of %{pkg_name} library

%package prof
Summary: Profiling libraries for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}

%description prof
This package contains profiling libraries for ghc %{ghc_version}.

%setup -q -n %{pkg_name}-%{version}

%cabal_configure -p --ghc

rm -rf ${RPM_BUILD_ROOT}
%ghc_gen_filelists %{name}

cd ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version}

rm -rf ${RPM_BUILD_ROOT}





%files  -f %{name}.files

%files prof -f %{name}-prof.files

* Day Month Date Year Fedora Packager <email@address> - version-release
- initial packaging for Fedora