Skip to content

Commit

Permalink
main/mandoc: new package (1.14.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
q66 committed Oct 30, 2021
1 parent 3c0e66a commit 07031b9
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/mandoc/mandoc.trigger
@@ -0,0 +1,4 @@
#!/bin/sh

echo "Regenerating man db..."
/usr/bin/makewhatis -Tutf8
30 changes: 30 additions & 0 deletions main/mandoc/patches/cross.patch
@@ -0,0 +1,30 @@
--- a/configure
+++ b/configure
@@ -176,15 +176,6 @@
if ${COMP} -o "test-${1}" "${SOURCEDIR}/test-${1}.c" ${3} 1>&3 2>&3
then
echo "partial result of ${n}: ${CC} succeeded" 1>&3
- else
- echo "tested ${n}: no (compilation failed)" 1>&2
- echo "result of ${n}: ${CC} failed with exit status $?" 1>&3
- echo "result of compiling ${n}: no" 1>&3
- echo 1>&3
- return 1
- fi
-
- if ./test-${1} 1>&3 2>&3; then
echo "tested ${n}: yes" 1>&2
echo "result of running ${n}: yes" 1>&3
echo 1>&3
@@ -199,10 +190,9 @@
return 0
else
echo "tested ${n}: no (execution failed)" 1>&2
- echo "result of ${n}: execution failed with exit status $?" 1>&3
+ echo "result of ${n}: ${CC} failed with exit status $?" 1>&3
echo "result of running ${n}: no" 1>&3
echo 1>&3
- rm "test-${1}"
return 1
fi
}
45 changes: 45 additions & 0 deletions main/mandoc/template.py
@@ -0,0 +1,45 @@
pkgname = "mandoc"
pkgver = "1.14.6"
pkgrel = 0
build_style = "configure"
make_cmd = "gmake"
make_check_target = "regress"
hostmakedepends = ["gmake"]
makedepends = ["less", "zlib-devel"]
checkdepends = ["perl"]
depends = ["less"]
triggers = ["/usr/share/man"]
pkgdesc = "UNIX manpage compiler toolset"
maintainer = "q66 <q66@chimera-linux.org>"
license = "ISC"
url = "http://mandoc.bsd.lv"
source = f"{url}/snapshots/{pkgname}-{pkgver}.tar.gz"
sha256 = "8bf0d570f01e70a6e124884088870cbed7537f36328d512909eb10cd53179d9c"

def pre_configure(self):
with open(self.cwd / "configure.local", "w") as cf:
cf.write(f"""
PREFIX=/usr
SBINDIR=/usr/bin
MANDIR=/usr/share/man
OSNAME="Chimera Linux"
CFLAGS="{self.get_cflags(shell = True)}"
LDFLAGS="{self.get_ldflags(shell = True)}"
CC="{self.get_tool("CC")}"
HAVE_REWB_BSD=0
UTF8_LOCALE=C.UTF-8
""")

def post_install(self):
self.install_license("LICENSE")

self.install_dir("etc")
# from void
with open(self.destdir / "etc/man.conf", "w") as conf:
conf.write("""# man(1)/apropos(1)/makewhatis(8) configuration, see man.conf(5).
# Default search path for manual pages.
# Add, delete, or reorder as desired.
manpath /usr/local/share/man
manpath /usr/share/man
""")

0 comments on commit 07031b9

Please sign in to comment.