summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-08-21 17:48:59 +0100
committerNick White <git@njw.me.uk>2011-08-21 17:48:59 +0100
commitba96802ba13f022047e93dfa96caddf4fff42146 (patch)
tree932c4490dc4150879e9d17b2b1783eb5d820d2d1
parent3ee5af0589fab8c0aec7425c3ca6ba3f27a9b35d (diff)
Create man page
-rw-r--r--Makefile5
-rw-r--r--TODO2
-rw-r--r--config.mk1
-rw-r--r--getgbook.131
4 files changed, 37 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4ec498d..dbd5753 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ SCRIPTS = getgmissing.sh getgfailed.sh makebookpdf.sh
DOC = README COPYING LEGAL
BIN = $(SRC:.c=)
+MAN = $(SRC:.c=.1)
OBJ = $(SRC:.c=.o) $(LIB)
all: $(BIN)
@@ -30,10 +31,14 @@ util.a: $(LIB)
@ranlib $@
install: all
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(SCRIPTS) $(DESTDIR)$(PREFIX)/bin
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+ for f in $(MAN); do sed "s/VERSION/$(VERSION)/g" < $$f > $(DESTDIR)$(MANPREFIX)/man1/$$f; done
uninstall:
cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) $(SCRIPTS)
+ cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)
clean:
rm -f -- $(BIN) $(OBJ) util.a index.html
diff --git a/TODO b/TODO
index 558b8d8..f4903c4 100644
--- a/TODO
+++ b/TODO
@@ -16,8 +16,6 @@ add https support to get
write some little tests
-create man pages
-
have websummary.sh print the date of release, e.g.
getxbook 0.3 (sig) (2011-08-02)
diff --git a/config.mk b/config.mk
index 2f0ec3e..6856404 100644
--- a/config.mk
+++ b/config.mk
@@ -3,6 +3,7 @@ VERSION = 0.3
# paths
PREFIX = /usr/local
+MANPREFIX = $(PREFIX)/share/man
CFLAGS = -ansi -pedantic -Wall -Wextra -Werror -g -D_POSIX_C_SOURCE=200112L \
-DVERSION=\"$(VERSION)\"
diff --git a/getgbook.1 b/getgbook.1
new file mode 100644
index 0000000..9440030
--- /dev/null
+++ b/getgbook.1
@@ -0,0 +1,31 @@
+.\" See COPYING file for copyright, license and warranty details.
+.TH GETGBOOK 1 getgbook\-VERSION
+.SH NAME
+getgbook \- downloads books from google books
+.SH SYNOPSIS
+.B getgbook
+.RB [-c|-n]
+.RB bookid
+.SH DESCRIPTION
+getgbook downloads pages of books from google books' "book
+preview" service. Some pages are not available, in which
+case they will be skipped.
+.SH OPTIONS
+.TP
+.B \-c
+Downloads from page codes given on stdin (one code per line).
+Google books page codes are on of the following, followed by
+a number:
+.RB PP
+.RB PR
+.RB PA
+.RB PT
+.TP
+.B \-n
+Downloads from page numbers given on stdin (one number per
+line).
+.TP
+.B bookid
+is the unique ID Google assigns to each book. It is 12
+characters long. It can be found by looking for the 'id='
+part of the URL of its Google Books page.