Erik Southworth avatar Erik Southworth committed 3172b9b

better package source. no real new functions.

Comments (0)

Files changed (7)

-autom4te.cache/
-_build/
-_test/
-build-aux/
-configure
-Makefile.in
-aclocal.m4
-config.h.in
-
-txt2man.leo
-
-.1
-.patch
+Makefile
 0000000000000000000000000000000000000000 1.5.6
 1fd558ae745e13b96950829d72cfe948072afc4a 1.5.6
 6c426600c5244e629c18740afd11eb1204a7dbdb 1.5.7
+a8d575efaca749e7a6f7eb27e5982b9bf5f4310b 1.5.8
+2011-10-02  Erik Southworth  <erik.southworth@gmail.com>
+
+txt2man-1.5.8	02 October 2011
+
+ * makefile: Remove makefile from package. Now generated from
+			 configure with more install options.
+ * configure: Added configure file to generate a makefile. This is
+		      to better support automated packaging tools. Also
+		      changed html docs to generate from man2html program.
+ * txt2man: minor edit to usage for cleaner manpage display output.
+
 2009-10-19  Erik Southworth  <erik.southworth@gmail.com>
 
 txt2man-1.5.7	19 October 2009

Makefile

-# Makefile
-prefix ?= /usr/local
-datarootdir = ${prefix}/share
-mandir = ${datarootdir}/man
-version = txt2man-1.5.7
-BIN = src2man bookman txt2man
-MAN1 = src2man.1 txt2man.1 bookman.1
-
-all: $(MAN1)
-
-install: $(MAN1)
-	install -d $(DESTDIR)$(prefix)/bin
-	install -d $(DESTDIR)$(mandir)/man1
-	install $(BIN) $(DESTDIR)$(prefix)/bin
-	install $(MAN1) $(DESTDIR)$(mandir)/man1
-
-clean:
-	rm -f *.1 *.txt *.ps *.pdf *.html
-
-%.1:%.txt; ./txt2man -s 1 -t $* -r $(version) $< > $@
-%.txt:%; ./$< -h 2>&1 > $@
-%.html:%.1; rman -f HTML $< > $@
-%.ps:%.1; groff -man $< > $@
-%.pdf:%.ps; ps2pdf $< > $@
   help: txt2man -h
 
 INSTALL
-      make install	(to install under /usr/local)
+	  configure (to install under /usr/local)
   or
-      make install prefix=path
+      configure --prefix=PATH
+  and
+      make	
+      sudo make install	
 
 Send comments, suggestions and bug reports to mvertes@free.fr
 
 -- Marc Vertes
 
-This maint release: 19 October 2009
+This maint release: 02 October 2011
 
 -- Erik Southworth <erik.southworth@gmail.com>
     Release Page: http://bitbucket.org/superstition/txt2man/
+#! /bin/sh
+# txt2man configure wrapper
+# Erik Southworth, 2009,2011 (dvs)
+
+NAME=txt2man
+VERSION=1.5.8
+
+# [shopt]
+set -o posix   # Portable Operating System Interface standards
+#set -o errexit # Exit when simple command fails.
+#set -o nounset # Trigger error when expanding unset variables.
+
+# [name]
+BIN=$(basename "$0") # call name
+BINFILE=$(readlink --canonicalize "$0") # real path
+ABSDIR=$(dirname "$BINFILE") # real dir
+REALNAME=$(basename "$BINFILE") # real name
+CURDIR=$(pwd -P) # current dir
+
+#possible relative path
+WORKINGDIR=$(dirname "$0")
+cd $WORKINGDIR
+#abs path
+WORKINGDIR=$(pwd -P)
+cd $CURDIR
+
+usage()
+{
+cat << EOT
+Usage: ${BIN} [OPTION]... [VAR=VALUE]...
+
+Defaults for the options are specified in brackets.
+
+Options:
+${options}
+
+EOT
+exit
+}
+
+version()
+{
+cat << EOT
+${BIN} for ${NAME} ${VERSION}
+Copyright (c) 2009 Erik Southworth
+License MIT: <http://www.rpath.com/permanent/mit-license.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOT
+exit
+}
+
+# Fancy colors used to beautify the output a bit.
+#
+if [ "$NOCOLOR" ] ; then
+    NORMAL=""
+    BOLD=""
+    RED=""
+    YELLOW=""
+    GREEN=""
+else
+    NORMAL='\033[0m'
+    BOLD='\033[01;1m'
+    RED='\033[01;91m'
+    YELLOW='\033[00;33m'
+    GREEN='\033[01;92m'
+fi
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_ERROR=2
+EXIT_BUG=10
+
+# Helpful messages
+#
+exitMessage()
+{
+	if [ $? -ne 0 ] ; then
+	    printf "$RED"" oops! something went wrong.""$NORMAL""\n"
+	    printf "$YELLOW""I don't know what, but you better fix it.""$NORMAL""\n"
+	    printf "$BOLD""Good Luck...""$NORMAL""\n"
+	    exit $EXIT_FAILURE
+	else
+	    printf "$GREEN""'configure' finished successfully""$NORMAL""\n"
+	    printf "$BOLD""${NAME} ${VERSION}""$NORMAL""\n"
+	    printf "$NORMAL""Install ${NAME} in\t\t\t : ""$GREEN""${PREFIX}""$NORMAL""\n"
+	    printf "$NORMAL""Now type ""$GREEN""make ""$NORMAL""<""$GREEN""target""$NORMAL"">""$NORMAL""\n"
+	    printf "$NORMAL""    where the optional <""$GREEN""target""$NORMAL""> is:""$NORMAL""\n"
+	    printf "$NORMAL""      all              - build all binaries""$NORMAL""\n"
+	    printf "$NORMAL""      install          - install everything""$NORMAL""\n"
+	    printf "$NORMAL""      help             - display usage guide""$NORMAL""\n"
+	fi
+}
+
+# Generates a Makefile.
+#
+generateMakefile()
+{
+	cat > Makefile << EOF
+#!/usr/bin/make -f
+# txt2man Makefile
+# Generated by configure (Do not edit.)
+
+NAME = ${NAME}
+VERSION = ${VERSION}
+
+bindir = ${BINDIR}
+mandir = ${MANDIR}
+htmldir = ${HTMLDIR}
+pdfdir = ${PDFDIR}
+psdir = ${PSDIR}
+
+BIN = src2man bookman txt2man
+MAN1 = src2man.1 txt2man.1 bookman.1
+HTML = src2man.1.html txt2man.1.html bookman.1.html
+PDF = src2man.1.pdf txt2man.1.pdf bookman.1.pdf
+PS = src2man.1.ps txt2man.1.ps bookman.1.ps
+
+all: \$(BIN) \$(MAN1)
+html: \$(HTML)
+pdf: \$(PDF)
+ps: \$(PS)
+
+install: \$(MAN1)
+	install -d \$(DESTDIR)\$(bindir)
+	install -d \$(DESTDIR)\$(mandir)/man1
+	install \$(BIN) \$(DESTDIR)\$(bindir)
+	install \$(MAN1) \$(DESTDIR)\$(mandir)/man1
+
+install-html: \$(HTML)
+	install -d \$(DESTDIR)\$(htmldir)
+	install \$(HTML) \$(DESTDIR)\$(htmldir)
+
+install-pdf: \$(PDF)
+	install -d \$(DESTDIR)\$(pdfdir)
+	install \$(PDF) \$(DESTDIR)\$(pdfdir)
+
+install-ps: \$(PS)
+	install -d \$(DESTDIR)\$(psdir)
+	install \$(PS) \$(DESTDIR)\$(psdir)
+
+uninstall:
+	cd \$(DESTDIR)\$(bindir) && rm -f \$(BIN)
+	cd \$(DESTDIR)\$(mandir)/man1 && rm -f \$(MAN1)
+	-cd \$(DESTDIR)\$(htmldir) && -rm -f \$(HTML)
+	-cd \$(DESTDIR)\$(pdfdir) && -rm -f \$(PDF)
+	-cd \$(DESTDIR)\$(psdir) && -rm -f \$(PS)
+
+clean:
+	rm -f *.1 *.txt *.ps *.pdf *.html
+
+distclean: clean
+	rm -f Makefile
+
+distcheck:
+	@echo "Implement Me!"
+
+dist: \$(BIN)
+	rm -fr \$(NAME)-\$(VERSION)
+	mkdir  \$(NAME)-\$(VERSION)
+	cp -a configure \$(NAME)-\$(VERSION)
+	cp -a \$(BIN) \$(NAME)-\$(VERSION)
+	cp -a COPYING README Changelog \$(NAME)-\$(VERSION)
+	tar -cvzf \$(NAME)-\$(VERSION).tar.gz \$(NAME)-\$(VERSION)
+	@if test \$\$? -eq 0 ;\\
+	then \\
+	    rm -fr \$(NAME)-\$(VERSION) ;\\
+	else \\
+	    exit 1 ;\\
+	fi
+	@echo ===================================
+	@echo "Archive ready: \$(NAME)-\$(VERSION).tar.gz"
+	@echo ===================================
+
+help:
+	@echo "  === USER TARGETS ==="
+	@echo "Please use 'make [<target>]' where <target> is one of:"
+	@echo "  all                   # Build all files"
+	@echo "  html                  # Build html docs"
+	@echo "  pdf                   # Build pdf docs"
+	@echo "  ps                    # Build ps docs"
+	@echo "  clean                 # Remove build files"
+	@echo "  install               # Install all files"
+	@echo "  install-html          # Install html docs"
+	@echo "  install-pdf           # Install pdf docs"
+	@echo "  install-ps            # Install ps docs"
+	@echo "  uninstall             # Uninstall all files"
+	@echo "  === MAINTAINER TARGETS ==="
+	@echo "Please use 'make [<target>]' where <target> is one of:"
+	@echo "  tag                   # VC tag current version"
+	@echo "  dist                  # Make distibution"
+	@echo "  distcheck             # Test distibution"
+	@echo "  distclean             # Remove all files"
+	@echo "  show-version          # Show current version"
+
+.PHONY: clean dist distclean distcheck uninstall install all html ps pdf help
+
+.PHONY: show-version
+show-version:
+	@echo \$(VERSION)
+
+.PHONY: tag
+tag:
+	hg tag -f \$(VERSION)
+
+%.1:%.txt; ./txt2man -s 1 -t \$* -r "\${NAME} \${VERSION}" \$< >\$@
+%.txt:%; ./\$< -h 2>&1 >\$@
+#%.1.html:%.1; rman -f HTML $< >$@
+%.1.html:%.1; man2html $< >$@
+%.1.ps:%.1; groff -man \$< >\$@
+%.1.pdf:%.1.ps; ps2pdf \$< >\$@
+
+EOF
+}
+
+optparse()
+{
+	# options banner
+	options=$(cat << EOT
+  -h, --help                display usage guide
+  -V, --version             output version and copyright information
+
+  By default, \`make install' will install all the files in
+  \`/usr/local/bin', \`/usr/local/lib' etc.  You can specify
+  an installation prefix other than \`/usr/local' using \`--prefix',
+  for instance \`--prefix=$HOME'.
+
+  For better control, use the options below.
+
+  Fine tuning of the installation directories:
+    --bindir=DIR            user executables [EPREFIX/bin]
+    --sbindir=DIR           system admin executables [EPREFIX/sbin]
+    --libexecdir=DIR        program executables [EPREFIX/libexec]
+    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+    --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+    --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+    --libdir=DIR            object code libraries [EPREFIX/lib]
+    --includedir=DIR        C header files [PREFIX/include]
+    --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+    --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+    --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+    --infodir=DIR           info documentation [DATAROOTDIR/info]
+    --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+    --mandir=DIR            man documentation [DATAROOTDIR/man]
+    --docdir=DIR            documentation root [DATAROOTDIR/doc/${NAME}]
+    --htmldir=DIR           html documentation [DOCDIR]
+    --dvidir=DIR            dvi documentation [DOCDIR]
+    --pdfdir=DIR            pdf documentation [DOCDIR]
+    --psdir=DIR             ps documentation [DOCDIR]
+EOT
+)
+	# user override vars
+	while test $# -gt 0
+	do
+	    case $1 in
+	    --help) usage;;
+	    --version) version;;
+
+	    --prefix) PREFIX=${2}; shift 2;;
+	    --prefix=?*) PREFIX=${1#--prefix=}; shift;;
+
+	    --exec-prefix) EXEC_PREFIX=${2}; shift 2;;
+	    --exec-prefix=?*) EXEC_PREFIX=${1#--exec_prefix=}; shift;;
+
+	    --bindir) BINDIR=${2}; shift 2;;
+	    --bindir=?*) BINDIR=${1#--bindir=}; shift;;
+
+	    --sbindir) SBINDIR=${2}; shift 2;;
+	    --sbindir=?*) SBINDIR=${1#--sbindir=}; shift;;
+
+	    --libexecdir) LIBEXECDIR=${2}; shift 2;;
+	    --libexecdir=?*) LIBEXECDIR=${1#--libexecdir=}; shift;;
+
+	    --sysconfdir) SYSCONFDIR=${2}; shift 2;;
+	    --sysconfdir=?*) SYSCONFDIR=${1#--sysconfdir=}; shift;;
+
+	    --sharedstatedir) SHAREDSTATEDIR=${2}; shift 2;;
+	    --sharedstatedir=?*) SHAREDSTATEDIR=${1#--sharedstatedir=}; shift;;
+
+	    --localstatedir) LOCALSTATEDIR=${2}; shift 2;;
+	    --localstatedir=?*) LOCALSTATEDIR=${1#--localstatedir=}; shift;;
+
+	    --libdir) LIBDIR=${2}; shift 2;;
+	    --libdir=?*) LIBDIR=${1#--libdir=}; shift;;
+
+	    --includedir) INCLUDEDIR=${2}; shift 2;;
+	    --includedir=?*) INCLUDEDIR=${1#--includedir=}; shift;;
+
+	    --oldincludedir) OLDINCLUDEDIR=${2}; shift 2;;
+	    --oldincludedir=?*) OLDINCLUDEDIR=${1#--oldincludedir=}; shift;;
+
+	    --datarootdir) DATAROOTDIR=${2}; shift 2;;
+	    --datarootdir=?*) DATAROOTDIR=${1#--datarootdir=}; shift;;
+
+	    --datadir) DATADIR=${2}; shift 2;;
+	    --datadir=?*) DATADIR=${1#--datadir=}; shift;;
+
+	    --infodir) INFODIR=${2}; shift 2;;
+	    --infodir=?*) INFODIR=${1#--infodir=}; shift;;
+
+	    --localedir) LOCALEDIR=${2}; shift 2;;
+	    --localedir=?*) LOCALEDIR=${1#--localedir=}; shift;;
+
+	    --mandir) MANDIR=${2}; shift 2;;
+	    --mandir=?*) MANDIR=${1#--mandir=}; shift;;
+
+	    --docdir) DOCDIR=${2}; shift 2;;
+	    --docdir=?*) DOCDIR=${1#--docdir=}; shift;;
+
+	    --htmldir) HTMLDIR=${2}; shift 2;;
+	    --htmldir=?*) HTMLDIR=${1#--htmldir=}; shift;;
+
+	    --dvidir) DVIDIR=${2}; shift 2;;
+	    --dvidir=?*) DVIDIR=${1#--dvidir=}; shift;;
+
+	    --pdfdir) PDFDIR=${2}; shift 2;;
+	    --pdfdir=?*) PDFDIR=${1#--pdfdir=}; shift;;
+
+	    --psdir) PSDIR=${2}; shift 2;;
+	    --psdir=?*) PSDIR=${1#--psdir=}; shift;;
+
+	    --?*) printf "$RED""Woah! What was that?: $1""$NORMAL"; echo; shift;;
+	    *) shift;;
+	    --) shift; break;;
+	    esac
+	done
+
+	# init option vars
+	# (newer datarootdir standard)
+	: ${PREFIX:=/usr/local}
+	: ${EXEC_PREFIX:=${PREFIX}}
+	: ${BINDIR:=${EXEC_PREFIX}/bin}
+	: ${SBINDIR:=${EXEC_PREFIX}/sbin}
+	: ${LIBEXECDIR:=${EXEC_PREFIX}/libexec}
+	: ${SYSCONFDIR:=${PREFIX}/etc}
+	: ${SHAREDSTATEDIR:=${PREFIX}/com}
+	: ${LOCALSTATEDIR:=${PREFIX}/var}
+	: ${LIBDIR:=${EXEC_PREFIX}/lib}
+	: ${INCLUDEDIR:=${PREFIX}/include}
+	: ${OLDINCLUDEDIR:=/usr/include}
+	: ${DATAROOTDIR:=${PREFIX}/share}
+	: ${DATADIR:=${DATAROOTDIR}}
+	: ${INFODIR:=${DATAROOTDIR}/info}
+	: ${LOCALEDIR:=${DATAROOTDIR}/locale}
+	: ${MANDIR:=${DATAROOTDIR}/man}
+	: ${DOCDIR:=${DATAROOTDIR}/doc/${NAME}}
+	: ${HTMLDIR:=${DOCDIR}}
+	: ${DVIDIR:=${DOCDIR}}
+	: ${PDFDIR:=${DOCDIR}}
+	: ${PSDIR:=${DOCDIR}}
+}
+
+optparse "$@"
+generateMakefile
+exitMessage
 SEE ALSO
   man(1), mandoc(7), rman(1), groff(1), more(1), gxditview(1), troff(1).
 BUGS
-  - Automatic probe (-p option) works only if input is a regular file (i.e.
+  Automatic probe (-p option) works only if input is a regular file (i.e.
   not stdin).
 AUTHOR
   Marc Vertes <mvertes@free.fr>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.