simplify subpackage building to more other packages

This commit is contained in:
Jens Petersen 2017-02-10 18:07:28 +09:00
parent 33b9b49d5c
commit f443df0b3b

View File

@ -1,5 +1,7 @@
# https://fedoraproject.org/wiki/Packaging:Haskell
%global pkg_name haskell-platform
%global upstream_version 7.10.3
%global ghc_compiler_version %{upstream_version}
@ -54,13 +56,13 @@ Version: 2016.%{upstream_version}
# - release can only be reset if all library versions get bumped simultaneously
# (eg for a major release)
# - minor release numbers should be incremented monotonically
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Standard Haskell distribution
Group: Development/Tools
License: BSD
URL: http://www.haskell.org/platform/
Source0: http://www.haskell.org/platform/download/%{version}/%{name}-%{upstream_version}.tar.gz
Source0: http://www.haskell.org/platform/download/%{upstream_version}/%{name}-%{upstream_version}.tar.gz
Patch1: haskell-platform-build-tools-cabal-install.patch
Patch2: haskell-platform-7.10.3-version.patch
Patch3: haskell-platform-armv7-disable-GL.patch
@ -203,18 +205,13 @@ This provides the haskell-platform meta library package.
%prep
%setup -q -c -n %{name}-%{version}
cd %{name}-%{upstream_version}
%setup -q -n %{name}-%{upstream_version}
%patch1 -p1 -b .orig
%patch2 -p1
%ifarch armv7hl
%patch3 -p1
%endif
# hack for h-p.cabal in top dir
mkdir packages/%{name}-%{version}
cp LICENSE hptool/Setup.hs packages/%{name}-%{version}
cabal-tweak-dep-ver alex '==3.1.4' '==%{alex_version}'
cabal-tweak-dep-ver async '==2.0.2' '==%{async_version}'
cabal-tweak-dep-ver attoparsec '==0.13.0.1' '==%{attoparsec_version}'
@ -233,40 +230,45 @@ cabal-tweak-dep-ver split '==0.2.2' '==%{split_version}'
cabal-tweak-dep-ver text '==1.2.1.3' '==%{text_version}'
cabal-tweak-dep-ver unordered-containers '==0.2.5.1' '==%{unordered_containers_version}'
cabal-tweak-dep-ver zlib '==0.5.4.2' '==%{zlib_version}'
mv %{name}.cabal packages/%{name}-%{version}
mv packages/* ..
mv packages/* .
ln -s hptool/Setup.hs .
%build
%ghc_libs_build $(egrep \-v "^(%{?separate_packages})-[0-9]" %{name}-%{upstream_version}/etc/build.packages) %{name}-%{version}
%ghc_libs_build $(egrep \-v "^(%{?separate_packages})-[0-9]" etc/build.packages)
%ghc_lib_build
%install
%ghc_libs_install $(egrep \-v "^(%{?separate_packages})-[0-9]" %{name}-%{upstream_version}/etc/build.packages) %{name}-%{version}
mv %{buildroot}%{_datadir}/licenses/ghc-haskell-platform{,-devel}
%ghc_libs_install $(egrep \-v "^(%{?separate_packages})-[0-9]" etc/build.packages)
%ghc_lib_install
mv %{buildroot}%{_datadir}/licenses/{%{name},ghc-%{name}-devel}
%ghc_strip_dynlinked
%post -n ghc-haskell-platform-devel
%post -n ghc-%{name}-devel
%ghc_pkg_recache
%postun -n ghc-haskell-platform-devel
%postun -n ghc-%{name}-devel
%ghc_pkg_recache
%files
%license %{name}-%{version}/LICENSE
%files -n ghc-haskell-platform-devel -f ghc-haskell-platform-devel.files
%license %{name}-%{version}/LICENSE
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%license LICENSE
%doc README
%changelog
* Fri Feb 10 2017 Jens Petersen <petersen@redhat.com> - 2016.7.10.3-4
- subpackage build like for other packages
* Wed Sep 28 2016 Jens Petersen <petersen@redhat.com> - 2016.7.10.3-3
- rebuild