import scdoc-1.10.0 to convert scdoc text files to man(7) pages;

based on work of Raymond E. Pasco <ray at ameretat dot dev> and abieber@
using feedback from <trondd at kagu-tsuchi dot com> and sthen@;
OK sthen@
This commit is contained in:
schwarze 2020-01-25 16:44:51 +00:00
parent f644d0b5ee
commit e55fbd58f5
6 changed files with 101 additions and 0 deletions

29
textproc/scdoc/Makefile Normal file
View File

@ -0,0 +1,29 @@
# $OpenBSD: Makefile,v 1.1.1.1 2020/01/25 16:44:51 schwarze Exp $
COMMENT = convert scdoc text files to man(7) pages
VERSION = 1.10.0
DISTNAME = scdoc-${VERSION}
CATEGORIES = textproc
HOMEPAGE = https://git.sr.ht/~sircmpwn/scdoc
# MIT
PERMIT_PACKAGE = Yes
MASTER_SITES = https://git.sr.ht/~sircmpwn/scdoc/
DISTFILES = scdoc-{archive/}${VERSION}${EXTRACT_SUFX}
WANTLIB = c
USE_GMAKE = Yes
MAKE_FLAGS = CC="${CC}"
FAKE_FLAGS = DESTDIR=${WRKINST}\
PREFIX=${PREFIX}\
MANDIR=${DESTDIR}${PREFIX}/man
TEST_TARGET = check
# will attempt to run the unpatched tests if they are not rm'd
pre-test:
rm ${WRKSRC}/test/*.orig
.include <bsd.port.mk>

2
textproc/scdoc/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (scdoc-1.10.0.tar.gz) = NILgi5lMxKUoyvPSDdcO/aLS7IazD2avdaHRkv7laFI=
SIZE (scdoc-1.10.0.tar.gz) = 12414

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2020/01/25 16:44:51 schwarze Exp $
In OpenBSD, we do not compile programs statically when it isn't necessary.
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -1,6 +1,5 @@
VERSION=1.10.0
CFLAGS+=-g -DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter
-LDFLAGS+=-static
INCLUDE+=-Iinclude
PREFIX?=/usr/local
_INSTDIR=$(DESTDIR)$(PREFIX)

View File

@ -0,0 +1,49 @@
$OpenBSD: patch-test_preamble,v 1.1.1.1 2020/01/25 16:44:51 schwarze Exp $
Index: test/preamble
--- test/preamble.orig
+++ test/preamble
@@ -41,37 +41,36 @@ end 0
unset SOURCE_DATE_EPOCH
begin "Writes the appropriate header"
-scdoc <<EOF | grep '^\.TH "test" "8" "'"$(date +'%F')"'"' >/dev/null
+scdoc <<EOF | grep '^\.TH "test" "8" "'"$(date -u +'%F')"'"' >/dev/null
test(8)
EOF
end 0
begin "Preserves dashes"
-scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date +'%F')"'"' >/dev/null
+scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date -u +'%F')"'"' >/dev/null
test-manual(8)
EOF
end 0
begin "Handles extra footer field"
-scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date +'%F')"'" "Footer"' >/dev/null
+scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date -u +'%F')"'" "Footer"' >/dev/null
test-manual(8) "Footer"
EOF
end 0
begin "Handles both extra fields"
-scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date +'%F')"'" "Footer" "Header"' >/dev/null
+scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date -u +'%F')"'" "Footer" "Header"' >/dev/null
test-manual(8) "Footer" "Header"
EOF
end 0
begin "Emits empty footer correctly"
-scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date +'%F')"'" "" "Header"' >/dev/null
+scdoc <<EOF | grep '^\.TH "test-manual" "8" "'"$(date -u +'%F')"'" "" "Header"' >/dev/null
test-manual(8) "" "Header"
EOF
end 0
-export TZ=UTC
-export SOURCE_DATE_EPOCH=$(date --date="2017-12-09 23:18:57" +'%s')
+export SOURCE_DATE_EPOCH=1512861537
begin "Supports \$SOURCE_DATE_EPOCH"
scdoc <<EOF | grep '^\.TH "reproducible-manual" "8" "2017-12-09"' >/dev/null

2
textproc/scdoc/pkg/DESCR Normal file
View File

@ -0,0 +1,2 @@
The scdoc(1) program reads scdoc(5) text files and converts them
to man(7) pages. It is written in C99.

5
textproc/scdoc/pkg/PLIST Normal file
View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2020/01/25 16:44:51 schwarze Exp $
@bin bin/scdoc
lib/pkgconfig/scdoc.pc
@man man/man1/scdoc.1
@man man/man5/scdoc.5