backport: merge prof subpackages into devel to simplify packaging

This commit is contained in:
Jens Petersen 2011-06-13 14:00:59 +09:00
parent babb06a261
commit 3c7e24880d
2 changed files with 20 additions and 46 deletions

View File

@ -7,7 +7,7 @@
# configure # configure
%cabal_configure\ %cabal_configure\
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghclibdocdir}/%{pkg_name}-%{version} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{?cabal_configure_options} %cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{?cabal_configure_options}
# install # install
%cabal_install %cabal copy --destdir=%{buildroot} -v %cabal_install %cabal copy --destdir=%{buildroot} -v
@ -27,7 +27,7 @@
%define basepkg ghc-%{pkgname}\ %define basepkg ghc-%{pkgname}\
%define pkgdir %{ghclibdir}/%{pkgnamever}\ %define pkgdir %{ghclibdir}/%{pkgnamever}\
%define docdir %{ghclibdocdir}/%{pkgnamever}\ %define docdir %{ghclibdocdir}/%{pkgnamever}\
rm -f %{basepkg}.files %{basepkg}-devel.files %{basepkg}-prof.files\ rm -f %{basepkg}.files %{basepkg}-devel.files\
%if %{undefined ghc_without_shared}\ %if %{undefined ghc_without_shared}\
echo "%defattr(-,root,root,-)" > %{basepkg}.files\ echo "%defattr(-,root,root,-)" > %{basepkg}.files\
if [ -d "%{buildroot}%{pkgdir}" ]; then\ if [ -d "%{buildroot}%{pkgdir}" ]; then\
@ -49,16 +49,12 @@ fi\
echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\ echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\
if [ -d "%{buildroot}%{pkgdir}" ]; then\ if [ -d "%{buildroot}%{pkgdir}" ]; then\
find %{buildroot}%{pkgdir} -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\ find %{buildroot}%{pkgdir} -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
find %{buildroot}%{pkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\ find %{buildroot}%{pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
fi\
echo "%defattr(-,root,root,-)" > %{basepkg}-prof.files\
if [ -d "%{buildroot}%{pkgdir}" ]; then\
find %{buildroot}%{pkgdir} \\( -name "*_p.a" -o -name "*.p_hi" \\) >> %{basepkg}-prof.files\
fi\ fi\
if [ -d "%{buildroot}%{docdir}" ]; then\ if [ -d "%{buildroot}%{docdir}" ]; then\
echo "%{docdir}" >> %{basepkg}-devel.files\ echo "%{docdir}" >> %{basepkg}-devel.files\
fi\ fi\
sed -i -e "s!%{buildroot}!!g" %{!?ghc_without_shared:%{basepkg}.files} %{basepkg}-devel.files %{basepkg}-prof.files\ sed -i -e "s!%{buildroot}!!g" %{!?ghc_without_shared:%{basepkg}.files} %{basepkg}-devel.files\
%{nil} %{nil}
# compiler version # compiler version
@ -83,10 +79,6 @@ Requires(postun): ghc = %{ghc_version}\
Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\
%endif %endif
# prof pkg basic requires
%ghc_prof_requires Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}}-devel = %{?pkgver}%{!?pkgver:%{version}}-%{release}\
%{nil}
# ghc_lib_package [-c cdepslist] [-h pkgdepslist] (-o deprecated no-op) # ghc_lib_package [-c cdepslist] [-h pkgdepslist] (-o deprecated no-op)
%ghc_lib_package(c:h:o:)\ %ghc_lib_package(c:h:o:)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\ %define pkgname %{?1}%{!?1:%{pkg_name}}\
@ -99,8 +91,6 @@ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:
%endif\ %endif\
\ \
%ghc_package_devel\ %ghc_package_devel\
\
%ghc_package_prof\
%{nil} %{nil}
# ghc_binlib_package [-c cdepslist] [-h pkgdepslist] [-l licensetag] (-o deprecated no-op) [-x] [name] [version] # ghc_binlib_package [-c cdepslist] [-h pkgdepslist] [-l licensetag] (-o deprecated no-op) [-x] [name] [version]
@ -152,6 +142,8 @@ Group: Development/Libraries\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\ %{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
Obsoletes: %{basepkg}-doc < %{version}-%{release}\ Obsoletes: %{basepkg}-doc < %{version}-%{release}\
Provides: %{basepkg}-doc = %{version}-%{release}\ Provides: %{basepkg}-doc = %{version}-%{release}\
Obsoletes: %{basepkg}-prof < %{version}-%{release}\
Provides: %{basepkg}-prof = %{version}-%{release}\
\ \
%description -n %{basepkg}-devel\ %description -n %{basepkg}-devel\
%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ %{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
@ -170,30 +162,6 @@ This package contains the development files.\
%defattr(-,root,root,-)\ %defattr(-,root,root,-)\
%{nil} %{nil}
# ghc_package_prof [-h pkgdepslist] [-l licensetag]
%ghc_package_prof(h:l:)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%define basepkg ghc-%{pkgname}\
%package -n %{basepkg}-prof\
Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname}} profiling libraries\
Group: Development/Libraries\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
%{?ghc_prof_requires}\
%{-h:Requires: %(echo "%{-h*}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
\
%description -n %{basepkg}-prof\
%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
\
This package contains the profiling development files.\
\
%files -n %{basepkg}-prof -f %{basepkg}-prof.files\
%defattr(-,root,root,-)\
%{nil}
# ghc_strip_dynlinked # ghc_strip_dynlinked
%ghc_strip_dynlinked\ %ghc_strip_dynlinked\
%if %{undefined __debug_package}\ %if %{undefined __debug_package}\

View File

@ -1,7 +1,9 @@
%global debug_package %{nil} %global debug_package %{nil}
%global macros_file %{_sysconfdir}/rpm/macros.ghc
Name: ghc-rpm-macros Name: ghc-rpm-macros
Version: 0.10.55 Version: 0.10.56
Release: 1%{?dist} Release: 1%{?dist}
Summary: Macros for building packages for GHC Summary: Macros for building packages for GHC
@ -19,8 +21,8 @@ Source3: ghc-deps.sh
%description %description
A set of macros for building GHC packages following the Haskell Guidelines A set of macros for building GHC packages following the Haskell Guidelines
of the Fedora Haskell SIG. This package probably shouldn't be installed on of the Fedora Haskell SIG. ghc needs to be installed in order to make use of
its own as GHC is needed in order to make use of these macros. these macros.
%prep %prep
%setup -c -T %setup -c -T
@ -33,15 +35,15 @@ echo no build stage needed
%install %install
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm
install -p -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc install -p -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{macros_file}
mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm mkdir -p %{buildroot}/%{_prefix}/lib/rpm
install -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm install -p %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm
# this is why this package is now arch-dependent: # this is why this package is now arch-dependent:
# turn off shared libs and dynamic linking on secondary archs # turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64 %ifnarch %{ix86} x86_64
cat >> ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc <<EOF cat >> %{buildroot}/%{macros_file} <<EOF
# shared libraries are only supported on primary intel archs # shared libraries are only supported on primary intel archs
%%ghc_without_dynamic 1 %%ghc_without_dynamic 1
@ -53,11 +55,15 @@ EOF
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING AUTHORS %doc COPYING AUTHORS
%config(noreplace) %{_sysconfdir}/rpm/macros.ghc %config(noreplace) %{macros_file}
%{_prefix}/lib/rpm/ghc-deps.sh %{_prefix}/lib/rpm/ghc-deps.sh
%changelog %changelog
* Mon Jun 13 2011 Jens Petersen <petersen@redhat.com> - 0.10.56-1
- merge prof subpackages into devel to simplify packaging
- condition --htmldir on pkg_name
* Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 0.10.55-1 * Mon May 9 2011 Jens Petersen <petersen@redhat.com> - 0.10.55-1
- include ghc_pkg_c_deps even when -c option used - include ghc_pkg_c_deps even when -c option used