drop static and common subpackages

This commit is contained in:
Jens Petersen 2017-01-21 11:48:12 +09:00
parent 7c7b7a4538
commit 7a27989563
1 changed files with 7 additions and 98 deletions

View File

@ -2,12 +2,11 @@
# failing (also in stackage)
%bcond_with tests
%bcond_without static
Name: happy
# part of haskell-platform
Version: 1.19.5
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Parser Generator for Haskell
License: BSD
@ -29,11 +28,9 @@ BuildRequires: docbook-dtds
BuildRequires: docbook-style-xsl
BuildRequires: libxml2
BuildRequires: libxslt
%if %{with static}
Requires: %{name}-common = %{version}-%{release}
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
%endif
# added for F26
Obsoletes: %{name}-common < %{version}-%{release}
Obsoletes: %{name}-static < %{version}-%{release}
%description
Happy is a LALR(1) parser generator system for Haskell, similar to the tool
@ -47,36 +44,11 @@ in conjunction with a lexical analyser supplied by the user (either
hand-written or generated by another program).
%if %{with static}
%package common
Summary: Common files for %{name}
%description common
This provides the common files for %{name}.
%package static
Summary: Static Haskell build
Requires: %{name}-common = %{version}-%{release}
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
%description static
This provides a build with Haskell libraries statically linked.
%endif
%prep
%setup -q
%build
%if %{with static}
%define ghc_without_dynamic 1
%ghc_bin_build
mv dist/build/%{name}/%{name}{,.static}
%undefine ghc_without_dynamic
%endif
%ghc_bin_build
cd doc
@ -88,86 +60,23 @@ cd ..
%install
%ghc_bin_install
%if %{with static}
mv %{buildroot}%{_bindir}/%{name}{,.dynamic}
install dist/build/%{name}/%{name}.static %{buildroot}%{_bindir}
touch %{buildroot}%{_bindir}/%{name}
mv %{buildroot}%{_defaultlicensedir}/%{name}{,-common}
%endif
%check
%cabal_test
%if %{with static}
# avoid rpm ghost keeping pre-alternatives binary around
%pre
if [ $1 -gt 1 ] ; then
if [ -f %{_bindir}/%{name} -a ! -L %{_bindir}/%{name} ]; then
rm %{_bindir}/%{name}
fi
fi
%post
%{_sbindir}/update-alternatives --install %{_bindir}/%{name} \
%{name} %{_bindir}/%{name}.dynamic 70
%postun
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove %{name} %{_bindir}/%{name}.dynamic
fi
# avoid rpm ghost keeping pre-alternatives binary around
%pre static
if [ $1 -gt 1 ] ; then
if [ -f %{_bindir}/%{name} -a ! -L %{_bindir}/%{name} ]; then
rm %{_bindir}/%{name}
fi
fi
%post static
%{_sbindir}/update-alternatives --install %{_bindir}/%{name} \
%{name} %{_bindir}/%{name}.static 30
%postun static
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove %{name} %{_bindir}/%{name}.static
fi
%endif
%files
%if %{with static}
%ghost %{_bindir}/%{name}
%{_bindir}/%{name}.dynamic
%else
%license LICENSE
%doc ANNOUNCE CHANGES README TODO doc/happy
%{_bindir}/%{name}
%{_datadir}/%{name}-%{version}
%endif
%if %{with static}
%files common
%license LICENSE
%doc ANNOUNCE CHANGES README TODO doc/happy
%{_datadir}/%{name}-%{version}
%files static
%ghost %{_bindir}/%{name}
%{_bindir}/%{name}.static
%endif
%changelog
* Sat Jan 21 2017 Jens Petersen <petersen@redhat.com> - 1.19.5-6
- drop static and common subpackages
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild