From Fedora Project Wiki
< PackagingDrafts | Haskell
m (1 revision(s)) |
|||
(19 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
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. | 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. | |||
<pre> | <pre> | ||
%define | %define pkg_name someHaLib | ||
%define | %define ghc_version 6.10.1 | ||
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version} | |||
%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name} | |||
%define pkg_libdir %{_libdir}/ | |||
%define | |||
# Haskell compilers do not emit debug information | |||
%define debug_package %{nil} | %define debug_package %{nil} | ||
Name: | Name: ghc-%{pkg_name} | ||
Version: | Version: version | ||
Release: 1%{?dist} | Release: 1%{?dist} | ||
License: BSD | License: BSD | ||
Group: Development/ | Group: Development/Libraries | ||
URL: http:// | URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} | ||
Source: | Source: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz | ||
Summary: | Summary: Summary of %{pkg_name} library | ||
Provides: %{name}-devel = %{version}-%{release} | |||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
BuildRequires: ghc = | # ghc has only been bootstrapped on the following archs: | ||
ExclusiveArch: i386 x86_64 ppc | |||
Requires: | 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 | %description | ||
Description of %{pkg_name} library | |||
%package prof | |||
Summary: Profiling libraries for %{name} | |||
%package | |||
Summary: Profiling libraries for %{ | |||
Group: Development/Libraries | Group: Development/Libraries | ||
Requires: %{ | Requires: %{name} = %{version} | ||
%description prof | |||
%description | This package contains profiling libraries for ghc %{ghc_version}. | ||
This package contains profiling libraries for %{ | |||
%prep | %prep | ||
%setup -q -n %{ | %setup -q -n %{pkg_name}-%{version} | ||
%build | %build | ||
%cabal_configure -p --ghc | |||
%cabal_build | |||
%cabal_haddock | |||
%ghc_gen_scripts | |||
%install | %install | ||
rm -rf ${RPM_BUILD_ROOT} | rm -rf ${RPM_BUILD_ROOT} | ||
%cabal_install | |||
%ghc_install_scripts | |||
%ghc_gen_filelists %{name} | |||
cd ${RPM_BUILD_ROOT}/%{ | cd ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version} | ||
rm -rf doc LICENSE README | rm -rf doc LICENSE README | ||
Line 108: | Line 72: | ||
%pre | %pre | ||
%ghc_preinst_script | |||
%post | %post | ||
% | %ghc_postinst_script | ||
%ghc_reindex_haddock | |||
%preun | %preun | ||
% | %ghc_preun_script | ||
%postun | %postun | ||
%ghc_postun_script | |||
%ghc_reindex_haddock | |||
%files -f %{name} | %files -f %{name}.files | ||
% | %defattr(-,root,root,-) | ||
%doc LICENSE README | %doc LICENSE README | ||
%files | %files prof -f %{name}-prof.files | ||
%%doc LICENSE | %defattr(-,root,root,-) | ||
%doc LICENSE | |||
%{pkg_docdir} | |||
%changelog | %changelog | ||
* | * Day Month Date Year Fedora Packager <email@address> - version-release | ||
- | - initial packaging for Fedora | ||
</pre> | </pre> |
Latest revision as of 00:53, 14 November 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 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 URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} Source: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz 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 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}. %prep %setup -q -n %{pkg_name}-%{version} %build %cabal_configure -p --ghc %cabal_build %cabal_haddock %ghc_gen_scripts %install rm -rf ${RPM_BUILD_ROOT} %cabal_install %ghc_install_scripts %ghc_gen_filelists %{name} cd ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version} rm -rf doc LICENSE README %clean rm -rf ${RPM_BUILD_ROOT} %pre %ghc_preinst_script %post %ghc_postinst_script %ghc_reindex_haddock %preun %ghc_preun_script %postun %ghc_postun_script %ghc_reindex_haddock %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE README %files prof -f %{name}-prof.files %defattr(-,root,root,-) %doc LICENSE %{pkg_docdir} %changelog * Day Month Date Year Fedora Packager <email@address> - version-release - initial packaging for Fedora