From Fedora Project Wiki
< PackagingDrafts | Haskell
m (1 revision(s)) |
(→Library and Binary Template: provide -devel) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= Library and Binary Template = | = Library and Binary Template = | ||
This is a sample spec file for a Haskell Cabal package. This sample demonstrates how to package a Haskell Cabal package that contains a library and binary together. It | This is a sample spec file for a Haskell Cabal package. This sample demonstrates how to package a Haskell Cabal package that contains a library and binary together. It can be generated automatically using cabal-rpm and then modified include missing dependency declarations, etc. | ||
<pre> | <pre> | ||
%define | %define ghc_version 6.10.1 | ||
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version} | |||
%define pkg_docdir %{_docdir}/ghc/libraries/%{name} | |||
%define pkg_libdir %{_libdir}/ | |||
%define | |||
# Haskell compilers do not emit debug information | |||
%define debug_package %{nil} | %define debug_package %{nil} | ||
Name: | Name: progHasLibs | ||
Version: 0.7 | Version: 0.7 | ||
Release: | Release: 3%{?dist} | ||
License: BSD | License: BSD | ||
Group: | Group: User Interface/X | ||
URL: http:// | URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name} | ||
Source: | Source: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz | ||
Summary: | Summary: Summary of %{name} | ||
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 | |||
BuildRequires: ghc = %{ghc_version}, ghc-prof = %{ghc_version}, haddock | |||
BuildRequires: ... | |||
Requires: ghc = %{ghc_version} | |||
%description | %description | ||
Description of %{name}. | |||
%package -n %{ | %package -n ghc-%{name} | ||
Summary: Summary of ghc-%{name} | |||
Group: Development/Libraries | Group: Development/Libraries | ||
Provides: ghc-%{name}-devel = %{version}-%{release} | |||
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} | |||
This package contains libraries for %{ | %description -n ghc-%{name} | ||
This package contains libraries for ghc %{ghc_version}. | |||
%package -n | %package -n ghc-%{name}-prof | ||
Summary: Profiling libraries for | Summary: Profiling libraries for ghc-%{name} | ||
Group: Development/Libraries | Group: Development/Libraries | ||
Requires: | Requires: ghc-%{name} = %{version} | ||
This package contains profiling libraries for %{ | %description -n ghc-%{name}-prof | ||
This package contains profiling libraries for ghc %{ghc_version}. | |||
%prep | %prep | ||
%setup -q | %setup -q | ||
%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 ghc-%{name} | |||
cd ${RPM_BUILD_ROOT}/%{ | cd ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version} | ||
rm -rf doc LICENSE TODO README | rm -rf doc LICENSE TODO README | ||
Line 115: | Line 75: | ||
%clean | %clean | ||
rm -rf ${RPM_BUILD_ROOT} | rm -rf ${RPM_BUILD_ROOT} | ||
%pre -n ghc-%{name} | |||
%ghc_preinst_script | |||
% | %post -n ghc-%{name} | ||
%ghc_postinst_script | |||
%ghc_reindex_haddock | |||
% | %preun -n ghc-%{name} | ||
% | %ghc_preun_script | ||
% | %postun -n ghc-%{name} | ||
% | %ghc_postun_script | ||
%ghc_reindex_haddock | |||
% | %files | ||
%defattr(-,root,root,-) | |||
%doc LICENSE | |||
%{_bindir}/%{name} | |||
%files -n ghc-%{name} -f ghc-%{name}.files | |||
%files -n | %defattr(-,root,root,-) | ||
% | |||
%doc LICENSE TODO README | %doc LICENSE TODO README | ||
%{pkg_docdir} | |||
%files -n | %files -n ghc-%{name}-prof -f ghc-%{name}-prof.files | ||
%defattr(-,root,root,-) | %defattr(-,root,root,-) | ||
%doc LICENSE | %doc LICENSE | ||
%changelog | %changelog | ||
* | * Today Fedora Haskell Packager - version-release | ||
- | - initial packaging for Fedora | ||
</pre> | </pre> |
Latest revision as of 00:55, 14 November 2008
Library and Binary Template
This is a sample spec file for a Haskell Cabal package. This sample demonstrates how to package a Haskell Cabal package that contains a library and binary together. It can be generated automatically using cabal-rpm and then modified include missing dependency declarations, etc.
%define ghc_version 6.10.1 %define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version} %define pkg_docdir %{_docdir}/ghc/libraries/%{name} # Haskell compilers do not emit debug information %define debug_package %{nil} Name: progHasLibs Version: 0.7 Release: 3%{?dist} License: BSD Group: User Interface/X URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name} Source: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz Summary: Summary of %{name} 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} %description Description of %{name}. %package -n ghc-%{name} Summary: Summary of ghc-%{name} Group: Development/Libraries Provides: ghc-%{name}-devel = %{version}-%{release} 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 -n ghc-%{name} This package contains libraries for ghc %{ghc_version}. %package -n ghc-%{name}-prof Summary: Profiling libraries for ghc-%{name} Group: Development/Libraries Requires: ghc-%{name} = %{version} %description -n ghc-%{name}-prof This package contains profiling libraries for ghc %{ghc_version}. %prep %setup -q %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 ghc-%{name} cd ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version} rm -rf doc LICENSE TODO README %clean rm -rf ${RPM_BUILD_ROOT} %pre -n ghc-%{name} %ghc_preinst_script %post -n ghc-%{name} %ghc_postinst_script %ghc_reindex_haddock %preun -n ghc-%{name} %ghc_preun_script %postun -n ghc-%{name} %ghc_postun_script %ghc_reindex_haddock %files %defattr(-,root,root,-) %doc LICENSE %{_bindir}/%{name} %files -n ghc-%{name} -f ghc-%{name}.files %defattr(-,root,root,-) %doc LICENSE TODO README %{pkg_docdir} %files -n ghc-%{name}-prof -f ghc-%{name}-prof.files %defattr(-,root,root,-) %doc LICENSE %changelog * Today Fedora Haskell Packager - version-release - initial packaging for Fedora