Update to 1.0RC2. While here, fix a couple of outstanding annoyances:

o Use the ${DATADIR} variable instead of hardcoding share/Apache-Gallery
   for the data-files that need to be installed under there.

 o Also use %%DATADIR%% instead of hardcoding share/Apache-Gallery in the
   pkg-plist.  Never try to remove www/icons itself, which should be done
   by the Apache port.

 o Install both the 'default' and the 'new' template directories, leaving
   the css files with the templates instead of moving them into a css/
   subdirectory.

 o Put the icons under www/icons/gallery, removing the need for the patch
   to the template files, also makes them easier to move around if people
   like doing that sort of thing.

Approved by:	krion (mentor) kvs@pil.dk (maintainer)
This commit is contained in:
Philip Paeps 2005-07-19 20:39:37 +00:00
parent 3566b4e16d
commit 3045d29cc6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=139619
6 changed files with 78 additions and 305 deletions

View File

@ -6,8 +6,7 @@
#
PORTNAME= Apache-Gallery
PORTVERSION= 0.9.1
PORTREVISION= 3
PORTVERSION= 1.0RC2
CATEGORIES= www perl5
MASTER_SITES= http://apachegallery.dk/download/ \
${MASTER_SITE_PERL_CPAN}
@ -40,38 +39,20 @@ PERL_CONFIGURE= yes
MAN3= Apache::Gallery.3
TEMPLATEFILES= dircomment.tpl directory.tpl error.tpl file.tpl index.tpl \
info.tpl interval.tpl intervalactive.tpl layout.tpl \
navpicture.tpl nodircomment.tpl nopictureinfo.tpl \
orig.tpl picture.tpl scale.tpl pictureinfo.tpl refresh.tpl \
scale.tpl scaleactive.tpl showpicture.tpl \
slideshowisoff.tpl slideshowoff.tpl
ICONS= application-doc.png application-pdf.png application-rtf.png \
sound-mp3.png sound-ogg.png sound-wav.png \
video-asf.png video-avi.png \
video-mov.png video-mpeg.png video-mpg.png video-wmv.png \
video-asf.png agfolder.png
post-patch:
@${RM} -f ${WRKSRC}/lib/Apache/Gallery.pm.orig
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/Apache-Gallery/templates
.for f in ${TEMPLATEFILES}
${INSTALL_DATA} ${WRKSRC}/templates/default/${f} \
${PREFIX}/share/Apache-Gallery/templates/
.endfor
.for f in ${ICONS}
${INSTALL_DATA} ${WRKSRC}/htdocs/${f} \
${PREFIX}/www/icons/
.endfor
${MKDIR} ${PREFIX}/share/Apache-Gallery/css
${INSTALL_DATA} ${WRKSRC}/templates/default/gallery.css \
${PREFIX}/share/Apache-Gallery/css/
${MKDIR} ${PREFIX}/www/icons/gallery/
${INSTALL_DATA} ${WRKSRC}/htdocs/* \
${PREFIX}/www/icons/gallery
${MKDIR} ${DATADIR}/templates/default
${MKDIR} ${DATADIR}/templates/new
${INSTALL_DATA} ${WRKSRC}/templates/default/* \
${DATADIR}/templates/default
${INSTALL_DATA} ${WRKSRC}/templates/new/* \
${DATADIR}/templates/new
.endif
.if !defined(BATCH)
@${SED} s!%%PREFIX%%!${PREFIX}!g ${PKGMESSAGE}
@${SED} s!%%DATADIR%%!${DATADIR}!g ${PKGMESSAGE}
.endif
.include <bsd.port.pre.mk>

View File

@ -1,2 +1,2 @@
MD5 (Apache-Gallery-0.9.1.tar.gz) = 882e650e6fc3f059e84eca1564b5f32f
SIZE (Apache-Gallery-0.7.tar.gz) = 82230
MD5 (Apache-Gallery-1.0RC2.tar.gz) = d195f22377276d00d083b1b3e48847bb
SIZE (Apache-Gallery-1.0RC2.tar.gz) = 83231

View File

@ -1,10 +0,0 @@
--- templates/default/directory.tpl Fri Jan 2 13:45:06 2004
+++ templates/default/directory.tpl Wed Dec 8 18:12:41 2004
@@ -1 +1 @@
- <div id="folder"><a href="{ $FILEURL }/"><img border="0" src="/icons/gallery/agfolder.png"><br>{ $FILE }</a></div>
+ <div id="folder"><a href="{ $FILEURL }/"><img border="0" src="/icons/agfolder.png"><br>{ $FILE }</a></div>
--- templates/default/file.tpl Fri Jan 2 14:18:12 2004
+++ templates/default/file.tpl Wed Dec 8 18:12:36 2004
@@ -1 +1 @@
- <div id="folder"><a href="{ $FILEURL }"><img border="0" alt="{ $ALT }" src="/icons/gallery/{ $FILETYPE }.png"><br>{ $FILE }</a></div>
+ <div id="folder"><a href="{ $FILEURL }"><img border="0" alt="{ $ALT }" src="/icons/{ $FILETYPE }.png"><br>{ $FILE }</a></div>

View File

@ -1,221 +0,0 @@
--- lib/Apache/Gallery.pm.orig Sat Sep 11 23:53:05 2004
+++ lib/Apache/Gallery.pm Sun May 22 20:29:22 2005
@@ -19,16 +19,15 @@
$::MP2 = ($mod_perl::VERSION >= 1.99);
if ($::MP2) {
- require Apache2;
- require Apache::Server;
- require Apache::RequestRec;
- require Apache::Log;
+ require Apache2::ServerRec;
+ require Apache2::RequestRec;
+ require Apache2::Log;
require APR::Table;
- require Apache::RequestIO;
- require Apache::SubRequest;
- require Apache::Const;
+ require Apache2::RequestIO;
+ require Apache2::SubRequest;
+ require Apache2::Const;
- Apache::Const->import(-compile => 'OK','DECLINED','FORBIDDEN','NOT_FOUND');
+ Apache2::Const->import(-compile => 'OK','DECLINED','FORBIDDEN','NOT_FOUND');
}
else {
@@ -61,7 +60,7 @@
sub handler {
- my $r = shift or Apache->request();
+ my $r = shift or Apache2::RequestUtil->request();
if ((not $memoized) and ($r->dir_config('GalleryMemoize'))) {
require Memoize;
@@ -84,10 +83,10 @@
}
if (-f $filename or -d $filename) {
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
else {
- return $::MP2 ? Apache::NOT_FOUND() : Apache::Constants::NOT_FOUND();
+ return $::MP2 ? Apache2::Const::NOT_FOUND() : Apache::Constants::NOT_FOUND();
}
}
@@ -105,7 +104,7 @@
}
$r->print($content);
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
# Selectmode providing checkboxes beside all thumbnails
@@ -113,7 +112,7 @@
# Let Apache serve icons without us modifying the request
if ($r->uri =~ m/^\/icons/i) {
- return $::MP2 ? Apache::DECLINED() : Apache::Constants::DECLINED();
+ return $::MP2 ? Apache2::Const::DECLINED() : Apache::Constants::DECLINED();
}
# Lookup the file in the cache and scale the image if the cached
# image does not exist
@@ -142,7 +141,7 @@
if ($::MP2) {
$r->sendfile($file);
- return Apache::OK();
+ return Apache2::Const::OK();
}
else {
$r->path_info('');
@@ -157,7 +156,7 @@
unless (-f $filename or -d $filename) {
show_error($r, 404, "404!", "No such file or directory: ".uri_escape($r->uri, $escape_rule));
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
my $doc_pattern = $r->dir_config('GalleryDocFile');
@@ -171,14 +170,14 @@
# Let Apache serve files we don't know how to handle anyway
if (-f $filename && $filename !~ m/$img_pattern/i) {
- return $::MP2 ? Apache::DECLINED() : Apache::Constants::DECLINED();
+ return $::MP2 ? Apache2::Const::DECLINED() : Apache::Constants::DECLINED();
}
if (-d $filename) {
unless (-d cache_dir($r, 0)) {
unless (create_cache($r, cache_dir($r, 0))) {
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
}
@@ -198,7 +197,7 @@
unless (opendir (DIR, $filename)) {
show_error ($r, 500, $!, "Unable to access directory $filename: $!");
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
$tpl_vars{MENU} = generate_menu($r);
@@ -420,7 +419,7 @@
}
$r->print($tpl_vars{MAIN});
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
else {
@@ -429,9 +428,9 @@
if (defined($ENV{QUERY_STRING}) && $ENV{QUERY_STRING} eq 'orig') {
if ($r->dir_config('GalleryAllowOriginal') ? 1 : 0) {
$r->filename($filename);
- return $::MP2 ? Apache::DECLINED() : Apache::Constants::DECLINED();
+ return $::MP2 ? Apache2::Const::DECLINED() : Apache::Constants::DECLINED();
} else {
- return $::MP2 ? Apache::FORBIDDEN() : Apache::Constants::FORBIDDEN();
+ return $::MP2 ? Apache2::Const::FORBIDDEN() : Apache::Constants::FORBIDDEN();
}
}
@@ -443,7 +442,7 @@
unless (-d $cache_path) {
unless (create_cache($r, $cache_path)) {
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
}
@@ -465,7 +464,7 @@
if ($cgi->param('width')) {
unless ((grep $cgi->param('width') == $_, @sizes) or ($cgi->param('width') == $original_size)) {
show_error($r, 200, "Invalid width", "The specified width is invalid");
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
$width = $cgi->param('width');
@@ -534,7 +533,7 @@
unless (opendir(DATADIR, $path)) {
show_error($r, 500, "Unable to access directory", "Unable to access directory $path");
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
my @pictures = grep { /$img_pattern/i } readdir (DATADIR);
closedir(DATADIR);
@@ -749,7 +748,7 @@
unless ((grep $cgi->param('slideshow') == $_, @slideshow_intervals)) {
show_error($r, 200, "Invalid interval", "Invalid slideshow interval choosen");
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
$tpl_vars{URL} = uri_escape($nextpicture, $escape_rule);
@@ -781,7 +780,7 @@
}
$r->print($tpl_vars{MAIN});
- return $::MP2 ? Apache::OK() : Apache::Constants::OK();
+ return $::MP2 ? Apache2::Const::OK() : Apache::Constants::OK();
}
@@ -998,7 +997,7 @@
my $imageinfo = {};
if ($type eq 'Data stream is not a known image file format') {
# should never be reached, this is supposed to be handled outside of here
- Apache->request->log_error("Something was fishy with the type of the file $file\n");
+ Apache2::RequestUtil->request->log_error("Something was fishy with the type of the file $file\n");
} else {
# Some files, like TIFF, PNG, GIF do not have EXIF info embedded but use .thm files
# instead.
@@ -1379,22 +1378,22 @@
$image->blend($logo, 0, 0, 0, $logox, $logoy, $x-$logox, $y-$logoy, $logox, $logoy);
}
else {
- Apache->request->log_error("GalleryCopyrightImage $copyrightfile was not found\n");
+ Apache2::RequestUtil->request->log_error("GalleryCopyrightImage $copyrightfile was not found\n");
}
}
if ($GalleryTTFDir && $GalleryCopyrightText && $GalleryTTFFile, $text_color) {
if (!-d $GalleryTTFDir) {
- Apache->request->log_error("GalleryTTFDir $GalleryTTFDir is not a dir\n");
+ Apache2::RequestUtil->request->log_error("GalleryTTFDir $GalleryTTFDir is not a dir\n");
} elsif ($GalleryCopyrightText eq '') {
- Apache->request->log_error("GalleryCopyrightText is empty. No text inserted to picture\n");
+ Apache2::RequestUtil->request->log_error("GalleryCopyrightText is empty. No text inserted to picture\n");
} elsif (!-e "$GalleryTTFDir/$GalleryTTFFile") {
- Apache->request->log_error("GalleryTTFFile $GalleryTTFFile was not found\n");
+ Apache2::RequestUtil->request->log_error("GalleryTTFFile $GalleryTTFFile was not found\n");
} else {
@@ -1415,7 +1414,7 @@
if (($text_x < $x - $offset) && ($text_y < $y - $offset)) {
$image->draw_text($x-$text_x-$offset, $y-$text_y-$offset, "$GalleryCopyrightText");
} else {
- Apache->request->log_error("Text is to big for the picture.\n");
+ Apache2::RequestUtil->request->log_error("Text is to big for the picture.\n");
}
}
}

View File

@ -5,7 +5,7 @@
DocumentRoot /data/pictures/
ErrorLog logs/gallery-error_log
TransferLog logs/gallery-access_log
PerlSetVar GalleryTemplateDir '%%PREFIX%%/share/Apache-Gallery/templates'
PerlSetVar GalleryTemplateDir '%%DATADIR%%/templates/default'
PerlSetVar GalleryInfo 'Picture Taken => DateTimeOriginal, Flash => Flash'
PerlSetVar GallerySizes '640 1024 1600 2272'
PerlSetVar GalleryThumbnailSize '100x75'
@ -16,6 +16,6 @@
</Location>
</VirtualHost>
And copy %%PREFIX%%/share/Apache-Gallery/css/gallery.css to your DocumentRoot
And copy %%DATADIR%%/templates/default/gallery.css to your DocumentRoot
---------------------------------------------------------------------------------------

View File

@ -1,44 +1,67 @@
%%SITE_PERL%%/Apache/Gallery.pm
%%SITE_PERL%%/%%PERL_ARCH%%/auto/Apache/Gallery/.packlist
share/Apache-Gallery/templates/dircomment.tpl
share/Apache-Gallery/templates/directory.tpl
share/Apache-Gallery/templates/error.tpl
share/Apache-Gallery/templates/file.tpl
share/Apache-Gallery/templates/index.tpl
share/Apache-Gallery/templates/info.tpl
share/Apache-Gallery/templates/interval.tpl
share/Apache-Gallery/templates/intervalactive.tpl
share/Apache-Gallery/templates/layout.tpl
share/Apache-Gallery/templates/navpicture.tpl
share/Apache-Gallery/templates/nodircomment.tpl
share/Apache-Gallery/templates/nopictureinfo.tpl
share/Apache-Gallery/templates/orig.tpl
share/Apache-Gallery/templates/picture.tpl
share/Apache-Gallery/templates/scale.tpl
share/Apache-Gallery/templates/pictureinfo.tpl
share/Apache-Gallery/templates/refresh.tpl
share/Apache-Gallery/templates/scaleactive.tpl
share/Apache-Gallery/templates/showpicture.tpl
share/Apache-Gallery/templates/slideshowisoff.tpl
share/Apache-Gallery/templates/slideshowoff.tpl
share/Apache-Gallery/css/gallery.css
www/icons/agfolder.png
www/icons/application-doc.png
www/icons/application-pdf.png
www/icons/application-rtf.png
www/icons/sound-mp3.png
www/icons/sound-ogg.png
www/icons/sound-wav.png
www/icons/video-asf.png
www/icons/video-avi.png
www/icons/video-mov.png
www/icons/video-mpeg.png
www/icons/video-mpg.png
www/icons/video-wmv.png
%%DATADIR%%/templates/default/dircomment.tpl
%%DATADIR%%/templates/default/directory.tpl
%%DATADIR%%/templates/default/error.tpl
%%DATADIR%%/templates/default/file.tpl
%%DATADIR%%/templates/default/gallery.css
%%DATADIR%%/templates/default/index.tpl
%%DATADIR%%/templates/default/info.tpl
%%DATADIR%%/templates/default/interval.tpl
%%DATADIR%%/templates/default/intervalactive.tpl
%%DATADIR%%/templates/default/layout.tpl
%%DATADIR%%/templates/default/navpicture.tpl
%%DATADIR%%/templates/default/nodircomment.tpl
%%DATADIR%%/templates/default/nopictureinfo.tpl
%%DATADIR%%/templates/default/orig.tpl
%%DATADIR%%/templates/default/picture.tpl
%%DATADIR%%/templates/default/scale.tpl
%%DATADIR%%/templates/default/pictureinfo.tpl
%%DATADIR%%/templates/default/refresh.tpl
%%DATADIR%%/templates/default/scaleactive.tpl
%%DATADIR%%/templates/default/showpicture.tpl
%%DATADIR%%/templates/default/slideshowisoff.tpl
%%DATADIR%%/templates/default/slideshowoff.tpl
%%DATADIR%%/templates/new/dircomment.tpl
%%DATADIR%%/templates/new/directory.tpl
%%DATADIR%%/templates/new/error.tpl
%%DATADIR%%/templates/new/file.tpl
%%DATADIR%%/templates/new/gallery.css
%%DATADIR%%/templates/new/index.tpl
%%DATADIR%%/templates/new/info.tpl
%%DATADIR%%/templates/new/interval.tpl
%%DATADIR%%/templates/new/intervalactive.tpl
%%DATADIR%%/templates/new/layout.tpl
%%DATADIR%%/templates/new/navpicture.tpl
%%DATADIR%%/templates/new/nodircomment.tpl
%%DATADIR%%/templates/new/nopictureinfo.tpl
%%DATADIR%%/templates/new/orig.tpl
%%DATADIR%%/templates/new/picture.tpl
%%DATADIR%%/templates/new/scale.tpl
%%DATADIR%%/templates/new/pictureinfo.tpl
%%DATADIR%%/templates/new/refresh.tpl
%%DATADIR%%/templates/new/scaleactive.tpl
%%DATADIR%%/templates/new/showpicture.tpl
%%DATADIR%%/templates/new/slideshowisoff.tpl
%%DATADIR%%/templates/new/slideshowoff.tpl
www/icons/gallery/agfolder.png
www/icons/gallery/application-doc.png
www/icons/gallery/application-pdf.png
www/icons/gallery/application-rtf.png
www/icons/gallery/c.png
www/icons/gallery/sound-mp3.png
www/icons/gallery/sound-ogg.png
www/icons/gallery/sound-wav.png
www/icons/gallery/video-asf.png
www/icons/gallery/video-avi.png
www/icons/gallery/video-mov.png
www/icons/gallery/video-mpeg.png
www/icons/gallery/video-mpg.png
www/icons/gallery/video-wmv.png
@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Apache/Gallery
@unexec rmdir %D/%%SITE_PERL%%/Apache 2>/dev/null || true
@dirrm share/Apache-Gallery/templates
@dirrm share/Apache-Gallery/css
@dirrm share/Apache-Gallery
@unexec rmdir %D/share/Apache-Gallery/templates 2>/dev/null || true
@unexec rmdir %D/www/icons 2>/dev/null || true
@dirrm %%DATADIR%%/templates/default
@dirrm %%DATADIR%%/templates/new
@dirrm %%DATADIR%%/templates
@dirrm %%DATADIR%%
@dirrm www/icons/gallery