- move spec templates to haskell-packaging for easy updating
- provide correct haddock version spec templating: - use bcond for - add doc subpackages to lib and binlib templates - add license header for cabal2spec
This commit is contained in:
parent
644d44d682
commit
65d3718c16
@ -3,8 +3,8 @@
|
|||||||
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}
|
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{name}-%{version}
|
||||||
%define pkg_docdir %{_docdir}/ghc/libraries/%{name}-%{version}
|
%define pkg_docdir %{_docdir}/ghc/libraries/%{name}-%{version}
|
||||||
|
|
||||||
%define build_prof 1
|
%bcond_without prof
|
||||||
%define build_doc 1
|
%bcond_without doc
|
||||||
|
|
||||||
# ghc does not emit debug information
|
# ghc does not emit debug information
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
@ -15,14 +15,14 @@ Release: 1%{?dist}
|
|||||||
Summary: *FIXME*
|
Summary: *FIXME*
|
||||||
|
|
||||||
Group: *FIXME*
|
Group: *FIXME*
|
||||||
License: BSD?
|
License: BSD? *FIXME*
|
||||||
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name}
|
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name}
|
||||||
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
|
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
# ghc has only been bootstrapped on the following archs:
|
# ghc has only been bootstrapped on the following archs:
|
||||||
ExclusiveArch: i386 x86_64 ppc
|
ExclusiveArch: i386 x86_64 ppc
|
||||||
BuildRequires: ghc = %{ghc_version}
|
BuildRequires: ghc = %{ghc_version}
|
||||||
%if %{build_prof}
|
%if %{with prof}
|
||||||
BuildRequires: ghc-prof = %{ghc_version}
|
BuildRequires: ghc-prof = %{ghc_version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -37,13 +37,24 @@ Provides: ghc-%{name}-devel = %{version}-%{release}
|
|||||||
Requires: ghc = %{ghc_version}
|
Requires: ghc = %{ghc_version}
|
||||||
Requires(post): ghc = %{ghc_version}
|
Requires(post): ghc = %{ghc_version}
|
||||||
Requires(preun): ghc = %{ghc_version}
|
Requires(preun): ghc = %{ghc_version}
|
||||||
Requires(postun): ghc = %{ghc_version}
|
|
||||||
|
|
||||||
%description -n ghc-%{name}
|
%description -n ghc-%{name}
|
||||||
Haskell %{name} library. *FIXME*
|
Haskell %{name} library. *FIXME*
|
||||||
|
|
||||||
|
|
||||||
%if %{build_prof}
|
%if %{with doc}
|
||||||
|
%package -n ghc-%{name}-doc
|
||||||
|
Summary: Documentation for %{name}
|
||||||
|
Group: Development/Libraries
|
||||||
|
Requires: ghc-doc = %{ghc_version}
|
||||||
|
Requires(postun): ghc-doc = %{ghc_version}
|
||||||
|
|
||||||
|
%description -n ghc-%{name}-doc
|
||||||
|
This package contains development documentation files for the %{name} library.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with prof}
|
||||||
%package -n ghc-%{name}-prof
|
%package -n ghc-%{name}-prof
|
||||||
Summary: Profiling libraries for %{name}
|
Summary: Profiling libraries for %{name}
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -60,14 +71,9 @@ This package contains profiling libraries for %{name}.
|
|||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cabal_configure --ghc \
|
%cabal_configure --ghc %{!?without_prof:-p}
|
||||||
%if %{build_prof}
|
|
||||||
-p
|
|
||||||
%else
|
|
||||||
%{nil}
|
|
||||||
%endif
|
|
||||||
%cabal build
|
%cabal build
|
||||||
%if %{build_doc}
|
%if %{with doc}
|
||||||
%cabal haddock
|
%cabal haddock
|
||||||
%endif
|
%endif
|
||||||
%ghc_gen_scripts
|
%ghc_gen_scripts
|
||||||
@ -86,7 +92,10 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%post -n ghc-%{name}
|
%post -n ghc-%{name}
|
||||||
%ghc_register_pkg
|
%ghc_register_pkg
|
||||||
%if %{build_doc}
|
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
%post -n ghc-%{name}-doc
|
||||||
%ghc_reindex_haddock
|
%ghc_reindex_haddock
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -97,26 +106,32 @@ if [ "$1" -eq 0 ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
%postun -n ghc-%{name}
|
%if %{with doc}
|
||||||
|
%postun -n ghc-%{name}-doc
|
||||||
if [ "$1" -eq 0 ] ; then
|
if [ "$1" -eq 0 ] ; then
|
||||||
%if %{build_doc}
|
|
||||||
%ghc_reindex_haddock
|
%ghc_reindex_haddock
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE
|
%doc LICENSE
|
||||||
%{_bindir}/%{name}
|
%{_bindir}/%{name}
|
||||||
|
|
||||||
|
|
||||||
%files -n ghc-%{name} -f ghc-%{name}.files
|
%files -n ghc-%{name} -f ghc-%{name}.files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%if %{build_doc}
|
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
%files -n ghc-%{name}-doc
|
||||||
|
%defattr(-,root,root,-)
|
||||||
%{pkg_docdir}
|
%{pkg_docdir}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%if %{build_prof}
|
%if %{with prof}
|
||||||
%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
|
%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%endif
|
%endif
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version}
|
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version}
|
||||||
%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name}-%{version}
|
%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name}-%{version}
|
||||||
|
|
||||||
%define build_prof 1
|
%bcond_without prof
|
||||||
%define build_doc 1
|
%bcond_without doc
|
||||||
|
|
||||||
# ghc does not emit debug information
|
# ghc does not emit debug information
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
@ -16,27 +16,39 @@ Release: 1%{?dist}
|
|||||||
Summary: Haskell %{pkg_name} library *FIXME*
|
Summary: Haskell %{pkg_name} library *FIXME*
|
||||||
|
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
License: BSD?
|
License: BSD? *FIXME*
|
||||||
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name}
|
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name}
|
||||||
Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
|
Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
|
||||||
Provides: %{name}-devel = %{version}-%{release}
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
|
Provides: %{name}-devel = %{version}-%{release}
|
||||||
# ghc has only been bootstrapped on the following archs:
|
# ghc has only been bootstrapped on the following archs:
|
||||||
ExclusiveArch: i386 x86_64 ppc
|
ExclusiveArch: i386 x86_64 ppc
|
||||||
BuildRequires: ghc = %{ghc_version}
|
BuildRequires: ghc = %{ghc_version}
|
||||||
%if %{build_prof}
|
%if %{with prof}
|
||||||
BuildRequires: ghc-prof = %{ghc_version}
|
BuildRequires: ghc-prof = %{ghc_version}
|
||||||
%endif
|
%endif
|
||||||
Requires: ghc = %{ghc_version}
|
Requires: ghc = %{ghc_version}
|
||||||
Requires(post): ghc = %{ghc_version}
|
Requires(post): ghc = %{ghc_version}
|
||||||
Requires(preun): ghc = %{ghc_version}
|
Requires(preun): ghc = %{ghc_version}
|
||||||
Requires(postun): ghc = %{ghc_version}
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Haskell %{pkg_name} library for ghc-%{ghc_version}. *FIXME*
|
Haskell %{pkg_name} library for ghc-%{ghc_version}. *FIXME*
|
||||||
|
|
||||||
|
|
||||||
%if %{build_prof}
|
%if %{with doc}
|
||||||
|
%package doc
|
||||||
|
Summary: Documentation for %{name}
|
||||||
|
Group: Development/Libraries
|
||||||
|
Requires: ghc-doc = %{ghc_version}
|
||||||
|
Requires(postun): ghc-doc = %{ghc_version}
|
||||||
|
|
||||||
|
%description doc
|
||||||
|
This package contains development documentation files for the %{name} library.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with prof}
|
||||||
%package prof
|
%package prof
|
||||||
Summary: Profiling libraries for %{name}
|
Summary: Profiling libraries for %{name}
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -53,14 +65,9 @@ This package contains profiling libraries for %{name}.
|
|||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cabal_configure --ghc \
|
%cabal_configure --ghc %{!?without_prof:-p}
|
||||||
%if %{build_prof}
|
|
||||||
-p
|
|
||||||
%else
|
|
||||||
%{nil}
|
|
||||||
%endif
|
|
||||||
%cabal build
|
%cabal build
|
||||||
%if %{build_doc}
|
%if %{with doc}
|
||||||
%cabal haddock
|
%cabal haddock
|
||||||
%endif
|
%endif
|
||||||
%ghc_gen_scripts
|
%ghc_gen_scripts
|
||||||
@ -77,9 +84,12 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%ghc_register_pkg
|
%ghc_register_pkg
|
||||||
%if %{build_doc}
|
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
%post doc
|
||||||
%ghc_reindex_haddock
|
%ghc_reindex_haddock
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -90,23 +100,27 @@ if [ "$1" -eq 0 ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
%postun
|
%if %{with doc}
|
||||||
|
%postun doc
|
||||||
if [ "$1" -eq 0 ] ; then
|
if [ "$1" -eq 0 ] ; then
|
||||||
%if %{build_doc}
|
|
||||||
%ghc_reindex_haddock
|
%ghc_reindex_haddock
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%files -f %{name}.files
|
%files -f %{name}.files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE
|
%doc LICENSE
|
||||||
%if %{build_doc}
|
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
%files doc
|
||||||
|
%defattr(-,root,root,-)
|
||||||
%{pkg_docdir}
|
%{pkg_docdir}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%if %{build_prof}
|
%if %{with prof}
|
||||||
%files prof -f %{name}-prof.files
|
%files prof -f %{name}-prof.files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%endif
|
%endif
|
||||||
|
22
ghc.spec
22
ghc.spec
@ -25,17 +25,13 @@ Group: Development/Languages
|
|||||||
Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
|
Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
|
||||||
Source1: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src-extralibs.tar.bz2
|
Source1: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src-extralibs.tar.bz2
|
||||||
Source2: ghc-rpm-macros.ghc
|
Source2: ghc-rpm-macros.ghc
|
||||||
Source3: cabal2spec
|
|
||||||
Source4: cabal-bin-template.spec.in
|
|
||||||
Source5: cabal-lib-template.spec.in
|
|
||||||
Source6: cabal-binlib-template.spec.in
|
|
||||||
URL: http://haskell.org/ghc/
|
URL: http://haskell.org/ghc/
|
||||||
Requires: gcc, gmp-devel, libedit-devel
|
Requires: gcc, gmp-devel, libedit-devel
|
||||||
Requires(post): policycoreutils
|
Requires(post): policycoreutils
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Obsoletes: ghc682, ghc681, ghc661, ghc66, haddock <= 2.0.0.0
|
Obsoletes: ghc682, ghc681, ghc661, ghc66, haddock <= 2.0.0.0
|
||||||
# introduced for f11 and to be removed for f13:
|
# introduced for f11 and to be removed for f13:
|
||||||
Provides: haddock = 2.2.2
|
Provides: haddock = 2.3.0
|
||||||
BuildRequires: ghc, happy, sed
|
BuildRequires: ghc, happy, sed
|
||||||
BuildRequires: gmp-devel, libedit-devel
|
BuildRequires: gmp-devel, libedit-devel
|
||||||
%if %{build_doc}
|
%if %{build_doc}
|
||||||
@ -131,13 +127,6 @@ make DESTDIR=${RPM_BUILD_ROOT} install-docs
|
|||||||
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm
|
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm
|
||||||
cp -p %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
|
cp -p %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
|
||||||
|
|
||||||
# spec templating
|
|
||||||
# cabal2spec
|
|
||||||
install -m 0755 -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_bindir}
|
|
||||||
# templates for bin, lib and binlib cabal hackages
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}/ghc
|
|
||||||
cp -p %{SOURCE4} %{SOURCE5} %{SOURCE6} ${RPM_BUILD_ROOT}/%{_datadir}/ghc/
|
|
||||||
|
|
||||||
SRC_TOP=$PWD
|
SRC_TOP=$PWD
|
||||||
rm -f rpm-*-filelist rpm-*.files
|
rm -f rpm-*-filelist rpm-*.files
|
||||||
( cd $RPM_BUILD_ROOT
|
( cd $RPM_BUILD_ROOT
|
||||||
@ -203,7 +192,6 @@ fi
|
|||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
%{_sysconfdir}/rpm/macros.ghc
|
%{_sysconfdir}/rpm/macros.ghc
|
||||||
%config(noreplace) %{_libdir}/ghc-%{version}/package.conf
|
%config(noreplace) %{_libdir}/ghc-%{version}/package.conf
|
||||||
%{_datadir}/ghc
|
|
||||||
|
|
||||||
%if %{build_prof}
|
%if %{build_prof}
|
||||||
%files prof -f rpm-prof-filelist
|
%files prof -f rpm-prof-filelist
|
||||||
@ -229,11 +217,9 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Dec 5 2008 Jens Petersen <petersen@redhat.com>
|
* Mon Jan 19 2009 Jens Petersen <petersen@redhat.com> - 6.10.1-6
|
||||||
- more template fixes:
|
- move spec templates to a haskell-packaging for easy updating
|
||||||
- version pkg_docdir
|
- provide correct haddock version
|
||||||
- put provides in lib subsubpackage
|
|
||||||
- binlib scripts are for lib subpackage
|
|
||||||
|
|
||||||
* Mon Dec 1 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-6
|
* Mon Dec 1 2008 Jens Petersen <petersen@redhat.com> - 6.10.1-6
|
||||||
- update macros.ghc to latest proposed revised packaging guidelines:
|
- update macros.ghc to latest proposed revised packaging guidelines:
|
||||||
|
Loading…
Reference in New Issue
Block a user