From cba619fe9827b8e6fd28019235381014789429de Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sun, 27 Nov 2011 00:29:54 +0000 Subject: [PATCH] [svn-buildpackage] Tagging libapache-gallery-perl 1.0.2-1 git-svn-id: file:///srv/don_svn/deb_pkgs/libapache-gallery-perl/tags/1.0.2-1@634 8f7917da-ec0b-0410-a553-b9b0e350d17e --- Changes | 21 +++++++++- META.yml | 2 +- README | 40 ++++++++++-------- debian/changelog | 8 ++++ debian/compat | 1 + debian/control | 17 +++++--- debian/cron.daily | 14 +++---- debian/rules | 95 ++++++++++--------------------------------- debian/source/format | 1 + debian/watch | 2 + lib/Apache/Gallery.pm | 51 ++++++++++++++--------- 11 files changed, 125 insertions(+), 127 deletions(-) create mode 100644 debian/compat create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/Changes b/Changes index f72b901..e02c697 100644 --- a/Changes +++ b/Changes @@ -1,8 +1,25 @@ -$Author: mil $ $Rev: 324 $ -$Date: 2011-02-22 21:56:06 +0100 (Tue, 22 Feb 2011) $ +$Author: mil $ $Rev: 335 $ +$Date: 2011-06-08 20:47:46 +0200 (Wed, 08 Jun 2011) $ Revision history for Perl extension Apache::Gallery. +1.0.2 Wed Jun 8 20:47:16 CEST 2011 + + - Extended GalleryUnderscoresToSpaces to filenames as well. + (Debian bug #348724, Francesco Potortì) + - Added txt to GalleryDocFile, the code in Gallery.pm already + allowed it. (Luca Capello) + - Added text-html.png and text-txt.png icons. + (Debian bug #423004, Luca Capello) + - Fixed counter typo for .folder in next directory + menu item. (Luca Capello) + - Added support to ignore items through .ignore. + (Debian bug #619625, Luca Capello) + - Fixed spelling typos in Gallery.pm and README. (Luca Capello) + - GalleryCacheDir defaults to /var/cache/www/ per the FHS-2.3. + (Debian bug #337197, Luca Capello) + - Fixed two minor POD errors (Michael Legart) + 1.0.1 Wed Feb 23 20:45:38 CET 2011 - Added missing template files to MANIFEST diff --git a/META.yml b/META.yml index 9541ad2..f0d1646 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Apache-Gallery -version: 1.0.1 +version: 1.0.2 abstract: mod_perl handler to create an image gallery author: - Michael Legart diff --git a/README b/README index 85690f5..64361e8 100644 --- a/README +++ b/README @@ -19,7 +19,7 @@ CONFIGURATION The options are set in the httpd.conf/.htaccess file using the syntax: PerlSetVar OptionName 'value' - Example: PerlSetVar GalleryCacheDir '/var/tmp/Apache-Gallery/' + Example: PerlSetVar GalleryCacheDir '/var/cache/www/' GalleryAutoRotate Some cameras, like the Canon G3, can detect the orientation of a the @@ -32,10 +32,9 @@ CONFIGURATION GalleryCacheDir Directory where Apache::Gallery should create its cache with scaled - pictures. The default is /var/tmp/Apache-Gallery/ . Here, a - directory for each virtualhost or location will be created - automaticly. Make sure your webserver has write access to the - CacheDir. + pictures. The default is /var/cache/www/ . Here, a directory for + each virtualhost or location will be created automatically. Make + sure your webserver has write access to the CacheDir. GalleryTemplateDir Full path to the directory where you placed the templates. This @@ -139,7 +138,7 @@ CONFIGURATION GalleryInfo will be available to your templates as $EXIF_ (in all uppercase). That means that with the default setting "Picture Taken => DateTimeOriginal, Flash => Flash" you will have - the variables $EXIF_DATETIMEORIGINAL and $EXIF_FLASH avilable to + the variables $EXIF_DATETIMEORIGINAL and $EXIF_FLASH available to your templates. You can place them anywhere you want. GalleryRootPath @@ -165,8 +164,8 @@ CONFIGURATION Apache::Gallery but are not visible in the index. The default is - '\.(mpe?g|avi|mov|asf|wmv|doc|mp3|ogg|pdf|rtf|wav|dlt|txt|html?|csv|eps) - $' + '\.(mpe?g|avi|mov|asf|wmv|doc|mp3|ogg|pdf|rtf|wav|dlt|txt|html?|csv| + eps)$' GalleryTTFDir To use the GalleryCopyrightText feature you must set this option to @@ -235,22 +234,23 @@ CONFIGURATION GalleryUnderscoresToSpaces Set this option to 1 to convert underscores to spaces in the listing - of directory and file names, as well as in the alt attribute for HTML - tags. + of directory and file names, as well as in the alt attribute for + HTML tags. GalleryCommentExifKey - Set this option to e.g. ImageDescription to use this field as comments - for images. + Set this option to e.g. ImageDescription to use this field as + comments for images. GalleryEnableMediaRss - Set this option to 1 to enable generation of a media RSS feed. This can - be used e.g. together with the PicLens plugin from http://piclens.com + Set this option to 1 to enable generation of a media RSS feed. This + can be used e.g. together with the PicLens plugin from + http://piclens.com FEATURES Rotate images Some cameras, like the Canon G3, detects the orientation of a picture and adds this info to the EXIF header. Apache::Gallery - detects this and automaticly rotates images with this info. + detects this and automatically rotates images with this info. If your camera does not support this, you can rotate the images manually, This can also be used to override the rotate information @@ -258,8 +258,8 @@ FEATURES with the GalleryAutoRotate option. To use this functionality you have to create file with the name of - the picture you want rotated appened with ".rotate". The file should - include a number where these numbers are supported: + the picture you want rotated appended with ".rotate". The file + should include a number where these numbers are supported: "1", rotates clockwise by 90 degree "2", rotates clockwise by 180 degrees @@ -269,6 +269,10 @@ FEATURES would create a file in the same directory called "Picture1234.jpg.rotate" with the number 1 inside of it. + Ignore directories/files + To ignore a directory or a file (of any kind, not only images) you + create a .ignore file. + Comments To include comments for a directory you create a .comment file where the first line can contain "TITLE: New title" which will @@ -308,7 +312,7 @@ AUTHOR Michael Legart COPYRIGHT AND LICENSE - Copyright (C) 2001-2005 Michael Legart + Copyright (C) 2001-2011 Michael Legart Templates designed by Thomas Kjaer diff --git a/debian/changelog b/debian/changelog index 06e6b5b..4133a8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libapache-gallery-perl (1.0.2-1) unstable; urgency=low + + * New upstream release + + Added ignore file support (Closes: #619625) + + Cache dir default (Closes: #337197) + + -- Don Armstrong Sat, 26 Nov 2011 14:42:09 -0800 + libapache-gallery-perl (1.0.1-3) unstable; urgency=low * Include default/navdirectory.tpl and new/navdirectory.tpl by copying diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control index 43dbaf1..307ca59 100644 --- a/debian/control +++ b/debian/control @@ -2,15 +2,20 @@ Source: libapache-gallery-perl Maintainer: Don Armstrong Priority: optional Section: perl -Build-Depends-Indep: perl (>= 5.6.0-17), libmodule-build-perl, sharutils -Build-Depends: debhelper (>= 3.0.5) -Standards-Version: 3.7.2 +Build-Depends-Indep: perl, libmodule-build-perl, sharutils, + libapache2-mod-perl2 (>=2.0) | libapache-request-perl, + libimage-size-perl, libimage-info-perl, libtemplate-perl, + libimage-imlib2-perl, libtext-template-perl +Build-Depends: debhelper (>= 8) +Standards-Version: 3.9.2 Package: libapache-gallery-perl Architecture: all -Priority: optional -Depends: ${perl:Depends}, libapache2-mod-perl2 (>= 2.0) | libapache-request-perl, libimage-size-perl, libimage-info-perl, libtemplate-perl, libimage-imlib2-perl, libtext-template-perl -Description: Apache module to create galleries on-the-fly +Depends: ${perl:Depends}, ${misc:Depends}, libapache2-mod-perl2 (>= + 2.0) | libapache-request-perl, libimage-size-perl, + libimage-info-perl, libtemplate-perl, libimage-imlib2-perl, + libtext-template-perl +Description: Apache module to create image galleries on-the-fly This package contains a Perl module for Apache to create galleries. . The images just need to be copied into a directory where Apache will pick diff --git a/debian/cron.daily b/debian/cron.daily index f196666..0fe36db 100644 --- a/debian/cron.daily +++ b/debian/cron.daily @@ -6,18 +6,18 @@ set -e -cachedir=/var/tmp/Apache-Gallery -user=www-data +cachedir="/var/cache/www" +user="www-data" -if [ -d $cachedir ]; then +if [ -d "$cachedir" ]; then # remove old files start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \ - --oknodo --chuid $user -- -c \ - "find $cachedir -type f -atime +6 -print0 | xargs -r0 rm -f" + --oknodo --chuid "$user" -- -c \ + "find '$cachedir' -type f -atime +6 -delete" # remove empty directories start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \ - --oknodo --chuid $user -- -c \ - "find $cachedir -depth -type d -print0 | \ + --oknodo --chuid "$user" -- -c \ + "find '$cachedir' -depth -type d -print0 | \ xargs -r0 rmdir --ignore-fail-on-non-empty" fi diff --git a/debian/rules b/debian/rules index f8d4830..0e848ef 100755 --- a/debian/rules +++ b/debian/rules @@ -1,79 +1,26 @@ #!/usr/bin/make -f -#export DH_VERBOSE=1 - -export DH_COMPAT := 4 - -PERL ?= /usr/bin/perl - -b := $(shell pwd)/debian/libapache-gallery-perl - -arrange: arrange-stamp -arrange-stamp: install - dh_testdir - touch arrange-stamp - -binary: binary-stamp -binary-stamp: binary-indep binary-arch - dh_testdir - touch binary-stamp - -binary-arch: binary-arch-stamp -binary-arch-stamp: arrange - dh_testdir - touch binary-arch-stamp - -binary-indep: binary-indep-stamp -binary-indep-stamp: arrange - dh_testdir - dh_testroot - dh_installman - dh_installdocs README - dh_installchangelogs Changes - dh_installcron - dh_fixperms - dh_installdeb - dh_perl - dh_compress - dh_gencontrol - dh_md5sums - dh_builddeb - touch binary-indep-stamp - -build: build-stamp -build-stamp: config - dh_testdir - $(MAKE) - touch build-stamp - -clean: - dh_testdir - dh_testroot - -$(MAKE) clean - if [ -e Makefile ]; then $(MAKE) -i distclean; fi - dh_clean arrange-stamp binary-stamp binary-arch-stamp binary-indep-stamp build-stamp config-stamp install-stamp - rm -f htdocs/text-text.png htdocs/text-html.png - rm -rf debian/libapache-gallery-perl - rm -rf Makefile.old - -config: config-stamp -config-stamp: - dh_testdir - $(PERL) Makefile.PL INSTALLDIRS=vendor - # deal with uuencoded icons +%: + dh $@ + +# it is necessary to set MOD_PERL_API_VERSION to 2 to avoid trying to +# use modperl 1 +override_dh_auto_test: + MOD_PERL_API_VERSION=2 dh_auto_test; + +# install templates and icons +override_dh_auto_install: + dh_auto_install; + cp -r templates/* debian/libapache-gallery-perl/usr/share/libapache-gallery-perl/templates/.; + cp -r htdocs/* debian/libapache-gallery-perl/usr/share/libapache-gallery-perl/icons/.; + +# put the missing icons in place +override_dh_auto_configure: + dh_auto_configure; uudecode -o htdocs/text-txt.png debian/text-text.png.uuencode uudecode -o htdocs/text-html.png debian/text-html.png.uuencode - touch config-stamp - -install: install-stamp -install-stamp: build - dh_testdir - dh_clean -k - dh_installdirs - $(MAKE) - $(MAKE) install PREFIX=$(CURDIR)/debian/libapache-gallery-perl/usr - cp -r $(CURDIR)/templates/* $(CURDIR)/debian/libapache-gallery-perl/usr/share/libapache-gallery-perl/templates - cp -r $(CURDIR)/htdocs/* $(CURDIR)/debian/libapache-gallery-perl/usr/share/libapache-gallery-perl/icons - touch install-stamp -.PHONY: binary binary-arch binary-indep clean +# remove the missing icons on clean +override_dh_auto_clean: + dh_auto_clean; + rm -f htdocs/text-text.png htdocs/text-html.png diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..d3827e7 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..940ccd5 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://search.cpan.org/CPAN/authors/id/L/LE/LEGART/ Apache-Gallery-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ diff --git a/lib/Apache/Gallery.pm b/lib/Apache/Gallery.pm index 6e62182..ee9f63a 100644 --- a/lib/Apache/Gallery.pm +++ b/lib/Apache/Gallery.pm @@ -1,13 +1,13 @@ package Apache::Gallery; -# $Author: mil $ $Rev: 324 $ -# $Date: 2011-02-22 21:56:06 +0100 (Tue, 22 Feb 2011) $ +# $Author: mil $ $Rev: 335 $ +# $Date: 2011-06-08 20:47:46 +0200 (Wed, 08 Jun 2011) $ use strict; use vars qw($VERSION); -$VERSION = "1.0.1"; +$VERSION = "1.0.2"; BEGIN { @@ -75,7 +75,7 @@ sub handler { } $r->headers_out->{"X-Powered-By"} = "apachegallery.dk $VERSION - Hest design!"; - $r->headers_out->{"X-Gallery-Version"} = '$Rev: 324 $ $Date: 2011-02-22 21:56:06 +0100 (Tue, 22 Feb 2011) $'; + $r->headers_out->{"X-Gallery-Version"} = '$Rev: 335 $ $Date: 2011-06-08 20:47:46 +0200 (Wed, 08 Jun 2011) $'; my $filename = $r->filename; $filename =~ s/\/$//; @@ -351,7 +351,8 @@ sub handler { my $fileurl = $uri."/".$file; - if (-d $thumbfilename) { + # Debian bug #619625 + if (-d $thumbfilename && ! -e $thumbfilename . ".ignore") { my $dirtitle = ''; if (-e $thumbfilename . ".folder") { $dirtitle = get_filecontent($thumbfilename . ".folder"); @@ -367,7 +368,8 @@ sub handler { ); } - elsif (-f $thumbfilename && $thumbfilename =~ /$doc_pattern/i && $thumbfilename !~ /$img_pattern/i) { + # Debian bug #619625 + elsif (-f $thumbfilename && $thumbfilename =~ /$doc_pattern/i && $thumbfilename !~ /$img_pattern/i && ! -e $thumbfilename . ".ignore") { my $type = lc($1); my $stat = stat($thumbfilename); my $size = $stat->size; @@ -400,7 +402,8 @@ sub handler { } ); } - elsif (-f $thumbfilename) { + # Debian bug #619625 + elsif (-f $thumbfilename && ! -e $thumbfilename . ".ignore") { my ($width, $height, $type) = imgsize($thumbfilename); next if $type eq 'Data stream is not a known image file format'; @@ -464,7 +467,8 @@ sub handler { return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK(); } - my @neighbour_directories = grep { !/^\./ && -d "$parent_filename/$_" } readdir (PARENT_DIR); + # Debian bug #619625 + my @neighbour_directories = grep { !/^\./ && -d "$parent_filename/$_" && ! -e "$parent_filename/$_" . ".ignore" } readdir (PARENT_DIR); my $dirsortby; if (defined($r->dir_config('GalleryDirSortBy'))) { $dirsortby=$r->dir_config('GalleryDirSortBy'); @@ -499,7 +503,7 @@ sub handler { } if ($neightbour_counter < scalar @neighbour_directories - 1) { my $linktext = $neighbour_directories[$neightbour_counter+1]; - if (-e $parent_filename.'/'.$neighbour_directories[$neightbour_counter-1] . ".folder") { + if (-e $parent_filename.'/'.$neighbour_directories[$neightbour_counter+1] . ".folder") { $linktext = get_filecontent($parent_filename.'/'.$neighbour_directories[$neightbour_counter+1] . ".folder"); } my %info = ( @@ -616,7 +620,7 @@ sub handler { show_error($r, 500, "Unable to access directory", "Unable to access directory $path"); return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK(); } - my @pictures = grep { /$img_pattern/i } readdir (DATADIR); + my @pictures = grep { /$img_pattern/i && ! -e "$path/$_" . ".ignore" } readdir (DATADIR); closedir(DATADIR); @pictures = gallerysort($r, @pictures); @@ -852,7 +856,7 @@ sub cache_dir { unless ($r->dir_config('GalleryCacheDir')) { - $cache_root = '/var/tmp/Apache-Gallery/'; + $cache_root = '/var/cache/www/'; if ($r->server->is_virtual) { $cache_root = File::Spec->catdir($cache_root, $r->server->server_hostname); } else { @@ -1659,7 +1663,7 @@ directories. The options are set in the httpd.conf/.htaccess file using the syntax: B -Example: B +Example: B =over 4 @@ -1676,9 +1680,9 @@ to 0. =item B Directory where Apache::Gallery should create its cache with scaled -pictures. The default is /var/tmp/Apache-Gallery/ . Here, a directory -for each virtualhost or location will be created automaticly. Make -sure your webserver has write access to the CacheDir. +pictures. The default is /var/cache/www/ . Here, a directory for each +virtualhost or location will be created automatically. Make sure your +webserver has write access to the CacheDir. =item B @@ -1795,7 +1799,7 @@ If you set this option to 'variables' the items you configure in GalleryInfo will be available to your templates as $EXIF_ (in all uppercase). That means that with the default setting "Picture Taken => DateTimeOriginal, Flash => Flash" you will have the variables $EXIF_DATETIMEORIGINAL and -$EXIF_FLASH avilable to your templates. You can place them +$EXIF_FLASH available to your templates. You can place them anywhere you want. =item B @@ -1913,6 +1917,8 @@ of directory and file names, as well as in the alt attribute for HTML =back +=over 4 + =item B Set this option to e.g. ImageDescription to use this field as comments @@ -1923,6 +1929,8 @@ for images. Set this option to 1 to enable generation of a media RSS feed. This can be used e.g. together with the PicLens plugin from http://piclens.com +=back + =head1 FEATURES =over 4 @@ -1931,7 +1939,7 @@ can be used e.g. together with the PicLens plugin from http://piclens.com Some cameras, like the Canon G3, detects the orientation of a picture and adds this info to the EXIF header. Apache::Gallery detects this -and automaticly rotates images with this info. +and automatically rotates images with this info. If your camera does not support this, you can rotate the images manually, This can also be used to override the rotate information @@ -1939,7 +1947,7 @@ from a camera that supports that. You can also disable this behavior with the GalleryAutoRotate option. To use this functionality you have to create file with the name of the -picture you want rotated appened with ".rotate". The file should include +picture you want rotated appended with ".rotate". The file should include a number where these numbers are supported: "1", rotates clockwise by 90 degree @@ -1950,6 +1958,11 @@ So if we want to rotate "Picture1234.jpg" 90 degrees clockwise we would create a file in the same directory called "Picture1234.jpg.rotate" with the number 1 inside of it. +=item B + +To ignore a directory or a file (of any kind, not only images) you +create a .ignore file. + =item B To include comments for a directory you create a .comment @@ -2009,7 +2022,7 @@ Michael Legart =head1 COPYRIGHT AND LICENSE -Copyright (C) 2001-2005 Michael Legart +Copyright (C) 2001-2011 Michael Legart Templates designed by Thomas Kjaer -- 2.39.2