From 02c4710c2c89cb693415dabe20f08d4e526ab6fd Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 7 Aug 2011 15:16:23 +0100 Subject: Add web page, ready makefile --- Makefile | 33 ++++++++++++++++++++++++++------- README | 2 +- config.mk | 2 +- doap.ttl | 36 ++++++++++++++++++++++++++++++++++++ websummary.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+), 9 deletions(-) create mode 100644 doap.ttl create mode 100644 websummary.sh 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 "$(NAME)" > $@ + echo '' >> $@ + echo '" >> $@ + smu < README >> $@ + echo "

download

" >> $@ + echo "[$(NAME) $(VERSION)]($(NAME)-$(VERSION).tar.gz) ([sig]($(NAME)-$(VERSION).tar.gz.sig))" | smu >> $@ + echo '
' >> $@ + sh websummary.sh doap.ttl | smu >> $@ + echo '' >> $@ .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: . +@prefix doap: . +@prefix foaf: . +@prefix : . + +:p a doap:Project; + doap:name "Getxbook"; + doap:shortdesc "A collection of tools to download books from websites"; + doap:homepage ; + doap:repository :repo; + doap:programming-language "C"; + doap:license ; + doap:release :v01, :v02, :v03; + doap:maintainer . + + a foaf:Person; + foaf:name "Nick White"; + foaf:homepage . + +:repo a doap:GitRepository; + doap:location . + +:v01 a doap:Version; + doap:revision "0.1"; + doap:created "2011-03-27"; + doap:file-release . + +:v02 a doap:Version; + doap:revision "0.2"; + doap:created "2011-04-11"; + doap:file-release . + +:v03 a doap:Version; + doap:revision "0.3"; + doap:created "2011-08-07"; + doap:file-release . 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: +PREFIX foaf: +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 -- cgit v1.2.3