summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile33
-rw-r--r--README2
-rw-r--r--config.mk2
-rw-r--r--doap.ttl36
-rw-r--r--websummary.sh49
5 files changed, 113 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 986f990..5a2da72 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,8 @@ NAME = getxbook
SRC = getgbook.c
LIB = util.o
-SCRIPTS = getgmissing.sh makebookpdf.sh
+SCRIPTS = getgmissing.sh getgfailed.sh makebookpdf.sh
+DOC = README COPYING LEGAL
BIN = $(SRC:.c=)
OBJ = $(SRC:.c=.o) $(LIB)
@@ -35,13 +36,31 @@ uninstall:
cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) $(SCRIPTS)
clean:
- rm -f -- $(BIN) $(OBJ) util.a
+ rm -f -- $(BIN) $(OBJ) util.a index.html
dist:
- @mkdir -p $(NAME)-$(VERSION)
- @cp $(SRC) $(SCRIPTS) util.h util.c Makefile config.mk COPYING $(NAME)-$(VERSION)
- @tar c $(NAME)-$(VERSION) | gzip -c > $(NAME)-$(VERSION).tar.gz
- @rm -rf $(NAME)-$(VERSION)
- @echo $(NAME)-$(VERSION).tar.gz
+ mkdir -p $(NAME)-$(VERSION)
+ cp $(SRC) $(SCRIPTS) $(DOC) util.h util.c Makefile config.mk $(NAME)-$(VERSION)
+ tar c $(NAME)-$(VERSION) | gzip -c > $(NAME)-$(VERSION).tar.gz
+ gpg -b < $(NAME)-$(VERSION).tar.gz > $(NAME)-$(VERSION).tar.gz.sig
+ rm -rf $(NAME)-$(VERSION)
+ echo $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION).tar.gz.sig
+
+index.html: doap.ttl README
+ echo making webpage
+ echo "<!DOCTYPE html><html><head><title>$(NAME)</title>" > $@
+ echo '<link rel="alternate" type="text/turtle" title="rdf" href="doap.ttl" />' >> $@
+ echo '<style type="text/css">' >> $@
+ echo "body {font-family:sans-serif; width:38em; margin:auto; max-width:94%;}" >> $@
+ echo "h1 {font-size:1.6em; text-align:center;}" >> $@
+ echo "a {text-decoration:none; border-bottom-width:thin; border-bottom-style:dotted;}" >> $@
+ echo "</style></head><body>" >> $@
+ smu < README >> $@
+ echo "<h2>download</h2>" >> $@
+ echo "[$(NAME) $(VERSION)]($(NAME)-$(VERSION).tar.gz) ([sig]($(NAME)-$(VERSION).tar.gz.sig))" | smu >> $@
+ echo '<hr />' >> $@
+ sh websummary.sh doap.ttl | smu >> $@
+ echo '</body></html>' >> $@
.PHONY: all clean install uninstall dist
+.SILENT: index.html dist
diff --git a/README b/README
index 481bf37..f071ef5 100644
--- a/README
+++ b/README
@@ -23,7 +23,7 @@ censorship, whether done for profit or for any other reason. And
it is dangerous.
The getxbook programs download books anonymously. Your IP address
-will still be logged (use [https://www.torproject.org](torify or torsocks)
+will still be logged (use [torify or tsocks](https://www.torproject.org)
to stop this), but your reading won't be automatically linked to
other information websites have about you, as no existing cookies
are used. Once the book is downloaded, you can read it as you
diff --git a/config.mk b/config.mk
index 500e53d..2050380 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
# See COPYING file for copyright and license details.
-VERSION = prealpha
+VERSION = 0.3
# paths
PREFIX = /usr/local
diff --git a/doap.ttl b/doap.ttl
new file mode 100644
index 0000000..16e7bfa
--- /dev/null
+++ b/doap.ttl
@@ -0,0 +1,36 @@
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix doap: <http://usefulinc.com/ns/doap#>.
+@prefix foaf: <http://xmlns.com/foaf/0.1/>.
+@prefix : <http://njw.me.uk/software/getxbook/#>.
+
+:p a doap:Project;
+ doap:name "Getxbook";
+ doap:shortdesc "A collection of tools to download books from websites";
+ doap:homepage <http://njw.me.uk/software/getxbook/>;
+ doap:repository :repo;
+ doap:programming-language "C";
+ doap:license <http://www.isc.org/software/license>;
+ doap:release :v01, :v02, :v03;
+ doap:maintainer <http://njw.me.uk/card#i>.
+
+<http://njw.me.uk/card#i> a foaf:Person;
+ foaf:name "Nick White";
+ foaf:homepage <http://njw.me.uk>.
+
+:repo a doap:GitRepository;
+ doap:location <http://git.njw.me.uk/getxbook.git>.
+
+:v01 a doap:Version;
+ doap:revision "0.1";
+ doap:created "2011-03-27";
+ doap:file-release <http://njw.me.uk/software/getgbook/getgbook-0.1.tar.bz2>.
+
+:v02 a doap:Version;
+ doap:revision "0.2";
+ doap:created "2011-04-11";
+ doap:file-release <http://njw.me.uk/software/getgbook/getgbook-0.2.tar.bz2>.
+
+:v03 a doap:Version;
+ doap:revision "0.3";
+ doap:created "2011-08-07";
+ doap:file-release <http://njw.me.uk/software/getxbook/getxbook-0.3.tar.gz>.
diff --git a/websummary.sh b/websummary.sh
new file mode 100644
index 0000000..c68ff17
--- /dev/null
+++ b/websummary.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+# See COPYING file for copyright and license details.
+#
+# Creates a project summary based on a doap file
+
+test $# -ne 1 && echo "usage: $0 doap" && exit 1
+
+rdf="$1"
+
+q="PREFIX doap: <http://usefulinc.com/ns/doap#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang ?repotype
+WHERE {
+?p a doap:Project;
+ doap:homepage ?home;
+ doap:repository ?r;
+ doap:license ?license;
+ doap:programming-language ?lang;
+ doap:maintainer ?m.
+?r a ?repotype;
+ doap:location ?repo.
+?m foaf:name ?maintainer;
+ foaf:homepage ?maintainerhome.
+}"
+
+roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \
+| while read r; do
+ home=`echo $r | awk -F , '{print $2}'| sed -e 's/uri\(//' -e 's/\)//'`
+ repo=`echo $r | awk -F , '{print $3}'| sed -e 's/uri\(//' -e 's/\)//'`
+ licenseuri=`echo $r | awk -F , '{print $4}'| sed -e 's/uri\(//' -e 's/\)//'`
+ maint=`echo $r | awk -F , '{print $5}'| sed -e 's/"//g'`
+ mainthome=`echo $r | awk -F , '{print $6}'| sed -e 's/uri\(//' -e 's/\)//'`
+ lang=`echo $r | awk -F , '{print $7}'| sed -e 's/"//g'`
+ test "$licenseuri" = "http://www.gnu.org/licenses/gpl.html" && license="GPL"
+ test "$licenseuri" = "http://www.gnu.org/licenses/agpl.html" && license="AGPL"
+ test "$licenseuri" = "http://creativecommons.org/licenses/MIT/" && license="MIT"
+ test "$licenseuri" = "http://www.isc.org/software/license" && license="ISC"
+ repotype=`echo $r | awk -F , '{print $8}'| sed -e 's/uri\(//' -e 's/\)//'`
+ test "$repotype" = "http://usefulinc.com/ns/doap#GitRepository" && repocmd="git clone"
+
+ cat <<- _EOF_
+- Project homepage: [$home]($home)
+- Code repository: $repocmd $repo
+- Maintainer: [$maint]($mainthome)
+- Language: $lang
+- License: [$license]($licenseuri)
+- DOAP: [${home}doap.ttl](${home}doap.ttl)
+_EOF_
+done