introduce %pkgver and tweak %doc paths

This commit is contained in:
Jens Petersen 2016-09-01 15:18:24 +09:00
parent f428f6644b
commit 1fc5006a91

View File

@ -2,6 +2,7 @@
# https://fedoraproject.org/wiki/Packaging:Haskell # https://fedoraproject.org/wiki/Packaging:Haskell
%global pkg_name yaml %global pkg_name yaml
%global pkgver %{pkg_name}-%{version}
%global subpkgver enclosed-exceptions-1.0.2 %global subpkgver enclosed-exceptions-1.0.2
%bcond_with tests %bcond_with tests
@ -13,7 +14,7 @@ Summary: Support for parsing and rendering YAML documents
License: BSD License: BSD
Url: https://hackage.haskell.org/package/%{pkg_name} Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
Source1: http://hackage.haskell.org/package/%{subpkgver}/%{subpkgver}.tar.gz Source1: http://hackage.haskell.org/package/%{subpkgver}/%{subpkgver}.tar.gz
BuildRequires: ghc-Cabal-devel BuildRequires: ghc-Cabal-devel
@ -79,19 +80,19 @@ This package provides the Haskell %{pkg_name} library development files.
%prep %prep
%setup -q -c -n %{pkg_name}-%{version} -a1 %setup -q -c -n %{pkgver} -a1
cd %{pkg_name}-%{version} cd %{pkgver}
cabal-tweak-flag system-libyaml True cabal-tweak-flag system-libyaml True
# remove the bundled lib # remove the bundled lib
rm -r libyaml rm -r libyaml
%build %build
%ghc_libs_build %{subpkgver} %{pkg_name}-%{version} %ghc_libs_build %{subpkgver} %{pkgver}
%install %install
%ghc_libs_install %{subpkgver} %{pkg_name}-%{version} %ghc_libs_install %{subpkgver} %{pkgver}
%ghc_fix_dynamic_rpath json2yaml yaml2json %ghc_fix_dynamic_rpath json2yaml yaml2json
@ -112,7 +113,7 @@ rm -r libyaml
%files devel -f %{name}-devel.files %files devel -f %{name}-devel.files
%doc ChangeLog.md README.md examples %doc %{pkgver}/ChangeLog.md %{pkgver}/README.md %{pkgver}/examples
%{_bindir}/json2yaml %{_bindir}/json2yaml
%{_bindir}/yaml2json %{_bindir}/yaml2json