Anonymous avatar Anonymous committed c06f2dd

added everything else to make it a package

Comments (0)

Files changed (5)

+MIT/X Consortium License
+
+© 2010 Evan Gates <evan.gates@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+# srw - simple read wrapper
+
+include config.mk
+
+SRC = srw.c
+OBJ = ${SRC:.c=.o}
+
+all: options srw
+
+options:
+	@echo srw build options:
+	@echo "CFLAGS   = ${CFLAGS}"
+	@echo "LDFLAGS  = ${LDFLAGS}"
+	@echo "CC       = ${CC}"
+
+.c.o:
+	@echo CC $<
+	@${CC} -c ${CFLAGS} $<
+
+${OBJ}: config.mk
+
+srw: ${OBJ}
+	@echo CC -o $@
+	@${CC} -o $@ ${OBJ} ${LDFLAGS}
+
+clean:
+	@echo cleaning
+	@rm -f srw ${OBJ} srw-${VERSION}.tar.gz
+
+dist: clean
+	@echo creating dist tarball
+	@mkdir -p srw-${VERSION}
+	@cp -R LICENSE Makefile README config.mk srw.1 ${SRC} srw-${VERSION}
+	@tar -cf srw-${VERSION}.tar srw-${VERSION}
+	@gzip srw-${VERSION}.tar
+	@rm -rf srw-${VERSION}
+
+install: all
+	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
+	@mkdir -p ${DESTDIR}${PREFIX}/bin
+	@cp -f srw ${DESTDIR}${PREFIX}/bin
+	@chmod 755 ${DESTDIR}${PREFIX}/bin/srw
+	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
+	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
+	@sed "s/VERSION/${VERSION}/g" < srw.1 > ${DESTDIR}${MANPREFIX}/man1/srw.1
+	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/srw.1
+
+uninstall:
+	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
+	@rm -f ${DESTDIR}${PREFIX}/bin/srw
+	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
+	@rm -f ${DESTDIR}${MANPREFIX}/man1/srw.1
+
+.PHONY: all options clean dist install uninstall
+srw - simple read wrapper
+=========================
+srw is used to provide a simple line editing interface to a program. The output
+of the program does not interupt the input to srw, and the input to srw is not
+echoed.
+
+Installation
+------------
+Edit config.mk to match your local setup. srw is installed into
+/usr/local by default.
+
+Afterwards enter the following command to build and install srw 
+(if necessary as root):
+
+    $ make clean install
+
+
+Running srw
+-----------
+Simply invoke the 'srw' command with the required arguments.
+# srw version
+VERSION = 0.1
+
+# Customize below to fit your system
+
+# paths
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/share/man
+
+# includes and libs
+INCS = -I. -I/usr/include
+LIBS = -L/usr/lib -lc -lutil
+
+# flags
+CPPFLAGS = -DVERSION=\"${VERSION}\" -D_GNU_SOURCE
+CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+LDFLAGS = -s ${LIBS}
+
+# compiler and linker
+CC = cc
+.TH srw 1
+.SH NAME
+srw \- simple read wrapper
+
+.SH DESCRIPTION
+.B srw
+srw is used to provide a simple line editing interface to a program. The output
+of the program does not interupt the input to srw, and the input to srw is not
+echoed.
+.SH SYNOPSIS
+.B srw
+.RB [ \-p
+.IR prompt ]
+.RB [ \-P
+.IR scrollprompt ]
+.RB [ \-v ]
+.IR cmd
+.RI [ args... ]
+.SH OPTIONS
+.TP
+.IR " cmd"
+the command to wrap, this and it's arguments must come last
+.TP
+.IR " args..."
+the arguments passed to command
+.TP
+.BI \-p " prompt"
+lets you override the default prompt (>)
+.TP
+.BI \-P " scrollprompt"
+lets you override the default prompt used when text has scrolled off the screen (<)
+.TP
+.BI \-v
+prints version information and exits
+
+.SH AUTHORS
+Copyright \(co 2010 by Evan Gates <evan.gates (at) gmail (dot) com>
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.