File cabal-rpm.spec of Package cabal-rpm

#
# spec file for package cabal-rpm
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           cabal-rpm
Version:        0.9.7
Release:        0
Summary:        RPM packaging tool for Haskell Cabal-based packages
License:        GPL-3.0+
Group:          Development/Tools/Other
Url:            https://hackage.haskell.org/package/%{name}
Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
Source2:        cabal-rpm.1
# PATCH-FIX-UPSTREAM fix-macro-license.patch mimi.vx@gmail.com SUSE doesn't support
# %%licence macro from Fedora 21
Patch0:         fix-macro-license.patch
BuildRequires:  ghc-Cabal-devel
# Begin cabal-rpm deps:
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-filepath-devel
BuildRequires:  ghc-process-devel
BuildRequires:  ghc-rpm-macros
BuildRequires:  ghc-time-devel
BuildRequires:  ghc-unix-devel
Recommends:     yum-utils
Recommends:     cabal-install
Recommends:     ghc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# End cabal-rpm deps

%description
This package provides a RPM packaging tool for Haskell Cabal-based packages.

cblrpm has commands to generate a RPM spec file and srpm for a package.
It can rpmbuild packages, yum install their dependencies, prep packages, and
install them. There are commands to list package dependencies and missing
dependencies. The diff command compares the current spec file with a freshly
generated one and the update command updates the spec file to latest version
from Hackage.

%prep
%setup -q
%patch0 -p1

%build
%define cabal_configure_options --flags="-old-locale"
%{ghc_bin_build}

%install
%{ghc_bin_install}

install -p -m 0644 -D man/cblrpm.1 %{buildroot}%{_mandir}/man1/cblrpm.1
install -p -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/

ln -s cblrpm %{buildroot}%{_bindir}/%{name}

%files
%defattr(-,root,root,-)
%doc COPYING ChangeLog README.md
%attr(755,root,root) %{_bindir}/%{name}
%{_bindir}/cblrpm
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/cblrpm.1*

%changelog
openSUSE Build Service is sponsored by