From Fedora Project Wiki
(→‎Library and Binary Template: update macros, etc)
(→‎Library and Binary Template: add install scripts requires)
Line 3: Line 3:


<pre>
<pre>
%define ghc_version 6.8.3
%define ghc_version 6.10.1
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}


Line 30: Line 30:
Group: Development/Libraries
Group: Development/Libraries
Requires: ghc = %{ghc_version}
Requires: ghc = %{ghc_version}
Requires(pre): %{_bindir}/ghc-pkg-%{ghc_version}
Requires(preun): %{_bindir}/ghc-pkg-%{ghc_version}
Requires(post): %{_bindir}/ghc-pkg-%{ghc_version}
Requires(postun): %{_bindir}/ghc-pkg-%{ghc_version}


%description -n ghc-%{name}
%description -n ghc-%{name}
Line 100: Line 104:


%changelog
%changelog
* Wed Aug 12 2008 Yaakov M. Nemoy <yankee@koan> - 0.7-3
* Today Fedora Haskell Packager - version-release
- Replaced content with macros
- initial packaging for Fedora
- Removed funky naming scheme with something more straight forward
 
* Wed Jul 2 2008 Yaakov M. Nemoy <yankee@koan> - 0.7-2
- added BuildRequires
- added Requires
- changed Group
- changed URL
- changed Source
 
* Thu Jun 26 2008 cabal-rpm <cabal-devel@haskell.org> - 0.7-1
- spec file autogenerated by cabal-rpm
</pre>
</pre>

Revision as of 00:37, 10 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}

# 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)
BuildRequires: ghc = %{ghc_version}, ghc-prof = %{ghc_version}, haddock
BuildRequires: ...
Requires: ghc = %{ghc_version}
Requires: ...

%description
Description of %{name}.

%package -n ghc-%{name}
Summary: Summary of ghc-%{name}
Group: Development/Libraries
Requires: ghc = %{ghc_version}
Requires(pre): %{_bindir}/ghc-pkg-%{ghc_version}
Requires(preun): %{_bindir}/ghc-pkg-%{ghc_version}
Requires(post): %{_bindir}/ghc-pkg-%{ghc_version}
Requires(postun): %{_bindir}/ghc-pkg-%{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


%preun -n ghc-%{name}
%ghc_preun_script


%postun -n ghc-%{name}
%ghc_postun_script


%files
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/%{name}

%files -n ghc-%{name} -f ghc-%{name}.files
%defattr(-,root,root,-)
%doc dist/doc/html
%doc LICENSE TODO README


%files -n %{hsc_name}-%{name}-prof -f ghc-%{name}-prof.files
%defattr(-,root,root,-)
%doc LICENSE


%changelog
* Today  Fedora Haskell Packager - version-release
- initial packaging for Fedora