aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-12-29 10:47:41 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-12-29 10:49:21 +0000
commit6b731eecdf600d8d435d129bf2838e3babb77c56 (patch)
treedcf4a44b2cbaea71eb24f431ddf58c1f8621e800
parent1ec859a34c5dd7879bc169f2ff169b3793822bb5 (diff)
downloadaports-6b731eecdf600d8d435d129bf2838e3babb77c56.tar.bz2
main/mdocml: build shared, add 'man' and trigger for db
-rw-r--r--main/mdocml/APKBUILD50
-rw-r--r--main/mdocml/man.conf55
-rw-r--r--main/mdocml/man.sh57
-rw-r--r--main/mdocml/mdocml.post-deinstall3
-rw-r--r--main/mdocml/mdocml.trigger4
-rw-r--r--main/mdocml/shared-libmandoc.patch65
6 files changed, 157 insertions, 77 deletions
diff --git a/main/mdocml/APKBUILD b/main/mdocml/APKBUILD
index 4ddc9c2..a221a8b 100644
--- a/main/mdocml/APKBUILD
+++ b/main/mdocml/APKBUILD
@@ -1,53 +1,63 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mdocml
pkgver=1.13.2
-pkgrel=0
+pkgrel=1
pkgdesc="mdoc/man compiler"
url="http://mdocml.bsd.lv/"
arch="all"
license="BSD"
depends=
-makedepends=
-install=
+makedepends="sqlite-dev"
+install="$pkgname.post-deinstall"
+triggers="$pkgname.trigger=/usr/share/man/*"
subpackages="$pkgname-doc $pkgname-dev $pkgname-man"
-source="http://mdocml.bsd.lv/snapshots/mdocml-$pkgver.tar.gz man.sh"
+source="http://mdocml.bsd.lv/snapshots/mdocml-$pkgver.tar.gz
+ shared-libmandoc.patch
+ man.conf
+ "
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
- ./configure || return 1
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ cat >configure.local<<EOF
+PREFIX=/usr
+MANDIR=/usr/share/man
+LIBDIR=/usr/lib
+CFLAGS="$CFLAGS"
+EOF
}
build() {
cd "$_builddir"
+ ./configure || return 1
make || return 1
}
package() {
cd "$_builddir"
- make \
- DESTDIR="$pkgdir" \
- PREFIX=/usr \
- MANDIR=/usr/share/man \
- BINDIR=/usr/bin \
- SBINDIR=/usr/sbin \
- LIBDIR=/usr/lib \
- INCLUDEDIR=/usr/include \
- EXAMPLEDIR=/usr/share/doc/mdocml/examples \
- base-install
+ make -j1 DESTDIR="$pkgdir" base-install db-install || return 1
+ install -Dm644 "$srcdir"/man.conf "$pkgdir"/etc/man.conf || return 1
}
man() {
arch="noarch"
- cd "$srcdir"
+ pkgdesc="dummy package for upgrade compatibility. This can safely be rebmoved"
depends="mdocml"
- install -Dm 755 man.sh "$subpkgdir"/usr/bin/man || return 1
+ mkdir -p "$subpkgdir"
}
md5sums="831ba06ef06bccdf35346fc3310263a5 mdocml-1.13.2.tar.gz
-cc5c665dc509243963f1b3a60f655b7f man.sh"
+d249cec65ed75006ca610b9c8b01ba66 shared-libmandoc.patch
+6e893bef0cf680eec807b230e6619d27 man.conf"
sha256sums="9074755da96e8afbf9634d7ffa29c1decda2f642e13d9d844f26cd1e06d9716b mdocml-1.13.2.tar.gz
-03039dd8c79cf054200cfe328924078ecc103f87be94ecabf7f7e5ad9e3c48eb man.sh"
+9f5a864d993e3f061161756017fcfb9906f68223298ebe7b44f1168beed85d79 shared-libmandoc.patch
+3381c6ceb99e7db1404fdb44419040c3b441a251d594292e53545b5e4e378e2b man.conf"
sha512sums="7db73ff83be9acff50e8570de96591869c950dad8b350d119e57fcf39937a3272cf9d70397af2e21ec69877c5f81bc1c4e027910a4aef1033ff54b744904412c mdocml-1.13.2.tar.gz
-2d6bcde740d613ab225c2e35e53d6057bdc367ef85c75ccb99df587f51484e87c5fd958298be9d770241014eec4a2bd7be8084f00815fd64a999cb7752bdfb3f man.sh"
+fd69542e4f853827637a28f84e845aea447d63bcad51c9b45abb63ee1233a9c3a143a85016c75a9d596a2da5212460efad765ba8dd52de86e4aa1693da6617d5 shared-libmandoc.patch
+0723c32ab70e5b1c77768ca78d7437b26bed19b90b27876b10cc463359c41332befc0105fc1e23ceae48de5a892f1aa7ac60ef7eb0b6b8f1616726c4300632fe man.conf"
diff --git a/main/mdocml/man.conf b/main/mdocml/man.conf
new file mode 100644
index 0000000..e96bb2f
--- /dev/null
+++ b/main/mdocml/man.conf
@@ -0,0 +1,55 @@
+# $OpenBSD: man.conf,v 1.20 2014/02/24 20:11:53 espie Exp $
+
+# Sheer, raging paranoia...
+_version BSD.2
+
+# The whatis/apropos database.
+_whatdb /usr/share/man/mandoc.db
+_whatdb /usr/local/share/man/mandoc.db
+
+# Subdirectories for paths ending in '/', IN SEARCH ORDER.
+_subdir {cat,man}0p {cat,man}1 {cat,man}1p {cat,man}8 {cat,man}6 {cat,man}2 {cat,man}3 {cat,man}5 {cat,man}7 {cat,man}4 {cat,man}9 {cat,man}3p {cat,man}3f {cat,man}n
+
+# Files typed by suffix and their commands.
+_suffix .0
+_build .0.gz /usr/bin/zcat %s
+_build .[0-9n] /usr/bin/mandoc -Tutf8 %s
+_build .[0-9n].gz /usr/bin/zcat %s | /usr/bin/mandoc -Tutf8
+_build .[0-9][a-z] /usr/bin/mandoc -Tutf8 %s
+_build .[0-9][a-z].gz /usr/bin/zcat %s | /usr/bin/mandoc -Tutf8
+_build .[0-9][a-z][a-z] /usr/bin/mandoc -Tutf8 %s
+_build .[0-9][a-z][a-z].gz /usr/bin/zcat %s | /usr/bin/mandoc -Tutf8
+_build .[0-9][a-z][a-z][a-z] /usr/bin/mandoc -Tutf8 %s
+_build .[0-9][a-z][a-z][a-z].gz /usr/bin/zcat %s | /usr/bin/mandoc -Tutf8
+_build .tbl /usr/bin/mandoc -Tutf8 %s
+_build .tbl.gz /usr/bin/zcat %s | /usr/bin/mandoc -Tutf8
+
+# Sections and their directories.
+# All paths ending in '/' are the equivalent of entries specifying that
+# directory with all of the subdirectories listed for the keyword _subdir.
+
+# default
+_default /usr/{share,local/share}/man/
+
+# Other sections that represent complete man subdirectories.
+local /usr/local/share/man/
+
+# Specific section/directory combinations.
+0p /usr/{share,local/share}/man/{cat,man}0p
+1 /usr/{share,local/share}/man/{cat,man}1
+1p /usr/{share,local/share}/man/{cat,man}1p
+2 /usr/{share,local/share}/man/{cat,man}2
+3 /usr/{share,local/share}/man/{cat,man}3
+3F /usr/{share,local/share}/man/{cat,man}3f
+3f /usr/{share,local/share}/man/{cat,man}3f
+3P /usr/{share,local/share}/man/{cat,man}3p
+3p /usr/{share,local/share}/man/{cat,man}3p
+3x /usr/{share,local/share}/man/{cat,man}3
+3am /usr/{share,local/share}/man/{cat,man}3
+4 /usr/{share,local/share}/man/{cat,man}4
+5 /usr/{share,local/share}/man/{cat,man}5
+6 /usr/{share,local/share}/man/{cat,man}6
+7 /usr/{share,local/share}/man/{cat,man}7
+8 /usr/{share,local/share}/man/{cat,man}8
+9 /usr/{share,local/share}/man/{cat,man}9
+n /usr/{share,local/share}/man/{cat,man}n
diff --git a/main/mdocml/man.sh b/main/mdocml/man.sh
deleted file mode 100644
index 136cdd2..0000000
--- a/main/mdocml/man.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-
-# man - a simple man program for ASCII pages
-# Copyright (c) 2008 Matthew Hiles
-#
-# Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
-
-## requires: find, head, sort, tr, cat, and grep/egrep
-## optional: zcat, bzcat, less
-
-if [ -z "$MANPATH" ]; then
- echo "Warning: MANPATH is not set, assuming /usr/share/man." >&2
- MANPATH=/usr/share/man
-fi
-
-case $# in
-1)
- pagearg=$1 ;;
-2)
- section=man$1
- pagearg=$2 ;;
-*)
- echo "Usage: man [section] <manpage>"
- exit
-esac
-
-paths=`echo "$MANPATH" | tr ":" " "`
-pagefile=`find $paths | grep "/$section" | grep "/$pagearg\." | sort | head -n1`
-
-if [ -z "$pagefile" ]; then
- echo -n No manual entry for $pagearg
- [ $section ] && echo -n " in section $1 of the manual."
- echo
- exit
-fi
-
-[ "$PAGER" ] || PAGER=less
-tty -s <&1 || PAGER=cat
-
-MANWIDTH=${MANWIDTH:-78}
-if [ $MANWIDTH = 0 ]; then
- MANWIDTH=$(($(stty size | awk '{print $2}') - 2))
-fi
-
-case "$pagefile" in
-*.bz2)
- exec bzcat "$pagefile" | mandoc -Tutf8 -Owidth=$MANWIDTH | "$PAGER" ;;
-*.gz)
- exec zcat "$pagefile" | mandoc -Tutf8 -Owidth=$MANWIDTH | "$PAGER" ;;
-*)
- exec mandoc -Tutf8 -Owidth=$MANWIDTH "$pagefile" | "$PAGER" ;;
-esac
-
-paths=
-pagefile=
-pagearg=
-section=
diff --git a/main/mdocml/mdocml.post-deinstall b/main/mdocml/mdocml.post-deinstall
new file mode 100644
index 0000000..77b2574
--- /dev/null
+++ b/main/mdocml/mdocml.post-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec rm -f /usr/share/man/mandoc.db
diff --git a/main/mdocml/mdocml.trigger b/main/mdocml/mdocml.trigger
new file mode 100644
index 0000000..0f64443
--- /dev/null
+++ b/main/mdocml/mdocml.trigger
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+rm -f /usr/share/man/mandoc.db
+exec /usr/sbin/makewhatis -a /usr/share/man
diff --git a/main/mdocml/shared-libmandoc.patch b/main/mdocml/shared-libmandoc.patch
new file mode 100644
index 0000000..9763c6d
--- /dev/null
+++ b/main/mdocml/shared-libmandoc.patch
@@ -0,0 +1,65 @@
+--- ./Makefile.orig
++++ ./Makefile
+@@ -262,9 +262,15 @@
+ WWW_OBJS = mdocml.tar.gz \
+ mdocml.sha256
+
++#LIBMANDOC = libmandoc.a
++#MANDICLIB = $(LIBMANDOC)
++LIBMANDOC = libmandoc.so
++MANDOCLIB = -L. -lmandoc
++
+ # === USER CONFIGURATION ===============================================
+
+ include Makefile.local
++CFLAGS += -fPIC
+
+ # === DEPENDENCY HANDLING ==============================================
+
+@@ -291,7 +297,7 @@
+ rm -f Makefile.local config.h config.h.old config.log config.log.old
+
+ clean:
+- rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
++ rm -f $(LIBMANDOC) $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
+ rm -f mandoc $(BASE_OBJS) $(DB_OBJS)
+ rm -f man.cgi $(CGI_OBJS)
+ rm -f manpage $(MANPAGE_OBJS)
+@@ -308,7 +314,7 @@
+ mkdir -p $(DESTDIR)$(MANDIR)/man3
+ mkdir -p $(DESTDIR)$(MANDIR)/man7
+ $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR)
+- $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
++ $(INSTALL_LIB) $(LIBMANDOC) $(DESTDIR)$(LIBDIR)
+ $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \
+ $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
+@@ -361,17 +367,20 @@
+ libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
+ $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
+
+-mandoc: $(MAIN_OBJS) libmandoc.a
+- $(CC) $(LDFLAGS) -o $@ $(MAIN_OBJS) libmandoc.a $(DBLIB)
++libmandoc.so: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
++ $(CC) $(LDFLAGS) -shared -o $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
+
+-manpage: $(MANPAGE_OBJS) libmandoc.a
+- $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB)
++mandoc: $(MAIN_OBJS) $(LIBMANDOC)
++ $(CC) $(LDFLAGS) -o $@ $(MAIN_OBJS) $(MANDOCLIB) $(DBLIB)
+
+-man.cgi: $(CGI_OBJS) libmandoc.a
+- $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB)
++manpage: $(MANPAGE_OBJS) $(LIBMANDOC)
++ $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) $(MANDOCLIB) $(DBLIB)
+
+-demandoc: $(DEMANDOC_OBJS) libmandoc.a
+- $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
++man.cgi: $(CGI_OBJS) $(LIBMANDOC)
++ $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) $(MANDOCLIB) $(DBLIB)
++
++demandoc: $(DEMANDOC_OBJS) $(LIBMANDOC)
++ $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) $(MANDOCLIB)
+
+ # --- maintainer targets ---
+