use subpkgver and pkgver macros

This commit is contained in:
Jens Petersen 2016-09-01 19:48:17 +09:00
parent 66f1a244dc
commit 847a4665f4

View File

@ -1,8 +1,9 @@
# generated by cabal-rpm-0.10.0
# generated by cabal-rpm-0.10.1
# https://fedoraproject.org/wiki/Packaging:Haskell
%global pkg_name snap-core
%global time_locale_compat_version 0.1.1.3
%global pkgver %{pkg_name}-%{version}
%global subpkgver time-locale-compat-0.1.1.3
Name: ghc-%{pkg_name}
Version: 0.9.8.0
@ -11,11 +12,11 @@ Summary: Snap web framework core library
License: BSD
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
Source1: http://hackage.haskell.org/package/time-compat-%{time_locale_compat_version}/time-locale-compat-%{time_locale_compat_version}.tar.gz
Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
Source1: http://hackage.haskell.org/package/%{subpkgver}/%{subpkgver}.tar.gz
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros-extra >= 1.6.4
BuildRequires: ghc-rpm-macros-extra >= 1.6.7
# Begin cabal-rpm deps:
BuildRequires: ghc-HUnit-devel
BuildRequires: ghc-MonadCatchIO-transformers-devel
@ -50,15 +51,6 @@ in Haskell. This library contains the core definitions and types for
the Snap framework.
%global snap_core_version %{version}
%if %{defined ghclibdir}
%ghc_lib_subpackage time-locale-compat %{time_locale_compat_version}
%endif
%global version %{snap_core_version}
%package devel
Summary: Haskell %{pkg_name} library development files
Provides: %{name}-static = %{version}-%{release}
@ -71,6 +63,15 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
This package provides the Haskell %{pkg_name} library development files.
%global main_version %{version}
%if %{defined ghclibdir}
%ghc_lib_subpackage %{subpkgver}
%endif
%global version %{main_version}
%prep
%setup -q -c -n %{pkg_name}-%{version} -a1
cd %{pkg_name}-%{version}
@ -78,12 +79,11 @@ cd %{pkg_name}-%{version}
%build
%ghc_libs_build time-locale-compat-%{time_locale_compat_version} %{pkg_name}-%{version}
%ghc_libs_build %{subpkgver} %{pkgver}
%install
%ghc_libs_install time-locale-compat-%{time_locale_compat_version} %{pkg_name}-%{version}
%ghc_libs_install %{subpkgver} %{pkgver}
%post devel
@ -98,7 +98,7 @@ cd %{pkg_name}-%{version}
%files devel -f %{name}-devel.files
%doc %{pkg_name}-%{version}/README.SNAP.md %{pkg_name}-%{version}/README.md
%doc %{pkgver}/README.SNAP.md %{pkgver}/README.md
%changelog