From Fedora Project Wiki
Line 23: Line 23:
Summary: Summary of %{pkg_name} library
Summary: Summary of %{pkg_name} library
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ghc = %{hsc_version}
Requires: %{hsc_name} = %{hsc_version}
Requires: ...
Requires: ...
BuildRequires: ghc = %{hsc_version}, ghc-prof = %{hsc_version}, haddock
BuildRequires: %{hsc_name} = %{hsc_version}, %{hsc_name}-prof = %{hsc_version}, haddock
BuildRequires: ...
BuildRequires: ...

Revision as of 07:26, 22 August 2008

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 hsc_name ghc
%define hsc_version 6.8.3
%define pkg_name someHaLib
%define pkg_libdir %{_libdir}/%{hsc_name}-%{hsc_version}/%{pkg_name}-%{version}

# Haskell compilers do not traditionally emit DWARF data.
%define debug_package %{nil}

Name: %{hsc_name}-%{pkg_name}
Version: 0.7
Release: 3%{?dist}
License: BSD
Group: Development/Libraries
Summary: Summary of %{pkg_name} library
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: %{hsc_name} = %{hsc_version}
Requires: ...
BuildRequires: %{hsc_name} = %{hsc_version}, %{hsc_name}-prof = %{hsc_version}, haddock
BuildRequires: ...

Description of %{pkg_name} library

%package -n %{hsc_name}-%{pkg_name}-prof
Summary: Profiling libraries for %{hsc_name}-%{pkg_name}
Group: Development/Libraries
Requires: %{hsc_name}-%{pkg_name} = %{version}

%description -n %{hsc_name}-%{pkg_name}-prof
This package contains profiling libraries for %{hsc_name} %{hsc_version}.

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

%ghc_autotools -l -p enable 

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

cd ${RPM_BUILD_ROOT}/%{_datadir}/doc/%{hsc_name}-%{pkg_name}-%{version}

rm -rf ${RPM_BUILD_ROOT}





%files  -f %{name}-files
%doc dist/doc/html

%files -n %{hsc_name}-%{pkg_name}-prof -f %{name}

* Wed Aug 13 2008 Yaakov M. Nemoy <yankee@koan> - 0.7-3
- added URL
- changed Group from default

* Wed Aug 13 2008 Yaakov M. Nemoy <yankee@koan> - 0.7-2
- adds requirements list

* Wed Aug 13 2008 cabal-rpm <> - 0.7-1
- spec file autogenerated by cabal-rpm