generate manpage and patch build for simple-cmd-0.2

This commit is contained in:
Jens Petersen 2019-09-04 18:35:48 +08:00
parent c187e7c158
commit 1c7c44667e
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,20 @@
--- cabal-rpm-0.13.3/src/PackageUtils.hs~ 2019-05-11 15:22:29.000000000 +0800
+++ cabal-rpm-0.13.3/src/PackageUtils.hs 2019-09-04 18:30:50.875375095 +0800
@@ -42,7 +42,7 @@
import FileUtils (filesWithExtension, fileWithExtension,
getDirectoryContents_, mktempdir, withTempDirectory)
import Options (RpmFlags (..))
-import SimpleCmd (cmd, cmd_, cmdIgnoreErr, cmdLines, grep_, sudo,
+import SimpleCmd (cmd, cmd_, cmdIgnoreErr, cmdLines, grep_, sudo_,
(+-+))
import SimpleCmd.Git (isGitDir, grepGitConfig)
import SysCmd (die, optionalProgram, requireProgram, rpmEval)
@@ -576,7 +576,7 @@
pkginstaller <- packageManager
let (inst, arg) = if pkginstaller == "dnf" then ("dnf", "install") else ("yum", "localinstall")
tty <- hIsTerminalDevice stdout
- sudo inst $ ["-y" | not tty] ++ [arg] ++ rpms
+ sudo_ inst $ ["-y" | not tty] ++ [arg] ++ rpms
editSpecField :: String -> String -> FilePath -> IO ()
editSpecField field new spec =

View File

@ -7,6 +7,8 @@
%bcond_with https
%endif
%bcond_without manpage
Name: cabal-rpm
Version: 0.13.3
Release: 3%{?dist}
@ -18,6 +20,7 @@ Url: https://hackage.haskell.org/package/%{name}
Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
# End cabal-rpm sources
Source1: cblrpm.1
Patch1: cabal-rpm-0.13.3-simple-cmd_sudo.patch
# Begin cabal-rpm deps:
BuildRequires: ghc-rpm-macros
@ -40,6 +43,9 @@ BuildRequires: ghc-simple-cmd-static
BuildRequires: ghc-time-static
BuildRequires: ghc-unix-static
# End cabal-rpm deps
%if %{with manpage}
BuildRequires: pandoc
%endif
Obsoletes: cabal2spec < 0.26
Provides: cblrpm = %{version}-%{release}
Requires: cabal-install
@ -72,12 +78,18 @@ Standalone packages can also be packaged built with cabal-install.
# Begin cabal-rpm setup:
%setup -q
# End cabal-rpm setup
%if 0%{?fedora} >= 31
%patch1 -p1 -b .orig
%endif
%build
# Begin cabal-rpm build:
%ghc_bin_build
# End cabal-rpm build
%if %{with manpage}
pandoc -s -t man man/cabal-rpm.1.md > man/cabal-rpm.1
%endif
%install
@ -85,11 +97,14 @@ Standalone packages can also be packaged built with cabal-install.
%ghc_bin_install
# End cabal-rpm install
%if %{with manpage}
install -p -m 0644 -D man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -p -m 0644 %SOURCE1 %{buildroot}%{_mandir}/man1/
%endif
ln -s %{name} %{buildroot}%{_bindir}/cblrpm
%files
# Begin cabal-rpm files:
%license COPYING
@ -103,7 +118,8 @@ ln -s %{name} %{buildroot}%{_bindir}/cblrpm
%changelog
* Thu Aug 01 2019 Jens Petersen <petersen@redhat.com> - 0.13.3-3
- rebuild
- generate manpage (#1725973)
- fix build with simple-cmd 0.2
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild