Use go-md2man for building manpages

go-md2man is already used by other containers components, and is
therefore available in the RHEL buildroot, where pandoc (due to its
build dependency on the GHC stack) is not.

https://github.com/containers/composefs/pull/227
This commit is contained in:
Yaakov Selkowitz 2023-11-09 15:30:31 -05:00
parent 7029d3d170
commit ce23e6b14c
2 changed files with 62 additions and 3 deletions

54
227.patch Normal file
View File

@ -0,0 +1,54 @@
From 297fdf109a28d0b35a38659ce6a8962c15975a7f Mon Sep 17 00:00:00 2001
From: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Thu, 9 Nov 2023 15:13:12 -0500
Subject: [PATCH] Use go-md2man for building manpages
go-md2man is already used by other containers components, and is
therefore available in the RHEL buildroot, where pandoc (due to its
build dependency on the GHC stack) is not.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
Removed conflicting composefs.spec.in hunk which is not useful here.
Makefile.am | 4 ++--
composefs.spec.in | 2 +-
configure.ac | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 753a5a8..2b456cb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,11 +28,11 @@ if ENABLE_MAN
man/%.1: man/%.md
mkdir -p man
- ${PANDOC} $+ -s -t man > $@
+ ${MD2MAN} -in $^ -out $@
man/%.5: man/%.md
mkdir -p man
- ${PANDOC} $+ -s -t man > $@
+ ${MD2MAN} -in $^ -out $@
man1_MANS = $(MAN1PAGES:.md=.1)
man5_MANS = $(MAN5PAGES:.md=.5)
diff --git a/configure.ac b/configure.ac
index 29f86af..40ea60d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,10 +104,10 @@ AC_ARG_ENABLE(man,
enable_man=maybe)
AS_IF([test "$enable_man" != no], [
- AC_PATH_PROG([PANDOC], [pandoc])
- AS_IF([test -z "$PANDOC"], [
+ AC_PATH_PROG([MD2MAN], [go-md2man])
+ AS_IF([test -z "$MD2MAN"], [
AS_IF([test "$enable_man" = yes], [
- AC_MSG_ERROR([pandoc is required for --enable-man])
+ AC_MSG_ERROR([go-md2man is required for --enable-man])
])
enable_man=no
],[

View File

@ -1,13 +1,16 @@
Name: composefs
Version: 1.0.1
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Tools to handle creating and mounting composefs images
License: GPL-3.0-or-later AND LGPL-2.0-or-later AND Apache-2.0
URL: https://github.com/containers/composefs
Source0: https://github.com/containers/composefs/releases/download/v%{version}/%{name}-%{version}.tar.xz
# Use go-md2man instead of pandoc for building manpages
# https://github.com/containers/composefs/pull/227 (backported)
Patch0: 227.patch
BuildRequires: gcc automake libtool openssl-devel yajl-devel pandoc fuse3-devel
BuildRequires: gcc automake libtool openssl-devel yajl-devel go-md2man fuse3-devel
Requires: %{name}-libs = %{version}-%{release}
%description
@ -34,7 +37,9 @@ License: LGPL-2.1-or-later AND (GPL-2.0-only OR Apache-2.0)
Library files for %{name}.
%prep
%autosetup
%autosetup -p1
# for go-md2man patch
autoreconf -fiv
%build
%configure \