added dependencies; better external command handling
authorAdrian Steinmann <ast@NetBSD.org>
Sun, 11 Oct 2015 09:28:25 +0000 (11:28 +0200)
committerAdrian Steinmann <ast@NetBSD.org>
Sun, 11 Oct 2015 09:28:25 +0000 (11:28 +0200)
fgallery/Makefile
fgallery/distinfo
fgallery/patches/patch-aa
fgallery/patches/patch-ab
fgallery/patches/patch-ac
fgallery/patches/patch-ad
fgallery/patches/patch-ae
fgallery/patches/patch-af

index e24a5c7138449d07fa587e47a2b2b3f2f09e7b3c..6a71fefe60d65b7049915ffe28e554dfe5bae998 100644 (file)
@@ -19,6 +19,11 @@ USE_TOOLS+=     perl
 REPLACE_PERL=   ${PKGBASE}
 
 DEPENDS+=       facedetect>=1.0:../../wip/facedetect
+DEPENDS+=       ImageMagick>=6.9:../../graphics/ImageMagick
+DEPENDS+=       jpegoptim>=1.4:../../graphics/jpegoptim
+DEPENDS+=       pngcrush>=1.7:../../graphics/pngcrush
+DEPENDS+=       lcms2>=2.7:../../graphics/lcms2
+DEPENDS+=       p7zip>=9.38:../../archivers/p7zip
 
 SUBST_CLASSES+=          fix-paths
 SUBST_STAGE.fix-paths=   post-patch
index 313e3234226594b331f90dbdb300fb8b26ce7799..676bd22d2c4035b095b7e2b61c2c01fd1d1bbc88 100644 (file)
@@ -6,6 +6,6 @@ Size (fgallery-1.7.zip) = 145719 bytes
 SHA1 (patch-aa) = ea6913990d988f0d4e6676b3e7f75e1104c6d348
 SHA1 (patch-ab) = 536ee6d16369ae4cd51db346a199bf57b833510e
 SHA1 (patch-ac) = 9aa0319eafe721eea9ef0eee3934c6642227d36c
-SHA1 (patch-ad) = 0da10404403ecc9a6fe30a24262997af6b40820d
+SHA1 (patch-ad) = 08f5783bb5f9795f5b467f00b04209bcaf7a59b7
 SHA1 (patch-ae) = 18d4bf0e39c06991bae457b2ee1479d603b49a05
 SHA1 (patch-af) = ebbb72ec0cf26f856478004768b59d80df34edf5
index 1aafeca7b7bf21055aa07c9ebc191024e45825e6..bfb7fa8dddd40bcdb0c1356d32b2b3d3a824b1f0 100644 (file)
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2005/03/04 19:04:20 oht Exp $
+$NetBSD: patch-aa,v 1.1.1.1 2015/10/11 19:04:20 ast Exp $
 Path of fgallery/view code
 --- fgallery.orig      2015-10-03 21:35:52.000000000 +0200
 +++ fgallery   2015-10-03 21:39:40.000000000 +0200
index 9da852fb2c1135fdf222b9b459687a9cecd7bbb2..71bf5b88641893b6e0f906f1da1b72e16657b795 100644 (file)
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2005/03/04 19:04:20 oht Exp $
+$NetBSD: patch-ab,v 1.1.1.1 2015/10/11 19:04:20 ast Exp $
 Use oct instead of 0###
 --- fgallery.orig      2014-09-05 16:33:54.000000000 +0200
 +++ fgallery   2015-10-02 11:10:05.000000000 +0200
index ad1fbd213cb295dc51189431cab52c1402f3b171..17f65774c144d7f9da145897f5b165630138dffd 100644 (file)
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2005/03/04 19:04:20 oht Exp $
+$NetBSD: patch-ac,v 1.1.1.1 2015/10/11 19:04:20 ast Exp $
 Don't use subroutine prototypes
 --- fgallery.orig      2014-09-05 16:33:54.000000000 +0200
 +++ fgallery   2015-10-02 11:10:05.000000000 +0200
index f89739145a398e2eea7db9afb6e7020984f99820..019f49f946c65571bf18c33d34113d5ba22b7e7e 100644 (file)
@@ -1,29 +1,78 @@
-$NetBSD: patch-aa,v 1.1.1.1 2005/03/04 19:04:20 oht Exp $
-Handle exiftran/exitautotran discovery better
---- fgallery.orig       2014-09-05 16:33:54.000000000 +0200
-+++ fgallery    2015-10-02 11:10:05.000000000 +0200
-@@ -326,16 +326,19 @@
+$NetBSD: patch-ac,v 1.1.1.1 2015/10/11 19:04:20 ast Exp $
+Handle discovery/checking of external commands uniformly
+--- fgallery.orig      2015-10-11 11:16:27.000000000 +0200
++++ fgallery   2015-10-11 11:11:52.000000000 +0200
+@@ -233,6 +233,12 @@
+   return int($value);
  }
  
++# see if our environment has a given command installed
++sub cmd_exists
++{
++  my ($c) = @_;
++  return qx{/bin/sh -c "command -v $c"};
++}
+ sub print_help()
+ {
+@@ -299,41 +305,32 @@
+   fatal("output directory already exists, but doesn't look like a template copy");
+ }
+-# check tools
+-if(system("identify -version >/dev/null 2>&1")
+-|| system("convert -version >/dev/null 2>&1")) {
+-  fatal("cannot run \"identify\" or \"convert\" (check if ImageMagick is installed)");
+-}
+-if(system("7za -h >/dev/null 2>&1"))
+-{
++# check for existence of external commands
++unless(cmd_exists('7z')) {
+   $p7zip = 0;
+-  if(system("zip -h >/dev/null 2>&1")) {
+-    fatal("cannot run \"zip\" (check if 7za or zip is installed)");
+-  }
+-}
+-if(system("jpegoptim -V >/dev/null 2>&1")) {
+-  $jpegoptim = 0;
++  cmd_exists('zip') || fatal('Missing 7z or zip command');
+ }
+-if(system("pngcrush -h >/dev/null 2>&1")) {
+-  $pngoptim = 0;
+-}
+-if($facedet && system("facedetect -h >/dev/null 2>&1")) {
+-  fatal("cannot run \"facedetect\" (see http://www.thregr.org/~wavexx/hacks/facedetect/)");
+-}
+-if($sRGB && system("tificc >/dev/null 2>&1")) {
+-  fatal("cannot run \"tificc\" (check if liblcms2-utils is installed)");
+-}
+-
++fatal 'Missing identify or convert executable (from ImageMagick)'
++  unless cmd_exists('identify') || cmd_exists('convert');
++$jpegoptim = 0 unless cmd_exists('jpegoptim');
++$pngoptim = 0 unless cmd_exists('pngcrush');
++fatal 'Missing facedetect (see http://www.thregr.org/~wavexx/hacks/facedetect/'
++  if $facedet && !cmd_exists('facedetect');
++fatal 'Missing tificc executable (from lcms2 library)'
++  if $sRGB && !cmd_exists('tificc');
  my $exiftrancmd;
 -if($orient)
 +while($orient)
  {
 -  if(!system("exiftran -h >/dev/null 2>&1")) {
-+  if(system("exiftran -h >/dev/null 2>&1")) {
++  if(cmd_exists('exiftran')) {
      $exiftrancmd = "exiftran -aip";
 -  } elsif(!system("exifautotran >/dev/null 2>&1")) {
 +    last;
 +  }
-+  if(system("exifautotran >/dev/null 2>&1")) {
++  if(cmd_exists('exifautotran')) {
      $exiftrancmd = "exifautotran";
 -  } else {
 -    fatal("cannot execute exiftran or exifautotran for lossless JPEG autorotation");
 +    last;
    }
++  fatal 'Missing exiftran or exifautotran executable for JPEG autorotation'
++    unless $exiftrancmd;
  }
-+fatal("cannot execute exiftran or exifautotran for lossless JPEG autorotation")
-+  if $orient && ! defined $exiftrancmd;
  
  # list available files
- my @files;
index 9ea46e001578209fb50303b2643c6ea7c0fb5ef3..ef004502e28d968bd3ba2c6b4ee99193427bb19e 100644 (file)
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2005/03/04 19:04:20 oht Exp $
+$NetBSD: patch-ae,v 1.1.1.1 2015/10/11 19:04:20 ast Exp $
 Pass a code ref as expected
 --- fgallery.orig      2014-09-05 16:33:54.000000000 +0200
 +++ fgallery   2015-10-02 11:10:05.000000000 +0200
index ea1086f874688798917b8ac4e46ce647d36fddef..66d16ae881798ca4b4c60e07daf417681c3699dc 100644 (file)
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2005/03/04 19:04:20 oht Exp $
+$NetBSD: patch-af,v 1.1.1.1 2015/10/11 19:04:20 ast Exp $
 Don't use bare variable for filehandle
 --- fgallery.orig      2014-09-05 16:33:54.000000000 +0200
 +++ fgallery   2015-10-02 11:10:05.000000000 +0200