From 9f01cda55d519406248fc095667442575b7329f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Thu, 4 Dec 2014 19:57:41 +0100 Subject: Many work to make DebSrc3 fit --- debian/changelog | 30 +++ debian/compat | 2 +- debian/control | 46 +++- debian/copyright | 270 ++++++++++++++++++--- debian/patches/00list | 7 - debian/patches/01_xcam.c_dead_code.dpatch | 29 --- debian/patches/01_xcam.c_dead_code.patch | 25 ++ debian/patches/02_xcam_man_typo.dpatch | 39 --- debian/patches/02_xcam_man_typo.patch | 35 +++ debian/patches/03_scanadf_options_fix.dpatch | 46 ---- debian/patches/03_scanadf_options_fix.patch | 42 ++++ debian/patches/04_cap_always_settable.dpatch | 21 -- debian/patches/04_cap_always_settable.patch | 17 ++ debian/patches/05_xcam_off_by_one.dpatch | 19 -- debian/patches/05_xcam_off_by_one.patch | 15 ++ debian/patches/06_word_list_fix.dpatch | 42 ---- debian/patches/06_word_list_fix.patch | 38 +++ .../patches/100_xscanimage_c-out-of-bounds.patch | 18 ++ debian/patches/20_scanadf-SIGCHLD.patch | 19 ++ debian/patches/25_manpages-typo.patch | 62 +++++ debian/patches/scanadf-sigchld.diff | 11 + debian/patches/series | 9 + debian/rules | 99 +------- debian/sane.dirs | 1 + debian/sane.install | 2 + debian/sane.links | 1 + debian/sane.manpages | 1 + debian/source/format | 1 + debian/watch | 5 + 29 files changed, 622 insertions(+), 330 deletions(-) delete mode 100644 debian/patches/00list delete mode 100644 debian/patches/01_xcam.c_dead_code.dpatch create mode 100644 debian/patches/01_xcam.c_dead_code.patch delete mode 100644 debian/patches/02_xcam_man_typo.dpatch create mode 100644 debian/patches/02_xcam_man_typo.patch delete mode 100644 debian/patches/03_scanadf_options_fix.dpatch create mode 100644 debian/patches/03_scanadf_options_fix.patch delete mode 100644 debian/patches/04_cap_always_settable.dpatch create mode 100644 debian/patches/04_cap_always_settable.patch delete mode 100644 debian/patches/05_xcam_off_by_one.dpatch create mode 100644 debian/patches/05_xcam_off_by_one.patch delete mode 100644 debian/patches/06_word_list_fix.dpatch create mode 100644 debian/patches/06_word_list_fix.patch create mode 100644 debian/patches/100_xscanimage_c-out-of-bounds.patch create mode 100644 debian/patches/20_scanadf-SIGCHLD.patch create mode 100644 debian/patches/25_manpages-typo.patch create mode 100644 debian/patches/scanadf-sigchld.diff create mode 100644 debian/patches/series create mode 100644 debian/sane.install create mode 100644 debian/sane.links create mode 100644 debian/sane.manpages create mode 100644 debian/source/format create mode 100644 debian/watch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 8e5d929..4eaa279 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +sane-frontends (1.0.14-10) unstable; urgency=medium + + * New maintainer (Close: #688556). + * debian/control: + - Add myself as maintainer. + - Bump Standards-Version to 3.9.6. + - Package sane: + - Add ${misc:Depends} to Depends. + - Remove useless "Section: graphics". + - Add homepage. + - Add Vcs-* to new git repository. + * debian/compat: + - Change from 5 to 9. + * New debian/source/format + - Set to "3.0 (quilt)". + * Convert patches from dpatch to quilt. + * Rewrite debian/copyright. + * Rewrite builtsystem to dh and DebSrc3.0 (Closes: #670380): + - Rewrite debian/rules. + - New sane.links + * Add debian/watch. + * debian/patches: + - New 20_scanadf-SIGCHLD.patch (Closes: #596232): + - Sets SIGCHLD to SIG_DFL before execle(). + - New 25_manpages-typo.patch (Closes: #612686): + - Correct some typos. + * New package sane-dbg. + + -- Jörg Frings-Fürst Thu, 04 Dec 2014 13:54:54 +0100 + sane-frontends (1.0.14-9) unstable; urgency=low * debian/control: diff --git a/debian/compat b/debian/compat index 7ed6ff8..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/debian/control b/debian/control index b6c7ba5..cc3c222 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,23 @@ Source: sane-frontends Section: graphics Priority: optional -Maintainer: Julien BLACHE -Standards-Version: 3.8.3 -Build-Depends: debhelper (>= 5), dpatch, libgimp2.0-dev (>= 2.0.0), libgtk2.0-dev, libsane-dev (>= 1.0.11-3), autotools-dev +Maintainer: Jörg Frings-Fürst +Standards-Version: 3.9.6 +Build-Depends: + autotools-dev, + debhelper (>= 9), + libgimp2.0-dev (>= 2.0.0), + libgtk2.0-dev, + libsane-dev (>= 1.0.11-3), +Homepage: http://www.sane-project.org +Vcs-Git: git://anonscm.debian.org/collab-maint/sane-frontends.git +Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/sane-frontends.git Package: sane -Section: graphics Architecture: any -Depends: ${shlibs:Depends} +Depends: + ${misc:Depends}, + ${shlibs:Depends} Suggests: gimp Description: scanner graphical frontends This package includes : @@ -27,3 +36,30 @@ Description: scanner graphical frontends operating systems, including GNU/Linux, OS/2, Win32 and various Unices and is available under the GNU General Public License (commercial applications and backends are welcome, too, however). + +Package: sane-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + ${misc:Depends}, + sane (= ${binary:Version}) +Description: scanner graphical frontends (debug symbols) + This package includes : + o xscanimage, a scanner graphical frontend with GIMP 2.0 support + o scanadf, a command-line frontend for scanners with Automatic Document Feeder + o xcam, for acquiring images continuously from cameras. + . + An alternative to xscanimage called xsane is packaged separately. + . + The scanner frontends use SANE. SANE stands for "Scanner Access Now + Easy" and is an application programming interface (API) that provides + standardized access to any raster image scanner hardware (flatbed + scanner, hand-held scanner, video- and still-cameras, frame-grabbers, + etc.). The SANE standard is free and its discussion and development are + open to everybody. The current source code is written to support several + operating systems, including GNU/Linux, OS/2, Win32 and various Unices + and is available under the GNU General Public License (commercial + applications and backends are welcome, too, however). + . + This package contains the debugging symbols for the SANE frontends. diff --git a/debian/copyright b/debian/copyright index 8c5b2d6..fe9f872 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,36 +1,252 @@ -This package was first debianized by Kevin Dalley kevind@rahul.net. -It is now maintained by Julien BLACHE and -Aurélien JARNO . +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: sane-backends +Upstream-Contact: +Source: ftp://ftp.sane-project.org/pub/sane/ -It was downloaded from: ftp://ftp.sane-project.org/pub/sane/ +Files: * +Copyright: 1995 Spencer Kimball + 1995 Peter Mattis + 1997-1998 David Mosberger + 1997 Tristan Tarrant + 1997-1998 Andreas Beck + 1999 Tom Martone +License: GPL-2+ with sane exception -Upstream Authors: - see /usr/share/doc/sane/AUTHORS +Files: debian/* +Copyright: 1997-2002 Kevin Dalley + 2002-2009 Julien BLACHE + 2014 Jörg Frings-Fürst +License: GPL-2+ with sane exception -Copyright: - Copyright (C) 1995 Spencer Kimball - Copyright (C) 1995 Peter Mattis - Copyright (C) 1997, 1998 David Mosberger - Copyright (C) 1997 Tristan Tarrant - Copyright (C) 1997, 1998 Andreas Beck - Copyright (C) 1999 Tom Martone +Files: include/*.h + lib/getopt.c + lib/getopt1.c + lib/strdup.c + lib/strndup.c + lib/strsep.c + lib/usleep.c + lib/vsyslog.c +Copyright: 1989-1996 Free Software Foundation, Inc. +License: GPL-2+ -License: +Files: include/sane/sanei.h +Copyright: 1996 David Mosberger-Tang + 1996 Andreas Beck + 2002-2003 Henning Meier-Geinitz +License: GPL-2+ with sane exception - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. +Files: include/sane/sanei_codec_*.h +Copyright: 1996 David Mosberger-Tang + 1996 Andreas Beck +License: GPL-2+ with sane exception - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +Files: include/sane/sanei_wire.h +Copyright: 1996 David Mosberger-Tang +License: GPL-2+ with sane exception - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Files: lib/snprintf.c +Copyright: 1988-1997 Patrick Powell +License: Artistic-1.0 +Files: sanei/* +Copyright: 1996 David Mosberger-Tang +License: GPL-2+ with sane exception -On Debian systems, a copy of the GNU General Public License (GPL) is available -in the file /usr/share/common-licenses/GPL. +Files: sanei/sanei_init_debug.c +Copyright: 1996-1997 David Mosberger-Tang + 1996-1997 Andreas Beck +License: GPL-2+ with sane exception + +Files: sanei/sanei_thread.c +Copyright: 1998-2001 Yuri Dario + 2003-2004 Gerhard Jaeger +License: GPL-2+ with sane exception + +Files: src/gtkglue.c + src/preview.c + src/xcam.c +Copyright: 1997 David Mosberger-Tang + 1997 Tristan Tarrant +License: GPL-2+ + +Files: src/preferences.c + src/preview.h +Copyright: 1997 David Mosberger-Tang +License: GPL-2+ + +Files: src/progress.c +Copyright: 1995 Spencer Kimball + 1995 Peter Mattis + 1996 Tristan Tarrant +License: GPL-2+ + +Files: src/progress.h +Copyright: 1995 Spencer Kimball + 1995 Peter Mattis +License: GPL-2+ + +Files: src/scanadf.c +Copyright: 1999 Tom Martone +License: GPL-2+ + +Files: src/xscanimage.c +Copyright: 1997-1998 Andreas Beck + 1997-1998 Tristan Tarrant + 1997-1998 David Mosberger +License: GPL-2+ + +Files: src/xscanimage-gimp-1_0-compat.h +Copyright: Oliver Rauch +License: GPL-2+ + +Files: lib/alloca.c +Copyright: D A Gwyn +License: public-domain + (Mostly) portable public-domain implementation + +License: Artistic-1.0 + Preamble + . + The intent of this document is to state the conditions under which a Package + may be copied, such that the Copyright Holder maintains some semblance of + artistic control over the development of the package, while giving the users + of the package the right to use and distribute the Package in a more-or-less + customary fashion, plus the right to make reasonable modifications. + . + Definitions: + . + "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through textual + modification. + . + "Standard Version" refers to such a Package if it has not been modified, or + has been modified in accordance with the wishes of the Copyright Holder. + . + "Copyright Holder" is whoever is named in the copyright or copyrights for the + package. + . + "You" is you, if you're thinking about copying or distributing this Package. + . + "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will not + be required to justify it to the Copyright Holder, but only to the computing + community at large as a market that must bear the fee.) + . + "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that recipients + of the item may redistribute it under the same conditions they received it. + . + 1. You may make and give away verbatim copies of the source form of the + Standard Version of this Package without restriction, provided that you + duplicate all of the original copyright notices and associated disclaimers. + . + 2. You may apply bug fixes, portability fixes and other modifications derived + from the Public Domain or from the Copyright Holder. A Package modified in + such a way shall still be considered the Standard Version. + . + 3. You may otherwise modify your copy of this Package in any way, provided that + you insert a prominent notice in each changed file stating how and when you + changed that file, and provided that you do at least ONE of the following: + . + a) place your modifications in the Public Domain or otherwise make them Freely + Available, such as by posting said modifications to Usenet or an equivalent + medium, or placing the modifications on a major archive site such as + ftp.uu.net, or by allowing the Copyright Holder to include your modifications + in the Standard Version of the Package. + b) use the modified Package only within your corporation or organization. + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + d) make other distribution arrangements with the Copyright Holder. + . + 4. You may distribute the programs of this Package in object code or + executable form, provided that you do at least ONE of the following: + . + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard names, + and clearly documenting the differences in manual pages (or equivalent), + together with instructions on where to get the Standard Version. + d) make other distribution arrangements with the Copyright Holder. + . + 5. You may charge a reasonable copying fee for any distribution of this + Package. You may charge any fee you choose for support of this Package. You + may not charge a fee for this Package itself. However, you may distribute this + Package in aggregate with other (possibly commercial) programs as part of a + larger (possibly commercial) software distribution provided that you do not + advertise this Package as a product of your own. + . + 6. The scripts and library files supplied as input to or produced as output + from the programs of this Package do not automatically fall under the + copyright of this Package, but belong to whomever generated them, and may be + sold commercially, and may be aggregated with this Package. + . + 7. C or perl subroutines supplied by you and linked into this Package shall + not be considered part of this Package. + . + 8. The name of the Copyright Holder may not be used to endorse or promote + products derived from this software without specific prior written permission. + . + 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +License: GPL-2+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + The complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-2 file. + +License: GPL-2+ with sane exception + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + The complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-2 file. + . + As a special exception, the authors of SANE give permission for + additional uses of the libraries contained in this release of SANE. + . + The exception is that, if you link a SANE library with other files + to produce an executable, this does not by itself cause the + resulting executable to be covered by the GNU General Public + License. Your use of that executable is in no way restricted on + account of linking the SANE library code into it. + . + This exception does not, however, invalidate any other reasons why + the executable file might be covered by the GNU General Public + License. + . + If you submit changes to SANE to the maintainers to be included in + a subsequent release, you agree by submitting the changes that + those changes may be distributed with this exception intact. + . + If you write modifications of your own for SANE, it is your choice + whether to permit this exception to apply to your modifications. + If you do not wish that, delete this exception notice. diff --git a/debian/patches/00list b/debian/patches/00list deleted file mode 100644 index d65c845..0000000 --- a/debian/patches/00list +++ /dev/null @@ -1,7 +0,0 @@ -01_xcam.c_dead_code -02_xcam_man_typo -03_scanadf_options_fix -04_cap_always_settable -05_xcam_off_by_one -06_word_list_fix - diff --git a/debian/patches/01_xcam.c_dead_code.dpatch b/debian/patches/01_xcam.c_dead_code.dpatch deleted file mode 100644 index 41a33e0..0000000 --- a/debian/patches/01_xcam.c_dead_code.dpatch +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 01_xcam.c_dead_code.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Remove dead code in src/xcam.c::load_defaults() - -@DPATCH@ -diff -urNad sane-frontends-1.0.14~/src/xcam.c sane-frontends-1.0.14/src/xcam.c ---- sane-frontends-1.0.14~/src/xcam.c 2005-09-20 19:30:01.000000000 +0200 -+++ sane-frontends-1.0.14/src/xcam.c 2005-09-20 19:30:59.289245755 +0200 -@@ -536,16 +536,14 @@ - load_defaults (int silent) - { - char filename[PATH_MAX]; -- int fd; - - DBG (DBG_debug, "xcam, load_defaults: enter\n"); - if (make_default_filename (sizeof (filename), filename, dialog->dev_name) - < 0) - return; -- if (fd < 0) -- return; -+ - load_settings (filename, silent); -- sanei_load_values (fd, dialog->dev); -+ - DBG (DBG_debug, "xcam, load_defaults: exit\n"); - } - diff --git a/debian/patches/01_xcam.c_dead_code.patch b/debian/patches/01_xcam.c_dead_code.patch new file mode 100644 index 0000000..f90bc6b --- /dev/null +++ b/debian/patches/01_xcam.c_dead_code.patch @@ -0,0 +1,25 @@ +Author: +Description: Remove dead code in src/xcam.c::load_defaults() +Index: trunk/src/xcam.c +=================================================================== +--- trunk.orig/src/xcam.c ++++ trunk/src/xcam.c +@@ -536,16 +536,14 @@ static void + load_defaults (int silent) + { + char filename[PATH_MAX]; +- int fd; + + DBG (DBG_debug, "xcam, load_defaults: enter\n"); + if (make_default_filename (sizeof (filename), filename, dialog->dev_name) + < 0) + return; +- if (fd < 0) +- return; ++ + load_settings (filename, silent); +- sanei_load_values (fd, dialog->dev); ++ + DBG (DBG_debug, "xcam, load_defaults: exit\n"); + } + diff --git a/debian/patches/02_xcam_man_typo.dpatch b/debian/patches/02_xcam_man_typo.dpatch deleted file mode 100644 index cd35ecc..0000000 --- a/debian/patches/02_xcam_man_typo.dpatch +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 02_xcam_man_typo.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Fix various typos in xcam.man. - -@DPATCH@ -diff -urNad sane-frontends-1.0.14~/doc/xcam.man sane-frontends-1.0.14/doc/xcam.man ---- sane-frontends-1.0.14~/doc/xcam.man 2008-03-01 15:30:54.000000000 +0100 -+++ sane-frontends-1.0.14/doc/xcam.man 2008-03-01 15:32:35.802703418 +0100 -@@ -1,4 +1,4 @@ --.TH xcam 1 "11 April 2005" -+.TH xcam 1 "19 February 2008" - .IX xcam - .SH NAME - xcam - a graphical camera frontend for SANE -@@ -12,7 +12,7 @@ - .B xcam - provides a graphical user-interface to control an image - acquisition device such as a flatbed scanner or a camera. It allows --scanning invidual images and can be invoked directly from the command-line. -+scanning individual images and can be invoked directly from the command-line. - - .B xcam - acts as a stand-alone program that saves acquired images in a suitable -@@ -43,12 +43,11 @@ - .PP - The - .B --help (-h) --.B xcam - flag prints a short summary of options. - .PP - .TP - .B SANE_DEBUG_XCAM --This environment variable controls the debug level xscanimage. Higher -+This environment variable controls the debug level of xcam. Higher - debug levels increase the verbosity of the output. - - Value Descsription diff --git a/debian/patches/02_xcam_man_typo.patch b/debian/patches/02_xcam_man_typo.patch new file mode 100644 index 0000000..2421dc8 --- /dev/null +++ b/debian/patches/02_xcam_man_typo.patch @@ -0,0 +1,35 @@ +Author: +Description: Fix various typos in xcam.man. +Index: trunk/doc/xcam.man +=================================================================== +--- trunk.orig/doc/xcam.man ++++ trunk/doc/xcam.man +@@ -1,4 +1,4 @@ +-.TH xcam 1 "11 April 2005" ++.TH xcam 1 "19 February 2008" + .IX xcam + .SH NAME + xcam - a graphical camera frontend for SANE +@@ -12,7 +12,7 @@ xcam - a graphical camera frontend for S + .B xcam + provides a graphical user-interface to control an image + acquisition device such as a flatbed scanner or a camera. It allows +-scanning invidual images and can be invoked directly from the command-line. ++scanning individual images and can be invoked directly from the command-line. + + .B xcam + acts as a stand-alone program that saves acquired images in a suitable +@@ -43,12 +43,11 @@ will output its version number. + .PP + The + .B --help (-h) +-.B xcam + flag prints a short summary of options. + .PP + .TP + .B SANE_DEBUG_XCAM +-This environment variable controls the debug level xscanimage. Higher ++This environment variable controls the debug level of xcam. Higher + debug levels increase the verbosity of the output. + + Value Descsription diff --git a/debian/patches/03_scanadf_options_fix.dpatch b/debian/patches/03_scanadf_options_fix.dpatch deleted file mode 100644 index 4c1b8cb..0000000 --- a/debian/patches/03_scanadf_options_fix.dpatch +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 03_scanadf_options_fix.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Get option descriptor 0 before getting the value for option 0. - -@DPATCH@ -diff -urNad sane-frontends-1.0.14~/src/scanadf.c sane-frontends-1.0.14/src/scanadf.c ---- sane-frontends-1.0.14~/src/scanadf.c 2005-09-18 13:51:00.000000000 +0200 -+++ sane-frontends-1.0.14/src/scanadf.c 2008-08-05 12:00:14.826083326 +0200 -@@ -550,15 +550,33 @@ - const SANE_Option_Descriptor * opt; - SANE_Int num_dev_options; - int i, option_count; -+ SANE_Status status; - - /* and now build the full table of long options: */ - -- sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); -+ opt = sane_get_option_descriptor (device, 0); -+ if (opt == NULL) -+ { -+ fprintf (stderr, "Could not get option descriptor for option 0\n"); -+ exit (1); -+ } -+ -+ status = sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); -+ if (status != SANE_STATUS_GOOD) -+ { -+ fprintf (stderr, "Could not get value for option 0: %s\n", sane_strstatus (status)); -+ exit (1); -+ } - - option_count = 0; -- for (i = 0; i < num_dev_options; ++i) -+ for (i = 1; i < num_dev_options; ++i) - { - opt = sane_get_option_descriptor (device, i); -+ if (opt == NULL) -+ { -+ fprintf (stderr, "Could not get option descriptor for option %d\n", i); -+ exit (1); -+ } - - if (!SANE_OPTION_IS_SETTABLE (opt->cap)) - continue; diff --git a/debian/patches/03_scanadf_options_fix.patch b/debian/patches/03_scanadf_options_fix.patch new file mode 100644 index 0000000..8c1b0c7 --- /dev/null +++ b/debian/patches/03_scanadf_options_fix.patch @@ -0,0 +1,42 @@ +Author: +Description: Get option descriptor 0 before getting the value for option 0. +Index: trunk/src/scanadf.c +=================================================================== +--- trunk.orig/src/scanadf.c ++++ trunk/src/scanadf.c +@@ -550,15 +550,33 @@ fetch_options (SANE_Device * device) + const SANE_Option_Descriptor * opt; + SANE_Int num_dev_options; + int i, option_count; ++ SANE_Status status; + + /* and now build the full table of long options: */ + +- sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); ++ opt = sane_get_option_descriptor (device, 0); ++ if (opt == NULL) ++ { ++ fprintf (stderr, "Could not get option descriptor for option 0\n"); ++ exit (1); ++ } ++ ++ status = sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); ++ if (status != SANE_STATUS_GOOD) ++ { ++ fprintf (stderr, "Could not get value for option 0: %s\n", sane_strstatus (status)); ++ exit (1); ++ } + + option_count = 0; +- for (i = 0; i < num_dev_options; ++i) ++ for (i = 1; i < num_dev_options; ++i) + { + opt = sane_get_option_descriptor (device, i); ++ if (opt == NULL) ++ { ++ fprintf (stderr, "Could not get option descriptor for option %d\n", i); ++ exit (1); ++ } + + if (!SANE_OPTION_IS_SETTABLE (opt->cap)) + continue; diff --git a/debian/patches/04_cap_always_settable.dpatch b/debian/patches/04_cap_always_settable.dpatch deleted file mode 100644 index e812c3d..0000000 --- a/debian/patches/04_cap_always_settable.dpatch +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 04_cap_always_settable.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Remove check for SANE_CAP_ALWAYS_SETTABLE; the flag is not part -## DP: of the standard and has been removed upstream in SANE 1.0.20. - -@DPATCH@ -diff -urNad sane-frontends-1.0.14~/src/gtkglue.c sane-frontends-1.0.14/src/gtkglue.c ---- sane-frontends-1.0.14~/src/gtkglue.c 2005-04-16 15:12:07.000000000 +0200 -+++ sane-frontends-1.0.14/src/gtkglue.c 2009-06-26 13:32:04.997585725 +0200 -@@ -1476,8 +1476,7 @@ - || opt->type == SANE_TYPE_GROUP || !dialog->element[i].widget) - continue; - -- if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE)) -- gtk_widget_set_sensitive (dialog->element[i].widget, sensitive); -+ gtk_widget_set_sensitive (dialog->element[i].widget, sensitive); - } - } - diff --git a/debian/patches/04_cap_always_settable.patch b/debian/patches/04_cap_always_settable.patch new file mode 100644 index 0000000..aef60f1 --- /dev/null +++ b/debian/patches/04_cap_always_settable.patch @@ -0,0 +1,17 @@ +Author: +Description: Remove check for SANE_CAP_ALWAYS_SETTABLE; the flag is not part +of the standard and has been removed upstream in SANE 1.0.20. +Index: trunk/src/gtkglue.c +=================================================================== +--- trunk.orig/src/gtkglue.c ++++ trunk/src/gtkglue.c +@@ -1476,8 +1476,7 @@ gsg_set_sensitivity (GSGDialog * dialog, + || opt->type == SANE_TYPE_GROUP || !dialog->element[i].widget) + continue; + +- if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE)) +- gtk_widget_set_sensitive (dialog->element[i].widget, sensitive); ++ gtk_widget_set_sensitive (dialog->element[i].widget, sensitive); + } + } + diff --git a/debian/patches/05_xcam_off_by_one.dpatch b/debian/patches/05_xcam_off_by_one.dpatch deleted file mode 100644 index deb56a0..0000000 --- a/debian/patches/05_xcam_off_by_one.dpatch +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 05_xcam_off_by_one.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Fix an off-by-one. - -@DPATCH@ -diff -urNad sane-frontends-1.0.14~/src/xcam.c sane-frontends-1.0.14/src/xcam.c ---- sane-frontends-1.0.14~/src/xcam.c 2009-06-26 13:50:19.000000000 +0200 -+++ sane-frontends-1.0.14/src/xcam.c 2009-06-26 13:50:47.774585321 +0200 -@@ -1289,7 +1289,7 @@ - - /* test for pnm formats */ - strncpy (testfilename, preferences.filename, sizeof (testfilename)); -- testfilename[sizeof (testfilename)] = 0; -+ testfilename[sizeof (testfilename) - 1] = 0; - g_strreverse (testfilename); - if (!((!strncmp (testfilename, "mnp.", 4)) || - (!strncmp (testfilename, "mgp.", 4)) || diff --git a/debian/patches/05_xcam_off_by_one.patch b/debian/patches/05_xcam_off_by_one.patch new file mode 100644 index 0000000..0b91cc4 --- /dev/null +++ b/debian/patches/05_xcam_off_by_one.patch @@ -0,0 +1,15 @@ +Author: +Description: Fix an off-by-one. +Index: trunk/src/xcam.c +=================================================================== +--- trunk.orig/src/xcam.c ++++ trunk/src/xcam.c +@@ -1287,7 +1287,7 @@ save_frame_button (GtkWidget * widget, g + + /* test for pnm formats */ + strncpy (testfilename, preferences.filename, sizeof (testfilename)); +- testfilename[sizeof (testfilename)] = 0; ++ testfilename[sizeof (testfilename) - 1] = 0; + g_strreverse (testfilename); + if (!((!strncmp (testfilename, "mnp.", 4)) || + (!strncmp (testfilename, "mgp.", 4)) || diff --git a/debian/patches/06_word_list_fix.dpatch b/debian/patches/06_word_list_fix.dpatch deleted file mode 100644 index 90d223c..0000000 --- a/debian/patches/06_word_list_fix.dpatch +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 06_word_list_fix.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Fix word list handling when current value is not part of the list. - -@DPATCH@ -diff -urNad sane-frontends-1.0.14~/src/gtkglue.c sane-frontends-1.0.14/src/gtkglue.c ---- sane-frontends-1.0.14~/src/gtkglue.c 2009-11-14 10:46:03.248492255 +0100 -+++ sane-frontends-1.0.14/src/gtkglue.c 2009-11-14 10:46:07.941492660 +0100 -@@ -913,6 +913,7 @@ - char **str_list; - int i, j; - int num_vector_opts = 0, *vector_opts; -+ SANE_Bool val_in_list; - - main_hbox = gtk_hbox_new (FALSE, 2); - -@@ -1073,13 +1074,23 @@ - case SANE_CONSTRAINT_WORD_LIST: - /* use a "list-selection" widget */ - num_words = opt->constraint.word_list[0]; -+ if (num_words == 0) -+ { -+ fprintf (stderr, "panel_build: empty word list!\n"); -+ break; -+ } -+ val_in_list = SANE_FALSE; - str_list = malloc ((num_words + 1) * sizeof (str_list[0])); - for (j = 0; j < num_words; ++j) - { -+ if (opt->constraint.word_list[j + 1] == val) -+ val_in_list = SANE_TRUE; - sprintf (str, "%d", opt->constraint.word_list[j + 1]); - str_list[j] = strdup (str); - } - str_list[j] = 0; -+ if (!val_in_list) -+ val = opt->constraint.word_list[1]; - sprintf (str, "%d", val); - option_menu_new (parent, title, str_list, str, elem, - dialog->tooltips, opt->desc, diff --git a/debian/patches/06_word_list_fix.patch b/debian/patches/06_word_list_fix.patch new file mode 100644 index 0000000..683e745 --- /dev/null +++ b/debian/patches/06_word_list_fix.patch @@ -0,0 +1,38 @@ +Author: +Description: Fix word list handling when current value is not part of the list. +Index: trunk/src/gtkglue.c +=================================================================== +--- trunk.orig/src/gtkglue.c ++++ trunk/src/gtkglue.c +@@ -913,6 +913,7 @@ panel_build (GSGDialog * dialog) + char **str_list; + int i, j; + int num_vector_opts = 0, *vector_opts; ++ SANE_Bool val_in_list; + + main_hbox = gtk_hbox_new (FALSE, 2); + +@@ -1073,13 +1074,23 @@ panel_build (GSGDialog * dialog) + case SANE_CONSTRAINT_WORD_LIST: + /* use a "list-selection" widget */ + num_words = opt->constraint.word_list[0]; ++ if (num_words == 0) ++ { ++ fprintf (stderr, "panel_build: empty word list!\n"); ++ break; ++ } ++ val_in_list = SANE_FALSE; + str_list = malloc ((num_words + 1) * sizeof (str_list[0])); + for (j = 0; j < num_words; ++j) + { ++ if (opt->constraint.word_list[j + 1] == val) ++ val_in_list = SANE_TRUE; + sprintf (str, "%d", opt->constraint.word_list[j + 1]); + str_list[j] = strdup (str); + } + str_list[j] = 0; ++ if (!val_in_list) ++ val = opt->constraint.word_list[1]; + sprintf (str, "%d", val); + option_menu_new (parent, title, str_list, str, elem, + dialog->tooltips, opt->desc, diff --git a/debian/patches/100_xscanimage_c-out-of-bounds.patch b/debian/patches/100_xscanimage_c-out-of-bounds.patch new file mode 100644 index 0000000..2249f5a --- /dev/null +++ b/debian/patches/100_xscanimage_c-out-of-bounds.patch @@ -0,0 +1,18 @@ +Description: Correct out-of-bounds +Author: Jörg Frings-Fürst +Last-Update: 2014-12-03 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/src/xscanimage.c +=================================================================== +--- trunk.orig/src/xscanimage.c ++++ trunk/src/xscanimage.c +@@ -1284,7 +1284,7 @@ scan_dialog (GtkWidget * widget, gpointe + { /* We are running in standalone mode */ + /* test for pnm formats */ + strncpy (testfilename, preferences.filename, sizeof (testfilename)); +- testfilename[sizeof (testfilename)] = 0; ++ testfilename[sizeof (testfilename) - 1] = 0; + g_strreverse (testfilename); + if (!((!strncmp (testfilename, "mnp.", 4)) || + (!strncmp (testfilename, "mgp.", 4)) || diff --git a/debian/patches/20_scanadf-SIGCHLD.patch b/debian/patches/20_scanadf-SIGCHLD.patch new file mode 100644 index 0000000..ab91534 --- /dev/null +++ b/debian/patches/20_scanadf-SIGCHLD.patch @@ -0,0 +1,19 @@ +Description: Sets SIGCHLD to SIG_DFL before execle(). +Author: Jakub Wilk +Origin: http://www.opengroup.org/onlinepubs/009695399/functions/exec.html +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596232 +Last-Update: 2014-12-03 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/src/scanadf.c +=================================================================== +--- trunk.orig/src/scanadf.c ++++ trunk/src/scanadf.c +@@ -1213,6 +1213,7 @@ scan_it_raw (const char *fname, SANE_Boo + + case 0: + /* in child process */ ++ signal(SIGCHLD, SIG_DFL); + sprintf(cmd, "%s '%s'", script, fname); + /* system(cmd); */ + execle(script, script, fname, NULL, environ); diff --git a/debian/patches/25_manpages-typo.patch b/debian/patches/25_manpages-typo.patch new file mode 100644 index 0000000..cb3f8f4 --- /dev/null +++ b/debian/patches/25_manpages-typo.patch @@ -0,0 +1,62 @@ +Description: Correct typos in manpages +Author: Jörg Frings-Fürst +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612686 +Last-Update: 2014-12-03 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/doc/scanadf.man +=================================================================== +--- trunk.orig/doc/scanadf.man ++++ trunk/doc/scanadf.man +@@ -162,7 +162,7 @@ information about the parameters of the + + .PP + If the +-.B --scipt-wait ++.B --script-wait + option is given, scanadf will wait until all scan-scripts have been finished before + exiting. That will be useful if scanadf is used in conjunction with tools to modify + the scanned images. +@@ -210,7 +210,7 @@ invoke + via a command-line of the form: + .PP + .RS +-scanadf --help --device ++scanadf \-\-help \-\-device + .I dev + .RE + .PP +@@ -256,12 +256,12 @@ work at this time are: + .br + .B sane-hp + - Hewlett Packard scanners. A patch to the sane-hp backend +-is necessary. The --scantype=ADF option must be specified (earlier +-versions of the backend used the --scan-from-adf option, instead). ++is necessary. The \-\-scantype=ADF option must be specified (earlier ++versions of the backend used the \-\-scan-from-adf option, instead). + .br + .B sane-umax + - UMAX scanners. Support exists in build 12 and later. +-The --source="Automatic Document Feeder" option must be specified. ++The \-\-source="Automatic Document Feeder" option must be specified. + .br + .RE + +Index: trunk/doc/xscanimage.man +=================================================================== +--- trunk.orig/doc/xscanimage.man ++++ trunk/doc/xscanimage.man +@@ -45,11 +45,11 @@ simply copy it to one of the + plug-ins directories. If you want to conserve disk-space, you can + create a symlink instead. For example, for gimp-1.0.x the command + .PP +-ln -s @BINDIR@/xscanimage ~/.gimp/plug-ins/ ++ln \-s @BINDIR@/xscanimage ~/.gimp/plug-ins/ + .PP + and for gimp-1.2.x the command + .PP +-ln -s @BINDIR@/xscanimage ~/.gimp-1.2/plug-ins/ ++ln \-s @BINDIR@/xscanimage ~/.gimp-1.2/plug-ins/ + .PP + adds a symlink for the + .B xscanimage diff --git a/debian/patches/scanadf-sigchld.diff b/debian/patches/scanadf-sigchld.diff new file mode 100644 index 0000000..fe84f08 --- /dev/null +++ b/debian/patches/scanadf-sigchld.diff @@ -0,0 +1,11 @@ +diff --git a/src/scanadf.c b/src/scanadf.c +--- a/src/scanadf.c ++++ b/src/scanadf.c +@@ -1195,6 +1195,7 @@ + + case 0: + /* in child process */ ++ signal(SIGCHLD, SIG_DFL); + sprintf(cmd, "%s '%s'", script, fname); + /* system(cmd); */ + execle(script, script, fname, NULL, environ); diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..74cfad3 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,9 @@ +25_manpages-typo.patch +01_xcam.c_dead_code.patch +02_xcam_man_typo.patch +03_scanadf_options_fix.patch +04_cap_always_settable.patch +05_xcam_off_by_one.patch +06_word_list_fix.patch +20_scanadf-SIGCHLD.patch +100_xscanimage_c-out-of-bounds.patch diff --git a/debian/rules b/debian/rules index 2db7de8..4aa0e6b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,100 +1,11 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# Include dpatch rules -include /usr/share/dpatch/dpatch.make - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -autotools: autotools-stamp -autotools-stamp: - rm -f config.sub config.guess - ln -s /usr/share/misc/config.sub config.sub - ln -s /usr/share/misc/config.guess config.guess - touch autotools-stamp - -config.status: autotools-stamp configure - dh_testdir - # Add here commands to configure the package. - ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ - --prefix=/usr --mandir=\$${prefix}/share/man \ - --infodir=\$${prefix}/share/info --datadir=\$${prefix}/share - -build: build-stamp -build-stamp: patch-stamp config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - - touch build-stamp - -clean: real-clean unpatch -real-clean: - dh_testdir - dh_testroot - rm -f build-stamp autotools-stamp - - # Add here commands to clean up after the build process. - [ ! -f Makefile ] || $(MAKE) distclean - - rm -f config.sub config.guess - - dh_clean - - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/sane - $(MAKE) install prefix=$(CURDIR)/debian/sane/usr - - cp $(CURDIR)/debian/xscanimage-icon-32x32-2.xpm $(CURDIR)/debian/sane/usr/share/sane - -# Build architecture-independent files here. -binary-indep: -# We have nothing to do by default. +export DEB_BUILD_MAINT_OPTIONS = hardening=+all -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs -# dh_installexamples - dh_installmenu - dh_installman -# dh_installinfo -# dh_undocumented - dh_installchangelogs Changelog - dh_link usr/bin/xscanimage usr/lib/gimp/2.0/plug-ins/xscanimage - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb -# dh_perl - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb +%: + dh $@ --with autotools-dev -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install patch unpatch real-clean autotools +override_dh_strip: + dh_strip --dbg-package=sane-dbg diff --git a/debian/sane.dirs b/debian/sane.dirs index a356f1d..48002d8 100644 --- a/debian/sane.dirs +++ b/debian/sane.dirs @@ -1 +1,2 @@ usr/lib/gimp/2.0/plug-ins +usr/share/sane diff --git a/debian/sane.install b/debian/sane.install new file mode 100644 index 0000000..6eca907 --- /dev/null +++ b/debian/sane.install @@ -0,0 +1,2 @@ +debian/xscanimage-icon-32x32-2.xpm usr/share/sane +usr/bin/* diff --git a/debian/sane.links b/debian/sane.links new file mode 100644 index 0000000..54aafe8 --- /dev/null +++ b/debian/sane.links @@ -0,0 +1 @@ +usr/bin/xscanimage usr/lib/gimp/2.0/plug-ins/xscanimage diff --git a/debian/sane.manpages b/debian/sane.manpages new file mode 100644 index 0000000..d8b3598 --- /dev/null +++ b/debian/sane.manpages @@ -0,0 +1 @@ +doc/*.man diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..4ccb181 --- /dev/null +++ b/debian/watch @@ -0,0 +1,5 @@ +# +# watch file for sane-frontends +# +version=3 +https://alioth.debian.org/frs/?group_id=30186 .*/sane-frontends-(.*).(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz) -- cgit v1.2.3