diff --git a/pkgs/mandoc/build.sh b/pkgs/mandoc/build.sh new file mode 100644 index 0000000..160bf79 --- /dev/null +++ b/pkgs/mandoc/build.sh @@ -0,0 +1,35 @@ +pkgname=mandoc +pkgver=1.14.5 + +fetch() { + curl "https://mandoc.bsd.lv/snapshots/mandoc-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz + tar -xf $pkgname-$pkgver.tar.gz + cp ../configure.local . + cp ../term-size.patch . + cp ../man.sh . + cd $pkgname-$pkgver + cp ../configure.local . + patch -p1 < ../term-size.patch +} + +build() { + cd $pkgname-$pkgver + ./configure \ + --prefix=/usr \ + --build=x86_64-unknown-linux-musl \ + --host=x86_64-unknown-linux-musl + + make +} + +package() { + install -Dm644 ./man.sh $pkgdir/etc/profile.d/man.sh + cd $pkgname-$pkgver + make install DESTDIR=$pkgdir +} + +license() { + cd $pkgname-$pkgver + cat LICENSE +# cat COPYING +} diff --git a/pkgs/mandoc/configure.local b/pkgs/mandoc/configure.local new file mode 100644 index 0000000..911a5ed --- /dev/null +++ b/pkgs/mandoc/configure.local @@ -0,0 +1,10 @@ +PREFIX=/usr +MANDIR=/usr/share/man +LIBDIR=/usr/lib +UTF8_LOCALE="en_US.UTF-8" +MANPATH_DEFAULT="/usr/share/man" +MANPATH_BASE="/usr/share/man" +LN="ln -sf" +HAVE_LESS_T=0 +LDFLAGS=-Wl,--allow-multiple-definition +BUILD_TARGETS= diff --git a/pkgs/mandoc/man.sh b/pkgs/mandoc/man.sh new file mode 100644 index 0000000..05954b0 --- /dev/null +++ b/pkgs/mandoc/man.sh @@ -0,0 +1,8 @@ +export LESS_TERMCAP_md=$'\e[01;34m' \ +export LESS_TERMCAP_me=$'\e[0m' \ +export LESS_TERMCAP_se=$'\e[0m' \ +export LESS_TERMCAP_so=$'\e[01;44;35m' \ +export LESS_TERMCAP_ue=$'\e[0m' \ +export LESS_TERMCAP_us=$'\e[01;33m' \ + +export MANPAGER="less -r" diff --git a/pkgs/mandoc/term-size.patch b/pkgs/mandoc/term-size.patch new file mode 100644 index 0000000..eb28fde --- /dev/null +++ b/pkgs/mandoc/term-size.patch @@ -0,0 +1,11 @@ +--- a/main.c ++++ b/main.c +@@ -321,7 +321,7 @@ + (conf.output.width == 0 || conf.output.indent == 0) && + ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) != -1 && + ws.ws_col > 1) { +- if (conf.output.width == 0 && ws.ws_col < 79) ++ if (conf.output.width == 0) + conf.output.width = ws.ws_col - 1; + if (conf.output.indent == 0 && ws.ws_col < 66) + conf.output.indent = 3;