From Fedora Project Wiki
m (1 revision(s))
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Binary Only Template =
= Binary Only Template =
This is a sample spec file for a Haskell Cabal package. This sample demonstrates how to package a Haskell Cabal package that contains only a  binary. 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 contains only a  binary. It was orginally generated automatically using cabal-rpm, and then modified to overcome some of cabal-rpm's limitations: including missing dependency declarations which need to be added in manually.
 
* Bug me enough and I might fill them in manually - YaakovNemoy


<pre>
<pre>
%define hsc_name ghc
# ghc does not emit debug information
%define hsc_version 6.8.2
%define h_pkg_name xmobar
%define f_pkg_name xmobar
%define pkg_libdir %{_libdir}/%{hsc_name}-%{hsc_version}/%{h_pkg_name}-%{version}
%define tar_dir %{_builddir}/%{?buildsubdir}
 
%define debug_package %{nil}
%define debug_package %{nil}


Name: %{f_pkg_name}
Name: haProg
Version: 0.8
Version: version
Release: 1%{?dist}
Release: 1%{?dist}
License: BSD
License: BSD
Group: Development/Languages
Group: Development/Languages
URL: http://code.haskell.org/~arossato/xmobar
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name}
Source: xmobar-0.8.tar.gz
Source: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
Summary: A Minimalistic Text Based Status Bar
Summary: Summary of %{name}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ghc = 6.8.2
# ghc has only been bootstrapped on the following archs:
 
ExclusiveArch: i386 x86_64 ppc
BuildRequires: ghc
BuildRequires: ...


%description
%description
Xmobar is a minimalistic text based status bar.
Description of %{name}.
 
Inspired by the Ion3 status bar, it supports similar features,
like dynamic color management, output templates, and extensibility
through plugins.
 
 
%package -n %{hsc_name}-%{f_pkg_name}-prof
Summary: Profiling libraries for %{hsc_name}-%{f_pkg_name}
Group: Development/Libraries
Requires: %{hsc_name}-%{f_pkg_name} = %{version}
Provides: %{h_pkg_name}-%{hsc_name}-%{hsc_version}-prof = %{version}
 
 
%description -n %{hsc_name}-%{f_pkg_name}-prof
Xmobar is a minimalistic text based status bar.
 
Inspired by the Ion3 status bar, it supports similar features,
like dynamic color management, output templates, and extensibility
through plugins.
 
This package contains profiling libraries for %{hsc_name} %{hsc_version}.




%prep
%prep
%setup -q -n %{h_pkg_name}-%{version}
%setup -q




%build
%build
if [ -f configure.ac -a ! -f configure ] ; then autoreconf; fi
%cabal_configure
runghc Setup configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{hsc_name}-%{f_pkg_name}-%{version} --libsubdir='$compiler/$pkgid' --enable-library-profiling --ghc
%cabal_build
runghc Setup build




%install
%install
rm -rf ${RPM_BUILD_ROOT}
rm -rf ${RPM_BUILD_ROOT}
runghc Setup copy --destdir=${RPM_BUILD_ROOT}
%cabal_install
 
cd ${RPM_BUILD_ROOT}/%{_datadir}/doc/%{hsc_name}-%{f_pkg_name}-%{version}
rm -rf doc LICENSE README.html README




Line 75: Line 44:
%files
%files
%defattr(-,root,root,-)
%defattr(-,root,root,-)
%{_bindir}/xmobar
%doc LICENSE
%doc LICENSE
%{_bindir}/%{name}




%changelog
%changelog
* Thu May 01 2008 cabal-rpm <cabal-devel@haskell.org> - 0.8-1
* Day Month Date Year Fedora Haskell Packager <email@address> - version-release
- spec file autogenerated by cabal-rpm
- initial packaging for Fedora
</pre>
</pre>

Latest revision as of 04:17, 25 November 2008

Binary Only Template

This is a sample spec file for a Haskell Cabal package. This sample demonstrates how to package a Haskell Cabal package that contains only a binary. It was orginally generated automatically using cabal-rpm, and then modified to overcome some of cabal-rpm's limitations: including missing dependency declarations which need to be added in manually.

# ghc does not emit debug information
%define debug_package %{nil}

Name: haProg
Version: version
Release: 1%{?dist}
License: BSD
Group: Development/Languages
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
BuildRequires: ...

%description
Description of %{name}.


%prep
%setup -q


%build
%cabal_configure
%cabal_build


%install
rm -rf ${RPM_BUILD_ROOT}
%cabal_install


%clean
rm -rf ${RPM_BUILD_ROOT}


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


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