debian/0000775000000000000000000000000012310122207007156 5ustar debian/copyright0000664000000000000000000000102211467202775011131 0ustar Package: xcftools Author: Henning Makholm Files: * Copyright: (C) 2006-2009 Henning Makholm License: Public Domain Files: gimp/* Copyright: (C) 1995-1997 Peter Mattis and Spencer Kimball License: GPL-2+ Files: debian/* Copyright: (C) 2006 Henning Makholm (C) 2009 Jan Hauke Rahm License: GPL-2+ On Debian systems, the complete text of version 2 of the GNU General Public License can be found in "/usr/share/common-licenses/GPL-2". debian/README.Debian0000664000000000000000000000303011467202775011240 0ustar xcftools (1.0.7-1) unstable; urgency=high * Recommendation of x11-common is switched to suggestion. Also xfree86-common is droped since it's not in the archive any more. -- Jan Hauke Rahm Wed, 08 Jul 2009 19:02:11 +0200 xcftools (1.0.2-1) unstable; urgency=low This package recommends 1) x11-common or xfree86-common to provide the X11 color name database. Without one of these packages, background colors can only be specfied numerically. 2) mime-support to provide /etc/mailcap. Without this package, xcfview will work only for users who have written a .mailcap file in their home directory. 3) One of several packages that provide a viewer for PNG or PPM files. Such a viewer is necessary for xcfview to work. The recommended packages all register the viewer in /etc/mailcap. There are also a number of image viewers in Debian that do not register themselves in /etc/mailcap; you can use one of these instead of the recommended ones if you write a definition for image/png or image/x-portable-pixmap in the user section of /etc/mailcap. Afterwards you may want to file a "wishlist" bug report for the image viewer to supply its own mailcap line. Conversely, if you find a viewer in Debian that does register itself in /etc/mailcap but does not appear in the recommendation list of "unstable" xcftools, please file a "wishlist" bug to have it added. -- Henning Makholm Wed, 22 Feb 2006 21:29:28 +0100 debian/xcftools.mime0000664000000000000000000000016611467202775011720 0ustar image/xcf; xcfview '%s'; priority=5 image/x-xcf; xcfview '%s'; priority=5 application/x-xcf; xcfview '%s'; priority=5 debian/changelog0000664000000000000000000001160512310122201011025 0ustar xcftools (1.0.7-4ubuntu1) trusty; urgency=low * Use autotools-dev helper for newer arches. -- Daniel T Chen Wed, 12 Mar 2014 14:16:03 -0400 xcftools (1.0.7-4) unstable; urgency=low * [c4ec39b3] Fix FTBFS when linking --as-needed. Thanks to Felix Geyer , Michael Bienia (Closes: #647504) * [a5c514f9] Switch to dh9, link --as-needed, build with hardening flags * [423bfff4] Bump Standards-Version to 3.9.3 -- Jan Hauke Rahm Thu, 23 Feb 2012 14:06:22 +0100 xcftools (1.0.7-3) unstable; urgency=low * [3b10c637] Use dh-autoreconf and leave all the rest to debhelper * [2049ef96] Remove patches after building * [7fcb49ba] Allow parallel building * [c40088b8] Apply patch to build with libpng-1.5. Thanks to Nobuhiro Iwamatsu * [c148d1ac] Bump Standards-Version to 3.9.2 -- Jan Hauke Rahm Tue, 20 Sep 2011 18:25:36 +0200 xcftools (1.0.7-2) unstable; urgency=low * Fix uninitialized variables error which made xcfview unusable. Thanks and kudos to Anthony DeRobertis (Closes: #572660) * Bumped Standards-Version: 3.8.4 * Switched to Source Format 3.0 (quilt) -- Jan Hauke Rahm Fri, 05 Mar 2010 23:30:32 +0100 xcftools (1.0.7-1) unstable; urgency=high * Adopted (Closes: #525920) + with urgency=high for the security issue + with new debian/copyright according to upstream's relicensing * New upstream release (1.0.7) + Fix GPL-to-PD transition: missed copyright blurb in online banner. * IMPORTANT CHANGE: xcfview is rewritten to use xdg-utils in order to find an image viewer instead of parsing /etc/mailcap on its own * New upstream release (1.0.6) + Change licensing from GPL-2 to PD. + Fix bug: A layer without an alpha channel bug with an active layer mask was wrongly considered to obscure all lower layers. + Fix bug: xcf2pnm would guess PBM as the output format even if the background was explicitly set to an intermediate gray, or if -T might produce grays. * New upstream release (1.0.5) + Fix various bugs if extracted part of image contains pixels with negative canvas-based coordinates. Thanks Jörgen Grahn (Closes: #533361, CVE-2009-2175) + Minor manpage fixes; -C description should be less confusing now. + $(DESTDIR) honored in Makefile's install target * Use quilt for patches * Bump standards-version: 3.8.2 * Added debian/watch * Switched to debhelper 7 * debian/control: Reorganized Recommends and Suggests -- Jan Hauke Rahm Tue, 14 Jul 2009 17:02:09 +0200 xcftools (1.0.4-2) unstable; urgency=low * QA upload. + Set maintainer to Debian QA Group . * Remove strip from Makefile.in. (Closes: #438290). * Update syntax in debian/copyright. * Make clean not ignore errors. * Bump debhelper build-dep version to >= 5.0.0. * Move DH_COMPAT from rules to debian/compat and set to 5. * Bump Standards Version to 3.8.1. -- Barry deFreese Tue, 28 Apr 2009 13:19:55 -0400 xcftools (1.0.4-1) unstable; urgency=low * New upstream version, adding workaround to read certain buggy XCF files produced by historic instances of the Gimp. -- Henning Makholm Sun, 14 May 2006 04:12:20 +0200 xcftools (1.0.3-1) unstable; urgency=low * New upstream version * Look for color name database in the locations werher x11-common 7.*.* provides it. -- Henning Makholm Mon, 17 Apr 2006 04:19:09 +0200 xcftools (1.0.2-1) unstable; urgency=low * New upstream version - Adds --autocrop option; closes: #353883 - Uses full-word syntactic metavariables in manpage and --helo output; closes: #353872 * Recommend x11-common for X11 color name database * Add README.Debian to explain package recommendations. -- Henning Makholm Wed, 22 Feb 2006 21:16:11 +0100 xcftools (1.0.1-1) unstable; urgency=low * New upstream version, fixing lack of fatality when color name database is needed but not found. This was caught by the self-test and made 1.0-1 FTBFS on a number of buildds. -- Henning Makholm Mon, 20 Feb 2006 04:16:16 +0100 xcftools (1.0-1) unstable; urgency=low * New upstream version. - xcfview wrapper script - add Danish (da) translation - more layer modes supported * Provide full GPL blurb in changelog file. * Pull config.{guess,sub} from autotools-dev at build time. * New SUPPRESS_AUTOFOO hook prevents buildds from ever trying to run autofoo stuff by themselves, timestamp skew be damned. -- Henning Makholm Mon, 20 Feb 2006 01:57:52 +0100 xcftools (0.7.1-1) unstable; urgency=low * Initial upload. Closes: #349424 -- Henning Makholm Sun, 29 Jan 2006 05:10:21 +0100 debian/dirs0000664000000000000000000000003311467202775010063 0ustar usr/bin usr/share/man/man1 debian/patches/0000775000000000000000000000000011721433276010625 5ustar debian/patches/remove_strip_from_Makefile0000664000000000000000000000106711467202775016117 0ustar Remove strip from Makefile.in (change made in 1.0.4-2 by bdefreese, just moving it to a proper patch) Index: xcftools-1.0.7/Makefile.in =================================================================== --- xcftools-1.0.7.orig/Makefile.in +++ xcftools-1.0.7/Makefile.in @@ -89,8 +89,7 @@ install: all for p in $(BINARIES) ; do \ - case $$p in xcfview) strip= ;; *) strip=-s ;; esac ; \ - $(INSTALL_PROGRAM) $$strip $$p \ + $(INSTALL_PROGRAM) $$p \ $(DESTDIR)$(bindir)/`echo $$p | $(SED) $(program_transform_name)` \ || exit 1 ;\ done debian/patches/libpng-1.50000664000000000000000000000054211636137155012327 0ustar --- xcftools-1.0.7.orig/xcf2png.c +++ xcftools-1.0.7/xcf2png.c @@ -59,7 +59,14 @@ my_error_callback(png_structp png_ptr, p FatalUnexpected(_("Libpng error '%s'"),errormsg); } - +#ifndef png_voidp_NULL +#define png_voidp_NULL NULL +#endif + +#ifndef png_error_ptr_NULL +#define png_error_ptr_NULL NULL +#endif + static void init_output(void) { debian/patches/use_xdg_for_mime_type_handling0000664000000000000000000001701411467206561016775 0ustar Use xdg-utils instead of parsing /etc/mailcap here and trying to find an image viewer. Makes depencies easier for Debian. --- a/xcfview.in +++ b/xcfview.in @@ -2,133 +2,40 @@ # # xcfview: a wrapper script that uses xcftools and an external viewer # to display XCF images. The external viewer is found through the -# mailcap(5) database (q.v.). +# mailcap(5) database (q.v.) by using xdg-utils. # # Written by Henning Makholm # Derived from the run-mailcap script by Brian White # -# This script has been placed in the public domain (by both authors) -# -# We cannot use run-mailcap as-is because we can supply the flattened -# image either as PNG and PPM, and we need to find the highest-ranked -# viewer that can handle _one_ of these two. If everything else is equal -# we try to prefer a PNG viewer such that transparency is handled properly. +# In 2009 almost entirely rewritten by Jan Hauke Rahm +# to make use of xdg-utils instead of parsing /etc/mailcap on its own +# That makes handling of dependencies *way* easier in Debian # +# This script has been placed in the public domain (by both authors) use strict ; use warnings ; +use File::Temp qw/ tempfile /; my $debug=0; -my $quotedsemi = "\001" ; -my $quotedprct = "\002" ; - -sub ReadMailcap { - my($file) = @_; - my $line = ""; - - return unless -r $file; - - print STDERR " - Reading mailcap file \"$file\"...\n" if $debug; - open(MAILCAP,"<$file") || die "Error: could not read \"$file\" -- $!\n"; - my @mailcap ; - - while () { - chomp; - s/^\s+// if $line; - $line .= $_; - next unless $line; - if ($line =~ m/^\s*\#/) { - $line = ""; - next; - } - if ($line =~ m/\\$/) { - $line =~ s/\\$//; - } else { - $line =~ s/\\;/$quotedsemi/go; - $line =~ s/\\%/$quotedprct/go; - push @mailcap,$line; - $line = ""; - } - } - close MAILCAP; - - return @mailcap ; -} - -sub TempFile { - my($match) = @_; - my($cmd,$head,$tail,$tmpfile); - - ($head,$tail) = split(/%s/,$1,2) - if ($match =~ m/nametemplate=(.*?)\s*($|;)/); - - $cmd = "tempfile --mode=600"; - $cmd .= " --prefix $head" if $head; - $cmd .= " --suffix $tail" if $tail; - $tmpfile = `$cmd`; - chomp($tmpfile); +my $png_prog = `xdg-mime query default image/png`; +my $pnm_prog = `xdg-mime query default image/x-portable-pixmap`; - return $tmpfile; -} - -my ($useline,$usecomm,$useprogram,$usetype,@converter) ; -foreach my $mailcap ( $ENV{MAILCAPS} ? split(/:/,$ENV{MAILCAPS}) : - ( "$ENV{HOME}/.mailcap", - qw( /etc/mailcap - /usr/local/etc/mailcap - /usr/share/etc/mailcap - /usr/etc/mailcap - ) ) ) { - foreach ( ReadMailcap($mailcap) ) { - my ($type,$comm,$program,$rest) - = m"^image/(png|x-portable-pixmap)\s*;\s*((\S*).*?)\s*($|;.*)" - or next ; - print STDERR " - checking $mailcap entry \"$_\"\n" if $debug; - next if $rest =~ /;\s*needsterminal\s*($|;)/ ; - next if $rest =~ /;\s*copiousoutput\s*($|;)/ ; - if( $rest =~ m/;\s*test=(.*?)\s*($|;)/ ) { - my $test; - print STDERR " - running test: $1 " if $debug; - $test = system "$1 >/dev/null 2>&1"; - $test >>= 8; - print STDERR " (result=$test=",($test!=0?"false":"true"),")\n" - if $debug; - next if $test ; - } - # If we get down here, we have a possible hit. - if( $type ne 'png' ) { - # Save for later; if there is a PNG definition for the same - # command, we will prefer PNG - ($useline,$usecomm,$useprogram,$usetype,@converter) - = ($rest,$comm,$program,$type,"xcf2pnm","-c","'-#'") - unless @converter ; - next ; - } else { - # use this definition _unless_ we have already seen and saved - # a definition for a _different_ program (which must have been PPM) - ($useline,$usecomm,$useprogram,$usetype,@converter) - = ($rest,$comm,$program,$type,"xcf2png") - unless @converter && $comm eq $useprogram ; - last ; - } - } - last if @converter ; -} - -unless( @converter ) { +my (@converter, $usecomm); +if ($png_prog) { + @converter = ("xcf2png"); + $usecomm = $png_prog; +} elsif ($pnm_prog) { + @converter = ("xcf2pnm","-c","'-#'"); + $usecomm = $pnm_prog; +} else { print STDERR "$0: No appropriate way to display PPM or PNG images in mailcap\n" ; exit 1 ; } -sub finishcomm() { - $usecomm =~ s!([^%])%t!$1$usetype!g; - $usecomm =~ s!%{(.*?)}!$_="'$ENV{$1}'";s/\`//g;$_!ge; - $usecomm =~ s!\\(.)!$1!g; - $usecomm =~ s!\'\'!\'!g; - $usecomm =~ s!$quotedsemi!;!go; - $usecomm =~ s!$quotedprct!%!go; -} +$usecomm =~ s/\.desktop$//; +$usecomm =~ s/\n$//; # quote arguments for converter for( @ARGV ) { @@ -137,27 +44,17 @@ $_ = "'$_'" ; } -if( $usecomm =~ /[^%]%s/ ) { - my $tempfile = TempFile($useline); - $usecomm =~ s/([^%])%s/$1$tempfile/g ; - finishcomm() ; - my $retcode = 0 ; - for my $comm ( join(" ",@converter,"-o",$tempfile,@ARGV), - $usecomm ) { - print STDERR " - executing: $comm\n" if $debug ; - my $res = system $comm; - $res = int($res/256); - if ($res != 0) { - print STDERR "Warning: program returned non-zero exit code \#$res\n"; - $retcode = $res; - last ; - } +my ($fh, $tempfile) = tempfile(UNLINK => 1); +my $retcode = 0 ; +for my $comm ( join(" ",@converter,"-o",$tempfile,@ARGV), + join(" ",$usecomm,$tempfile) ) { + print STDERR " - executing: $comm\n" if $debug ; + my $res = system $comm; + $res = int($res/256); + if ($res != 0) { + print STDERR "Warning: program returned non-zero exit code \#$res\n"; + $retcode = $res; + last ; } - unlink $tempfile ; - exit $retcode ; -} else { - finishcomm() ; - exec( join(@converter," ",@ARGV) . " | " . $usecomm ) - or print STDERR "Couldn't exec pipeline: $!\n" ; - exit 1 ; } +exit $retcode ; --- a/xcfview.10 +++ b/xcfview.10 @@ -13,7 +13,7 @@ .\" .\" If you use or distribute this code, I would appreciate receiving .\" credit for writing it, in whichever way you find proper and customary. -.TH xcf2pnm 1 2006-02-12 "Xcftools" "" +.TH xcf2pnm 1 2009-07-12 "Xcftools" "" .SH NAME xcfview \- display GIMP xcf files .ds p xcfview @@ -33,9 +33,9 @@ or .BR xcf2pnm (1) (q.v.) to flatten an XCF image and then displays the flattened -image using a PNG or PPM viewer found using the -.BR mailcap (5) -database. +image using a PNG or PPM viewer found using +.BR xdg-open (1) +from the xdg-utils package. .SH OPTIONS Every command-line parameter to .B xcfview @@ -44,7 +44,7 @@ or .B xcf2pnm command. Because it is not certain which converter will be used, -the options given should be ones that make sense for both of these: +the options given should be ones that make sense for both of these. .so xcfview.1i .SH EXIT STATUS The exit status is 0 in case of success. A nonzero exit status may @@ -57,7 +57,10 @@ .P Parts of the script originate from the .BR run-mailcap (1) -script by Brian White . +script by Brian White but are superseded by the Debian +specific changes of Jan Hauke Rahm (to make use of +xdg-utils). .SH SEE ALSO .BR xcf2pnm (1), -.BR xcf2png (1) +.BR xcf2png (1), +.BR xdg-open (1) debian/patches/fix-as-needed-linking0000664000000000000000000000217311721433236014611 0ustar Index: xcftools-1.0.7/Makefile.in =================================================================== --- xcftools-1.0.7.orig/Makefile.in 2010-12-05 12:12:02.000000000 +0100 +++ xcftools-1.0.7/Makefile.in 2010-12-05 12:12:56.000000000 +0100 @@ -71,21 +71,21 @@ all: $(BINARIES) $(SCRIPTS) $(MANPAGES) po/stamp manpo/all xcfinfo$e: xcfinfo.$o $(FILEIO).$o enums.$o xcf-general.$o utils.$o nlsini.$o - $(CC) $(LDFLAGS) $(LIBS) $^ -o $@ + $(CC) $(LDFLAGS) $^ -o $@ $(LIBS) xcf2pnm$e: xcf2pnm.$o $(FILEIO).$o enums.$o xcf-general.$o utils.$o nlsini.$o \ pixels.$o flatten.$o flatspec.$o scaletab.$o table.$o - $(CC) $(LDFLAGS) $(LIBS) $^ -o $@ + $(CC) $(LDFLAGS) $^ -o $@ $(LIBS) xcf2png$e: xcf2png.$o $(FILEIO).$o enums.$o xcf-general.$o utils.$o nlsini.$o \ pixels.$o flatten.$o flatspec.$o scaletab.$o table.$o palette.$o - $(CC) $(LDFLAGS) $(LIBS) -lpng $^ -o $@ + $(CC) $(LDFLAGS) $^ -o $@ $(LIBS) -lpng xcfview: xcfview.in Makefile sed '1s,/usr/bin/perl,@PERL@,' < $< > $@ testscale$e: testscale.$o - $(CC) $(LDFLAGS) $(LIBS) $^ -o $@ + $(CC) $(LDFLAGS) $^ -o $@ $(LIBS) install: all for p in $(BINARIES) ; do \ debian/patches/series0000664000000000000000000000013311721433236012033 0ustar use_xdg_for_mime_type_handling remove_strip_from_Makefile libpng-1.5 fix-as-needed-linking debian/watch0000664000000000000000000000011011467202775010224 0ustar version=3 http://henning.makholm.net/xcftools/xcftools-([\d\.]+).tar.gz debian/control0000664000000000000000000000360012310122124010556 0ustar Source: xcftools Section: graphics Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Jan Hauke Rahm Build-Depends: debhelper (>= 9), autotools-dev, libpng12-dev, netpbm, dh-autoreconf Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/collab-maint/xcftools.git Vcs-Browser: http://git.debian.org/?p=collab-maint/xcftools.git;a=summary Package: xcftools Architecture: any Depends: xdg-utils, ${shlibs:Depends}, ${misc:Depends} Recommends: mime-support Suggests: x11-common, gimp Enhances: gimp Description: command-line tools for extracting data for XCF files This is a set of fast command-line tools for extracting information from the Gimp's native file format XCF. The tools are designed to allow efficient use of layered XCF files as sources in a build system that use 'make' and similar tools to manage automatic processing of the graphics. These tools work independently of the Gimp engine and do not require the Gimp to even be installed. . "xcf2pnm" converts XCF files to ppm, pgm or pbm format, flattening layers if necessary. If the image contains transparency, an alpha map can be written to a separate file, or a background color can be specified on the command line. . "xcf2png" converts XCF files to PNG format, flattening layers if necessary. Transparency information can be kept in the image, or a background color can be specified on the command line. . "xcfinfo" lists information about layers in an XCF file. . "xcfview" is a wrapper script that flattens an XCF image and displays it using an external PNG/PPM viewer. To use this script, you must make sure also to install an appropriate external viewer, as well as the mime-support package which provides the mailcap database. . The tools can either flatten an XCF file as given, or extract specific layers named on the command line. debian/source/0000775000000000000000000000000011636137155010500 5ustar debian/source/format0000664000000000000000000000001411467206602011702 0ustar 3.0 (quilt) debian/compat0000664000000000000000000000000211721431774010375 0ustar 9 debian/rules0000775000000000000000000000036612310122141010240 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow,+pie export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: dh $@ --with autotools_dev,autoreconf --parallel