diff options
| author | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-12-27 13:07:33 +0100 |
|---|---|---|
| committer | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-12-27 13:07:33 +0100 |
| commit | 3d23d6bc29dcbf714c916281091ebc594d3bc667 (patch) | |
| tree | 5bb44dc17eac4e77595081f2d9d43949539a9807 | |
| parent | 190f2bac98fa819096c928811aa0c0d94255a804 (diff) | |
some version which does not work yet
| -rw-r--r-- | debian/photoalbum.debhelper.log | 40 | ||||
| -rw-r--r-- | docs/README | 25 | ||||
| -rw-r--r-- | docs/photoalbum.1 | 24 | ||||
| -rw-r--r-- | docs/photoalbum.pod | 25 | ||||
| -rw-r--r-- | docs/photoalbum.txt | 21 | ||||
| -rwxr-xr-x | src/photoalbum | 50 | ||||
| -rw-r--r-- | src/photoalbum.default.conf | 4 |
7 files changed, 135 insertions, 54 deletions
diff --git a/debian/photoalbum.debhelper.log b/debian/photoalbum.debhelper.log index 19f4fcf..545a50f 100644 --- a/debian/photoalbum.debhelper.log +++ b/debian/photoalbum.debhelper.log @@ -3,3 +3,43 @@ dh_auto_build dh_auto_test dh_prep dh_installdirs +dh_auto_install +dh_install +dh_installdocs +dh_installchangelogs +dh_installexamples +dh_installman +dh_installcatalogs +dh_installcron +dh_installdebconf +dh_installemacsen +dh_installifupdown +dh_installinfo +dh_pysupport +dh_installinit +dh_installmenu +dh_installmime +dh_installmodules +dh_installlogcheck +dh_installlogrotate +dh_installpam +dh_installppp +dh_installudev +dh_installwm +dh_installxfonts +dh_installgsettings +dh_bugfiles +dh_ucf +dh_lintian +dh_gconf +dh_icons +dh_perl +dh_usrlocal +dh_link +dh_compress +dh_fixperms +dh_installdeb +dh_gencontrol +dh_md5sums +dh_builddeb +dh_builddeb diff --git a/docs/README b/docs/README deleted file mode 100644 index a4384d3..0000000 --- a/docs/README +++ /dev/null @@ -1,25 +0,0 @@ -Project Homepage: http://photoalbum.buetow.org - -TOC: -01. HELLO WORLD -02. QUICK START GUIDE -03. HTML TEMPLATES - -01. HELLO WORLD - -photoalbum is a minimal bash script for linux to generate static web photo albums. - -02. QUICK START GUIDE: - -* Copy all images wanted to ./incoming - -* Edit photoalbum.conf - -* Run "make" - -* Distribute the ./dist directory - -03. HTML TEMPLATES - -Go to the ./templates directory and edit them as wished. - diff --git a/docs/photoalbum.1 b/docs/photoalbum.1 index 02b6fa0..3c8517c 100644 --- a/docs/photoalbum.1 +++ b/docs/photoalbum.1 @@ -130,17 +130,27 @@ .if n .ad l .nh .SH "NAME" -cpuinfo \- A small and humble tool to print out CPU data +photoalbum \- photoalbum is a minimal bash script for linux to generate static web photo albums. .SH "SYNOPSIS" .IX Header "SYNOPSIS" -cpuinfo -.SS "How this works?" -.IX Subsection "How this works?" -This just invokes \s-1AWK\s0 to parse /proc/cpuinfo and prints out some stuff but -human readable. +photoalbum +.SS "\s-1QUICK\s0 \s-1START\s0 \s-1GUIDE:\s0" +.IX Subsection "QUICK START GUIDE:" +* Copy all images wanted to ./incoming +.PP +* Edit photoalbum.conf +.PP +* Run \*(L"make\*(R" +.PP +* Distribute the ./dist directory +.PP +\fI\s-1HTML\s0 \s-1TEMPLATES\s0\fR +.IX Subsection "HTML TEMPLATES" +.PP +Go to the templates directory and edit them as wished. .SH "LICENSE" .IX Header "LICENSE" See package description or project website. .SH "AUTHOR" .IX Header "AUTHOR" -Paul Buetow \- <http://cpuinfo.buetow.org> +Paul Buetow \- <http://photoalbum.buetow.org> diff --git a/docs/photoalbum.pod b/docs/photoalbum.pod index 63ccb43..401f9a5 100644 --- a/docs/photoalbum.pod +++ b/docs/photoalbum.pod @@ -1,15 +1,28 @@ =head1 NAME -cpuinfo - A small and humble tool to print out CPU data +photoalbum - photoalbum is a minimal bash script for linux to generate static web photo albums. =head1 SYNOPSIS -cpuinfo +photoalbum [init|generate] -=head2 How this works? +=head2 QUICK START GUIDE: -This just invokes AWK to parse /proc/cpuinfo and prints out some stuff but -human readable. +* See if /etc/default/photoalbum fits your needs. If not, read on. + +* Copy /etc/default/photoalbum to ~/.photoalbumrc in order to customize it. + +* Run 'photoalbum init' + +* Copy all images wanted to ./incoming + +* Run 'photoalbum generate' + +* Distribute the ./dist directory + +=head3 HTML TEMPLATES + +Go to the templates directory and edit them as wished. =head1 LICENSE @@ -17,6 +30,6 @@ See package description or project website. =head1 AUTHOR -Paul Buetow - <http://cpuinfo.buetow.org> +Paul Buetow - <http://photoalbum.buetow.org> =cut diff --git a/docs/photoalbum.txt b/docs/photoalbum.txt index 7dc4125..b4e1a87 100644 --- a/docs/photoalbum.txt +++ b/docs/photoalbum.txt @@ -1,16 +1,25 @@ NAME - cpuinfo - A small and humble tool to print out CPU data + photoalbum - photoalbum is a minimal bash script for linux to generate + static web photo albums. SYNOPSIS - cpuinfo + photoalbum - How this works? - This just invokes AWK to parse /proc/cpuinfo and prints out some stuff - but human readable. + QUICK START GUIDE: + * Copy all images wanted to ./incoming + + * Edit photoalbum.conf + + * Run "make" + + * Distribute the ./dist directory + + HTML TEMPLATES + Go to the templates directory and edit them as wished. LICENSE See package description or project website. AUTHOR - Paul Buetow - <http://cpuinfo.buetow.org> + Paul Buetow - <http://photoalbum.buetow.org> diff --git a/src/photoalbum b/src/photoalbum index d020446..fec60ab 100755 --- a/src/photoalbum +++ b/src/photoalbum @@ -1,7 +1,6 @@ #!/bin/bash -source photoalbum.conf - +declare -r ARG="${1}" ; shift declare -r VERSION='PHOTOALBUMVERSION' function createdirs () { @@ -27,7 +26,7 @@ function template () { } function scale () { - cd ${INCOMING} && find ./ -type f | sort | while read photo; do + cd ${INCOMING_DIR} && find ./ -type f | sort | while read photo; do if [ ! -f "../photos/${photo}" ]; then # Flatten directories / to __ @@ -54,7 +53,7 @@ function scale () { cd .. } -function generate () { +function makedist () { local num=${1} ; shift local name=page-${num} local -i i=0 @@ -126,8 +125,41 @@ function generate () { done } -createdirs -scale -find ./html -type f -name \*.html -delete -generate 1 -template index index . +function init () { + [ ! -d "${INCOMING_DIR}" ] && mkdir "${INCOMING_DIR}" && echo "Created ${INCOMING_DIR}" + [ -d ./dist ] && rm -rf ./dist && echo Cleaned up ./dist + mkdir ./dist && echo Created ./dist +} + +function generate () { + if [ ! -d "${INCOMING_DIR}" ]; then + echo "ERROR: You may run init first, no such directory: ${INCOMING_DIR}" >&2 + exit 1 + fi + + createdirs + scale + find ./html -type f -name \*.html -delete + makedist 1 + template index index . +} + +if [ -f ~/.photoalbumrc ]; then + source ~/.photoalbumrc +else + source /etc/default/photoalbum +fi + +case "${ARG}" in + init) + init + ;; + generate) + generate + ;; + *) + usage + ;; +esac + + diff --git a/src/photoalbum.default.conf b/src/photoalbum.default.conf index defd59e..e38b2ad 100644 --- a/src/photoalbum.default.conf +++ b/src/photoalbum.default.conf @@ -6,5 +6,7 @@ declare -i GEOMETRY=800 declare -i MAXPREVIEWS=100 declare -r TITLE='A simple Photoalbum' -declare -r INCOMING=./incoming +declare -r INCOMING_DIR=./incoming + +declare -r TEMPLATE_DIR=/usr/share/photoalbum/templates |
