disable shared and dynamic on secondary archs

- this package is now arch-dependent
- rename without_shared to ghc_without_shared and without_dynamic
  to ghc_without_dynamic so that they can be globally defined for
  secondary archs without shared libs
- use %%undefined macro
- disable debug_package in ghc_bin_build and ghc_lib_build
- set ghc_without_shared and ghc_without_dynamic on secondary
  (ie non main intel archs)
- disable debuginfo for self
epel9
Jens Petersen 14 years ago
parent 26005406d3
commit 2c0b10d5d5

@ -1,13 +1,13 @@
# RPM Macros for packaging Haskell cabalized packages # RPM Macros for packaging Haskell cabalized packages -*-rpm-spec-*-
# see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details # see https://fedoraproject.org/wiki/PackagingDrafts/Haskell for more details
# "cabal" # "cabal"
%cabal [ -x Setup ] || ghc --make %{!?without_shared:%{!?without_dynamic:-dynamic}} Setup\ %cabal [ -x Setup ] || ghc --make %{!?ghc_without_shared:%{!?ghc_without_dynamic:-dynamic}} Setup\
./Setup ./Setup
# 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 %{!?without_shared:--enable-shared} %{!?without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} %cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghclibdocdir}/%{pkg_name}-%{version} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options}
# install # install
%cabal_install %cabal copy --destdir=%{buildroot} -v %cabal_install %cabal copy --destdir=%{buildroot} -v
@ -28,7 +28,7 @@
%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 %{basepkg}-prof.files\
%if 0%{!?without_shared:1}\ %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\
echo "%dir %{pkgdir}" >> %{basepkg}.files\ echo "%dir %{pkgdir}" >> %{basepkg}.files\
@ -38,7 +38,7 @@ fi\
echo "%defattr(-,root,root,-)" > %{basepkg}-devel.files\ echo "%defattr(-,root,root,-)" > %{basepkg}-devel.files\
%if 0%{!?1:1}\ %if 0%{!?1:1}\
if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\ if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}%{?without_shared:-devel}.files\ echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
fi\ fi\
%endif\ %endif\
echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\ echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\
@ -53,7 +53,7 @@ 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" %{!?without_shared:%{basepkg}.files} %{basepkg}-devel.files %{basepkg}-prof.files\ sed -i -e "s!%{buildroot}!!g" %{!?ghc_without_shared:%{basepkg}.files} %{basepkg}-devel.files %{basepkg}-prof.files\
%{nil} %{nil}
# compiler version # compiler version
@ -74,7 +74,7 @@ install --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.d\
%ghc_devel_requires Requires: ghc = %{ghc_version}\ %ghc_devel_requires Requires: ghc = %{ghc_version}\
Requires(post): ghc = %{ghc_version}\ Requires(post): ghc = %{ghc_version}\
Requires(postun): ghc = %{ghc_version}\ Requires(postun): ghc = %{ghc_version}\
%if 0%{!?without_shared:1}\ %if %{undefined ghc_without_shared}\
Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\
%endif %endif
@ -88,7 +88,7 @@ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:
%define pkgver %{?2}%{!?2:%{version}}\ %define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\ %define pkgnamever %{pkgname}-%{pkgver}\
%define basepkg ghc-%{pkgname}\ %define basepkg ghc-%{pkgname}\
%if 0%{!?without_shared:1}\ %if %{undefined ghc_without_shared}\
%files -n %{basepkg} -f %{basepkg}.files\ %files -n %{basepkg} -f %{basepkg}.files\
%defattr(-,root,root,-)\ %defattr(-,root,root,-)\
%endif\ %endif\
@ -113,8 +113,7 @@ Group: System Environment/Libraries\
\ \
%description -n %{basepkg}\ %description -n %{basepkg}\
%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ %{?common_description}%{!?common_description:Haskell %{pkgname} library.}\
\ %if %{defined ghc_version} && %{undefined ghc_without_shared}\
%if 0%{?ghc_version:%{!?without_shared:1}}\
This package provides the shared library.\ This package provides the shared library.\
%endif\ %endif\
\ \
@ -195,17 +194,19 @@ This package contains the profiling development files.\
# ghc_strip_dynlinked # ghc_strip_dynlinked
%ghc_strip_dynlinked\ %ghc_strip_dynlinked\
%if 0%{!?__debug_package:1}\ %if %{undefined __debug_package}\
find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\
%endif %endif
# ghc_bin_build # ghc_bin_build
%ghc_bin_build\ %ghc_bin_build\
%global debug_package %{nil}\
%cabal_configure\ %cabal_configure\
%cabal build %cabal build
# ghc_lib_build [name] [version] # ghc_lib_build [name] [version]
%ghc_lib_build()\ %ghc_lib_build()\
%global debug_package %{nil}\
%{?1:cd %1-%2}\ %{?1:cd %1-%2}\
%cabal_configure %{!?without_prof:-p} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2}\ %cabal_configure %{!?without_prof:-p} %{?1:--docdir=%{_docdir}/ghc-%1-%2 --htmldir=%{ghclibdocdir}/%1-%2}\
%cabal build\ %cabal build\

@ -1,5 +1,7 @@
%global debug_package %{nil}
Name: ghc-rpm-macros Name: ghc-rpm-macros
Version: 0.11.9 Version: 0.11.10
Release: 1%{?dist} Release: 1%{?dist}
Summary: Macros for building packages for GHC Summary: Macros for building packages for GHC
@ -15,8 +17,6 @@ Source1: COPYING
Source2: AUTHORS Source2: AUTHORS
Source3: ghc-deps.sh Source3: ghc-deps.sh
BuildArch: noarch
%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. This package probably shouldn't be installed on
@ -38,6 +38,17 @@ install -p -m 0644 %{SOURCE0} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm
install -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm install -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm
# this is why this package is now arch-dependent:
# turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64
cat >> ${RPM_BUILD_ROOT}/%{_prefix}%{_sysconfdir}/rpm/macros.ghc <<EOF
# shared libraries are only supported on main intel archs
%%global ghc_without_dynamic 1
%%global ghc_without_shared 1
EOF
%endif
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -47,6 +58,17 @@ install -p %{SOURCE3} ${RPM_BUILD_ROOT}/%{_prefix}/lib/rpm
%changelog %changelog
* Sun Feb 13 2011 Jens Petersen <petersen@redhat.com> - 0.11.10-1
- this package is now arch-dependent
- rename without_shared to ghc_without_shared and without_dynamic
to ghc_without_dynamic so that they can be globally defined for
secondary archs without shared libs
- use %%undefined macro
- disable debug_package in ghc_bin_build and ghc_lib_build
- set ghc_without_shared and ghc_without_dynamic on secondary
(ie non main intel archs)
- disable debuginfo for self
* Fri Feb 11 2011 Jens Petersen <petersen@redhat.com> - 0.11.9-1 * Fri Feb 11 2011 Jens Petersen <petersen@redhat.com> - 0.11.9-1
- revert "set without_shared and without_dynamic by default on secondary archs - revert "set without_shared and without_dynamic by default on secondary archs
in cabal_bin_build and cabal_lib_build" change, since happening for all archs in cabal_bin_build and cabal_lib_build" change, since happening for all archs

Loading…
Cancel
Save