# HG changeset patch # User meillo@marmaro.de # Date 1195762405 -3600 # Node ID 9f4fa0bc15845113a59d176435a6c447356a027e initial commit diff -r 000000000000 -r 9f4fa0bc1584 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,6 @@ +syntax: glob +*~ +*.swp + +Packages +*.tar.gz diff -r 000000000000 -r 9f4fa0bc1584 COPYRIGHT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/COPYRIGHT Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,22 @@ +License: MIT License + +Copyright: 2007 by markus schnalke + +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. diff -r 000000000000 -r 9f4fa0bc1584 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,63 @@ +# genwebgallery by meillo@marmaro.de + + +NAME=genwebgallery +VERSION = 0.3 +NV=${NAME}-${VERSION} + +# paths +PREFIX = /usr +BINDIR = ${PREFIX}/bin +MANDIR = ${PREFIX}/share/man + +all: + @echo usage: make [un]install + +build: + @echo build unneeded + +dist: + @mkdir ${NV} + @cp -f ${NAME} ${NAME}.1 Makefile TODO COPYRIGHT ${NV} + @tar -czhof ${NV}.tar.gz ${NV} + @rm -rf ${NV} + +install: + @echo installing executable file to ${DESTDIR}${BINDIR} + @mkdir -p ${DESTDIR}${BINDIR} + @cp -f ${NAME} ${DESTDIR}${BINDIR} + @chmod 755 ${DESTDIR}${BINDIR}/${NAME} + @echo installing manual page to ${DESTDIR}${MANDIR}/man1 + @mkdir -p ${DESTDIR}${MANDIR}/man1 + @sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1 + @chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1 + +uninstall: + @echo removing executable file from ${DESTDIR}${BINDIR} + @rm -f ${DESTDIR}${BINDIR}/${NAME} + @echo removing manual page from ${DESTDIR}${MANDIR}/man1 + @rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1 + +deb: dist + @mkdir -p Packages + @cp ${NV}.tar.gz Packages/ + ( \ + cd Packages/ ;\ + tar -xzf ${NV}.tar.gz ;\ + mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\ + cd ${NV}/ ;\ + cp -r ../../debian/ . ;\ + debuild ;\ + ) + +clean: + @echo clean unneeded + +distclean: clean + @rm -f ${NAME}-*.tar.gz + +debclean: + @cd Packages/${NV}/ ; debuild clean ; + + +.PHONY: all clean build install uninstall diff -r 000000000000 -r 9f4fa0bc1584 TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TODO Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,4 @@ +TODO: + +- security checks +- navigation in pic pages diff -r 000000000000 -r 9f4fa0bc1584 debian/changelog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/changelog Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,40 @@ +genwebgallery (0.3-1) unstable; urgency=low + + * new upstream release + + -- markus schnalke Thu, 22 Nov 2007 20:23:10 +0100 + + +genwebgallery (0.2-3) unstable; urgency=low + + * fixed man page + + -- markus schnalke Thu, 22 Nov 2007 00:10:10 +0100 + + +genwebgallery (0.2-2) unstable; urgency=low + + * minor fixes in code + + -- markus schnalke Wed, 21 Nov 2007 23:53:10 +0100 + + +genwebgallery (0.2-1) unstable; urgency=low + + * new upstream release + + -- markus schnalke Wed, 21 Nov 2007 23:13:10 +0100 + + +genwebgallery (0.1-2) unstable; urgency=low + + * improved packaging + + -- markus schnalke Wed, 21 Nov 2007 22:07:54 +0100 + + +genwebgallery (0.1-1) unstable; urgency=low + + * Initial release + + -- markus schnalke Tue, 20 Nov 2007 23:09:23 +0100 diff -r 000000000000 -r 9f4fa0bc1584 debian/compat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/compat Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,1 @@ +5 diff -r 000000000000 -r 9f4fa0bc1584 debian/control --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/control Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,16 @@ +Source: genwebgallery +Section: web +Priority: extra +Maintainer: markus schnalke +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.2 + +Package: genwebgallery +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, imagemagick +Description: generates a web gallery with static html + *** unofficial package from meillo@marmaro.de *** + . + Very simple tool to generate static html pages to view pictures on the web. + . + Homepage: http://prog.marmaro.de diff -r 000000000000 -r 9f4fa0bc1584 debian/copyright --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/copyright Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,33 @@ +This package was debianized by markus schnalke on +Thu, 22 Nov 2007 20:24:08 +0100. + +It was downloaded from http://prog.marmaro.de + +Upstream Author: markus schnalke + +Copyright: 2007 by markus schnalke + +License: MIT License + +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. + + +The Debian packaging is (C) 2007, markus schnalke and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. diff -r 000000000000 -r 9f4fa0bc1584 debian/docs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/docs Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,2 @@ +TODO +COPYRIGHT diff -r 000000000000 -r 9f4fa0bc1584 debian/rules --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/rules Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/genwebgallery.sgml > genwebgallery.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/genwebgallery. + $(MAKE) DESTDIR=$(CURDIR)/debian/genwebgallery install + + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff -r 000000000000 -r 9f4fa0bc1584 genwebgallery --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genwebgallery Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,208 @@ +#!/bin/sh +# +# generates a web gallery of static web pages +# requires: ImageMagick (convert) +# +# meillo@marmaro.de +# + + +targetDir="web" +index="index.htm" +sizePic=640 +sizeThumb=200 +galleryTitle="gallery title" +copyright="please mind the copyright" + +verbose="" + + +function checkCreateDir() { + if [ -d "$targetDir" ] ; then + echo "Target dir '$targetDir' already exists." + echo -n "remove it? [y/n] " + + read remove + if [ $remove = "y" ] ; then + rm -r "$targetDir" + echo "removing '$targetDir' ..." + else + exit 1 + fi + fi + mkdir -p "$targetDir" +} + + + +function insertHeader() { + echo < + + + +$titleName + + + + + +EOF +} + + +function insertFooter() { + echo < + +EOF +} + + +function log() { + if [ $verbose ] ; then + echo "$1"; + fi +} + + +function checkConvert() { + log "checking convert installation" + (convert -version) 2> /dev/null > /dev/null + if [ $? -ne 0 ] ; then + echo "Error: Can not find 'convert' (package imagemagick)" + echo "ABORT!" + exit 2 + fi + log "`convert -version`" +} + + +#### + + + +if [ $# -eq 0 ] ; then + echo "usage: `basename $0` [OPTIONS] FILES" + exit 0 +fi + + +while [ "$#" -ge 1 -a "${1:0:1}" = '-' ] ; do + case $1 in + '--version') + echo "genwebgallery version 0.3" + exit 0 + ;; + '--help') + echo "`basename $0` + +generates a web gallery consisting of html pages + +usage: `basename $0` [OPTIONS] FILES + +options: + --version: echo program version + --help: display this output + -v: be verbose + -o DIR: all generated content is copied to this folder + -i FILE: the name of the index file (index.htm) + -t TITLE: title of the gallery + -c COPYRIGHT: a copyright notice + -ps PIXELS: size of the pics + -ts PIXELS: size of the thumbnails + +author: meillo@marmaro.de +homepage: http://prog.marmaro.de +" + exit 0 + ;; + '-v' | '--verbose') + verbose=1 + shift + ;; + '-o' | '--output') + targetDir=$2 + shift + shift + ;; + '-i' | '--index') + index=$2 + shift + shift + ;; + '-t' | '--title') + galleryTitle=$2 + shift + shift + ;; + '-c' | '--copyright') + copyright=$2 + shift + shift + ;; + '-ps' | '--pic-size') + sizePic=$2 + shift + shift + ;; + '-ts' | '--thumb-size') + sizeThumb=$2 + shift + shift + ;; + *) + echo "invalid option: $1" + echo "see: `basename $0` --help" + exit 1 + esac + +done + +if [ $# -eq 0 ] ; then + echo "usage: `basename $0` [OPTIONS] FILES" + exit 0 +fi + + +# verbose output +log "verbose on" +log "output dir is: $targetDir" +log "index file is: $index" +log "gallery title is: $galleryTitle" +log "copyright notice is: $copyright" +log "picture size is: $sizePic" +log "thumbnail size is: $sizeThumb" +checkConvert +log "" + + +checkCreateDir + +insertHeader > "$targetDir/$index" +echo "

$galleryTitle

" >> "$targetDir/$index" + +for i in "$@" ; do + file=`basename $i` + targetFile="$targetDir/$file.htm" + log "processing file: $file" + + # generate pic page + insertHeader > "$targetFile" + echo "

$galleryTitle

" \ + "

\"$file\"

" \ + "

$copyright

" >> "$targetFile" + insertFooter >> "$targetFile" + + # copy and resize pics + convert "$i" -resize ${sizePic}x${sizePic} "$targetDir/$file" + convert "$i" -resize ${sizeThumb}x${sizeThumb} "$targetDir/_$file" + + # generate content for index file + echo " \"$file\"" >> "$targetDir/$index" +done + +echo "

$copyright

" >> "$targetDir/$index" +insertFooter >> "$targetDir/$index" diff -r 000000000000 -r 9f4fa0bc1584 genwebgallery.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genwebgallery.1 Thu Nov 22 21:13:25 2007 +0100 @@ -0,0 +1,67 @@ +.TH GENWEBGALLERY 1 "genwebgallery-VERSION" "2007-11-21" "genwebgallery" + +.SH NAME +genwebgallery + +.SH SYNOPSIS +.B genwebgallery FILES + +.SH DESCRIPTION +.B genwebgallery +generates a web gallery of mentioned pictures. +.PP +Only static HTML pages are generated. +.PP +The +.BR convert +tool from ImageMagick is required. + +.SH OPTIONS +.B genwebgallery +.TP +.B \-\-help +Show summary of options. +.TP +.B \-\-version +Show version of program +.TP +.B \-v, \-\-verbose +Outputs more log data +.TP +.B \-o, \-\-output +Specify output directory +.TP +.B \-i, \-\-index +Specify index file (index.htm) +.TP +.B \-t, \-\-title +Specify title of gallery +.TP +.B \-c, \-\-copyright +Specify copyright notice +.TP +.B \-ps, \-\-pic-size +Specify size of picture +.TP +.B \-ts, \-\-thumb-size +Specify size of thumbnails + +.SH EXIT CODE +.TP +.B 1 +Any other error +.TP +.B 2 +The required program +.B convert +could not be found. It's probably not installed. +Normally it is provided by the ImageMagick tool collection. + +.SH SEE ALSO +.BR convert (1), +.BR ImageMagick (1). + +.SH AUTHOR +genwebgallery was written by markus schnalke +.PP +Website: http://prog.marmaro.de