From Fedora Project Wiki
< PackagingDrafts | Haskell
(→Library and Binary Template: remove pkg_name) |
|||
Line 5: | Line 5: | ||
%define hsc_name ghc | %define hsc_name ghc | ||
%define hsc_version 6.8.3 | %define hsc_version 6.8.3 | ||
%define pkg_libdir %{_libdir}/%{hsc_name}-%{hsc_version}/%{name}-%{version} | |||
%define pkg_libdir %{_libdir}/%{hsc_name}-%{hsc_version}/%{ | |||
%define debug_package %{nil} | %define debug_package %{nil} | ||
#Haskell compilers do not traditionally emit DWARF data. | #Haskell compilers do not traditionally emit DWARF data. | ||
Name: | Name: progHasLibs | ||
Version: 0.7 | Version: 0.7 | ||
Release: 3%{?dist} | Release: 3%{?dist} | ||
License: BSD | License: BSD | ||
Group: User Interface/X | Group: User Interface/X | ||
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{ | URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name} | ||
Source: http://hackage.haskell.org/packages/archive/%{ | Source: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz | ||
Summary: Summary of %{ | Summary: Summary of %{name} | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
BuildRequires: %{hsc_name} = %{hsc_version}, %{hsc_name}-prof = %{hsc_version}, haddock | BuildRequires: %{hsc_name} = %{hsc_version}, %{hsc_name}-prof = %{hsc_version}, haddock | ||
Line 26: | Line 25: | ||
%description | %description | ||
Description of %{ | Description of %{name}. | ||
%package -n %{hsc_name}-%{ | %package -n %{hsc_name}-%{name} | ||
Summary: Summary of %{ | Summary: Summary of %{name} | ||
Group: Development/Libraries | Group: Development/Libraries | ||
Requires: %{hsc_name} = %{hsc_version} | Requires: %{hsc_name} = %{hsc_version} | ||
%description -n %{hsc_name}-%{ | %description -n %{hsc_name}-%{name} | ||
This package contains libraries for %{hsc_name} %{hsc_version}. | This package contains libraries for %{hsc_name} %{hsc_version}. | ||
%package -n %{hsc_name}-%{ | %package -n %{hsc_name}-%{name}-prof | ||
Summary: Profiling libraries for %{hsc_name}-%{ | Summary: Profiling libraries for %{hsc_name}-%{name} | ||
Group: Development/Libraries | Group: Development/Libraries | ||
Requires: %{hsc_name}-%{ | Requires: %{hsc_name}-%{name} = %{version} | ||
%description -n %{hsc_name}-%{ | %description -n %{hsc_name}-%{name}-prof | ||
This package contains profiling libraries for %{hsc_name} %{hsc_version}. | This package contains profiling libraries for %{hsc_name} %{hsc_version}. | ||
%prep | %prep | ||
%setup -q -n %{ | %setup -q -n %{name}-%{version} | ||
Line 63: | Line 62: | ||
%ghc_gen_filelists %{name} | %ghc_gen_filelists %{name} | ||
cd ${RPM_BUILD_ROOT}/%{_datadir}/doc/%{ | cd ${RPM_BUILD_ROOT}/%{_datadir}/doc/%{name}-%{version} | ||
rm -rf doc LICENSE TODO README | rm -rf doc LICENSE TODO README | ||
Line 69: | Line 68: | ||
%clean | %clean | ||
rm -rf ${RPM_BUILD_ROOT} | rm -rf ${RPM_BUILD_ROOT} | ||
%pre -n %{hsc_name}-%{ | %pre -n %{hsc_name}-%{name} | ||
%ghc_preinst_script | %ghc_preinst_script | ||
%post -n %{hsc_name}-%{ | %post -n %{hsc_name}-%{name} | ||
%ghc_postinst_script | %ghc_postinst_script | ||
%preun -n %{hsc_name}-%{ | %preun -n %{hsc_name}-%{name} | ||
%ghc_preun_script | %ghc_preun_script | ||
%postun -n %{hsc_name}-%{ | %postun -n %{hsc_name}-%{name} | ||
%ghc_postun_script | %ghc_postun_script | ||
Line 90: | Line 89: | ||
%{_bindir}/%{name} | %{_bindir}/%{name} | ||
%files -n %{hsc_name}-%{ | %files -n %{hsc_name}-%{name} -f %{name}-files | ||
%defattr(-,root,root,-) | %defattr(-,root,root,-) | ||
%doc dist/doc/html | %doc dist/doc/html | ||
Line 96: | Line 95: | ||
%files -n %{hsc_name}-%{ | %files -n %{hsc_name}-%{name}-prof -f %{name}-files.prof | ||
%defattr(-,root,root,-) | %defattr(-,root,root,-) | ||
%doc LICENSE | %doc LICENSE |
Revision as of 07:36, 22 August 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 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. They have been filled in manually.
%define hsc_name ghc %define hsc_version 6.8.3 %define pkg_libdir %{_libdir}/%{hsc_name}-%{hsc_version}/%{name}-%{version} %define debug_package %{nil} #Haskell compilers do not traditionally emit DWARF data. 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: %{hsc_name} = %{hsc_version}, %{hsc_name}-prof = %{hsc_version}, haddock BuildRequires: ... Requires: %{hsc_name} = %{hsc_version} Requires: ... %description Description of %{name}. %package -n %{hsc_name}-%{name} Summary: Summary of %{name} Group: Development/Libraries Requires: %{hsc_name} = %{hsc_version} %description -n %{hsc_name}-%{name} This package contains libraries for %{hsc_name} %{hsc_version}. %package -n %{hsc_name}-%{name}-prof Summary: Profiling libraries for %{hsc_name}-%{name} Group: Development/Libraries Requires: %{hsc_name}-%{name} = %{version} %description -n %{hsc_name}-%{name}-prof This package contains profiling libraries for %{hsc_name} %{hsc_version}. %prep %setup -q -n %{name}-%{version} %build %ghc_autotools -l -p enable %ghc_build %ghc_haddock %ghc_gen_scripts %install rm -rf ${RPM_BUILD_ROOT} %ghc_install %ghc_install_scripts %ghc_gen_filelists %{name} cd ${RPM_BUILD_ROOT}/%{_datadir}/doc/%{name}-%{version} rm -rf doc LICENSE TODO README %clean rm -rf ${RPM_BUILD_ROOT} %pre -n %{hsc_name}-%{name} %ghc_preinst_script %post -n %{hsc_name}-%{name} %ghc_postinst_script %preun -n %{hsc_name}-%{name} %ghc_preun_script %postun -n %{hsc_name}-%{name} %ghc_postun_script %files %defattr(-,root,root,-) %doc LICENSE %{_bindir}/%{name} %files -n %{hsc_name}-%{name} -f %{name}-files %defattr(-,root,root,-) %doc dist/doc/html %doc LICENSE TODO README %files -n %{hsc_name}-%{name}-prof -f %{name}-files.prof %defattr(-,root,root,-) %doc LICENSE %changelog * Wed Aug 12 2008 Yaakov M. Nemoy <yankee@koan> - 0.7-3 - Replaced content with macros - 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