From 5c1ec06944655bd81c71d11e50088c81977c19e4 Mon Sep 17 00:00:00 2001 From: Wesley Shields Date: Tue, 28 Jul 2009 14:50:25 +0000 Subject: - Use realpath(1) instead of GNU readlink. - Depend upon misc/getopt. - Don't hardcode ${LOCALBASE} in new patch. PR: ports/136940 Submitted by: Peter Schuller (maintainer) --- textproc/asciidoc/Makefile | 8 ++++- textproc/asciidoc/files/patch-a2x | 61 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 textproc/asciidoc/files/patch-a2x (limited to 'textproc') diff --git a/textproc/asciidoc/Makefile b/textproc/asciidoc/Makefile index e87977ec487b..a228ff01626f 100644 --- a/textproc/asciidoc/Makefile +++ b/textproc/asciidoc/Makefile @@ -7,6 +7,7 @@ PORTNAME= asciidoc PORTVERSION= 8.4.5 +PORTREVISION= 1 CATEGORIES= textproc MASTER_SITES= http://www.methods.co.nz/asciidoc/ \ SF @@ -14,7 +15,8 @@ MASTER_SITES= http://www.methods.co.nz/asciidoc/ \ MAINTAINER= peter.schuller@infidyne.com COMMENT= A text document format for writing short documents and man pages -RUN_DEPENDS= bash:${PORTSDIR}/shells/bash +RUN_DEPENDS+= bash:${PORTSDIR}/shells/bash \ + getopt>=0:${PORTSDIR}/misc/getopt USE_PYTHON= 2.4+ USE_GMAKE= yes @@ -32,4 +34,8 @@ pre-patch: @${REINPLACE_CMD} -e "s|/bin/bash|${LOCALBASE}/bin/bash|g" \ ${WRKSRC}/a2x ${WRKSRC}/asciidoc.py +post-patch: + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${LOCALBASE}|g" \ + ${WRKSRC}/a2x + .include diff --git a/textproc/asciidoc/files/patch-a2x b/textproc/asciidoc/files/patch-a2x new file mode 100644 index 000000000000..6de1aeb321d1 --- /dev/null +++ b/textproc/asciidoc/files/patch-a2x @@ -0,0 +1,61 @@ +--- a2x.orig 2009-07-23 18:51:01.485493322 +0200 ++++ a2x 2009-07-23 18:52:01.107211768 +0200 +@@ -9,11 +9,12 @@ + + VERSION=1.0.0 + BASENAME=$(basename "$0") ++GETOPT=%%PREFIX%%/bin/getopt + REALNAME="$0" + if [ ! -e "$REALNAME" ]; then + REALNAME=$(which "$REALNAME") + fi +-REALNAME="$(readlink -f "$REALNAME")" ++REALNAME="$(/bin/realpath "$REALNAME")" + CONF_DIR=/etc/asciidoc + # FOP executable is named fop on some systems. + FOP_COMMAND="fop.sh" +@@ -244,14 +245,14 @@ + if [ -z "$*" ]; then + help; exit 0 + fi +- require "getopt" +- getopt -T >/dev/null ++ require "$GETOPT" ++ $GETOPT -T >/dev/null + if [ $? -ne 4 ]; then + quit "enhanced getopt(1) required" + fi + short_opts="a:d:D:f:hLnsv" + long_opts="attribute:,asciidoc-opts:,destination-dir:,doctype:,help,icons-dir:,dry-run,format:,copy,icons,skip-asciidoc,stylesheet:,unsafe,version,verbose,xsltproc-opts:,dblatex-opts:,fop,fop-opts:,no-xmllint" +- args=$(getopt -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/dev/null) ++ args=$($GETOPT -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/dev/null) + if [ $? -ne 0 ]; then + quit "invalid command options, run: a2x --help" + fi +@@ -494,7 +495,7 @@ + quit "file not found: $xsl" + fi + to_docbook +- xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml") ++ xml=$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml") + html="$SRC_NAME.html" + copy_stylesheet_and_icons "$DESTINATION_DIR" + execute_command_2 "cd \"$DESTINATION_DIR\"" +@@ -527,7 +528,7 @@ + quit "file not found: $xsl" + fi + to_docbook +- xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml") ++ xml=$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml") + if [ ! -d "$chunkdir" ]; then + execute_command_2 "mkdir \"$chunkdir\"" + fi +@@ -549,7 +550,7 @@ + quit "file not found: $xsl" + fi + to_docbook "-d manpage" +- xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml") ++ xml=$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml") + execute_command_2 "cd \"$DESTINATION_DIR\"" + execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \ + \"$xsl\" \"$xml\"" -- cgit v1.2.3