Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172958 - media-gfx/unpaper-0.3 (removes book binding artifacts from scans) - new ebuild
Summary: media-gfx/unpaper-0.3 (removes book binding artifacts from scans) - new ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2007-04-01 02:08 UTC by Jeff Kowalczyk
Modified: 2010-11-06 21:08 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
working ebuild for unpaper-0.2 (unpaper-0.2.ebuild,598 bytes, text/plain)
2007-04-01 02:08 UTC, Jeff Kowalczyk
Details
modified per request, stable and untested architectures removed (unpaper-0.2.ebuild,561 bytes, text/plain)
2007-04-01 05:25 UTC, Jeff Kowalczyk
Details
unpaper 0.3 ebuild tree (unpaper-ebuild.tar.bz2,2.36 KB, application/octet-stream)
2008-01-08 17:07 UTC, Jimmy.Jazz
Details
Improved ebuild (unpaper-0.3.ebuild,745 bytes, text/plain)
2009-06-09 17:55 UTC, Alexey Charkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Kowalczyk 2007-04-01 02:08:19 UTC
unpaper is a single C source file compiling to a single binary. The tool post-processes scanned images to remove the page and binding edge marks typically found on a scanned book.

In addition to being generally useful, unpaper is an optional dependency of gscanpdf, a perl-gtk GUI scanning program that will also have a submitted ebuild shortly.

unpaper-0.2.ebuild works with the author's nonstandard package layout, and the custom gcc  options suggested in unpaper.c

Will put in request to upstream that the next version address the following package issues:

* change source tarball to: unpaper-0.3.tar.gz

* layout source tarball as: unpaper-0.3\(files)

* include simple makefile

* unpaper_0.2.tgz unpacks with warning: tar: A lone zero block at 2103

Reproducible: Always

Steps to Reproduce:
Comment 1 Jeff Kowalczyk 2007-04-01 02:08:51 UTC
Created attachment 115113 [details]
working ebuild for unpaper-0.2
Comment 2 Dan 2007-04-01 04:15:01 UTC
1) New ebuilds should never have stable keywords.
2) did you really test the ebuild on all those architectures?
3) Whats the deal with setting all those crazy cflags in the compile line?  Are they really necessary?
Comment 3 Jeff Kowalczyk 2007-04-01 05:24:03 UTC
No, you're absolutely correct about the stable and architectures, those should be removed. I modified app-misc/hilite-1.5.ebuild. My ebuild inexperience at fault there.

Re: the crazy gcc line, taken from comment in source file: unpaper did not compile without it, although I'm can't say if those specific settings are required:

>>> Compiling source in /var/tmp/portage/media-gfx/unpaper-0.2/work ...
/var/tmp/portage/media-gfx/unpaper-0.2/temp/ccuujzeL.o: In function `rotate':
unpaper.c:(.text+0x33c0): undefined reference to `sin'
unpaper.c:(.text+0x33d3): undefined reference to `cos'
/var/tmp/portage/media-gfx/unpaper-0.2/temp/ccuujzeL.o: In function `detectEdgeRotation':
unpaper.c:(.text+0x3756): undefined reference to `tan'
/var/tmp/portage/media-gfx/unpaper-0.2/temp/ccuujzeL.o: In function `detectRotation':
unpaper.c:(.text+0x3872): undefined reference to `sqrt'
collect2: ld returned 1 exit status
Comment 4 Jeff Kowalczyk 2007-04-01 05:25:46 UTC
Created attachment 115122 [details]
modified per request, stable and untested architectures removed
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-04-01 06:02:20 UTC
OK, report a bug upstream and re-open this once it's been fixed upstream so that it compiles while respecting user CFLAGS (esp. -ftree-vectorize is plain broken in every single gcc-4 version so far and nothing should rely on it).
Comment 6 Jeff Kowalczyk 2008-01-03 00:07:45 UTC
unpaper-0.3 has been released:

---

Date:	 Mon, 31 Dec 2007
From:	"Jens Gulden" <mail@jensgulden.de> 
To:	sane-devel@lists.alioth.debian.org, linux-graphics-dev@music.columbia.edu
Subject:	unpaper 0.3 released

Hello,

unpaper 0.3 has been released: http://unpaper.berlios.de/

unpaper is a post-processing tool for scanned sheets of paper, especially for
 book pages.

Version 0.3 is a maintenance release fixing several bugs and making
 distribution-packaging easier.

 From the CHANGELOG:
- Fixed bug #7882: --pre-mirror h,v now correct when vertical resolution is odd
- Fixed bug #9495: resizing/stretching of color-images now works.
- Fixed bug #11294: leading zeros in width/height values of pnm-files no longer
   cause problems.
- Corrected some language flaws in the docmentation. Thanks to Martin Collins.
- Removed modes 'single-rotated' and 'double-rotated' for parameter --layout,
 use
   --pre-rotate instead.
- Added --pre-shift and --post-shift options.
- Added --sheet-background option.
...and more.

Enjoy and have a happy 2008,
Jens Gulden

---

The layout of the source tarball (omits the compiled unpaper binary):

http://prdownload.berlios.de/unpaper/unpaper-0.3.tar.gz

# ls /var/tmp/portage/media-gfx/unpaper-0.3/work/unpaper-0.3
CHANGELOG  LICENSE  README  doc  make.sh  src

/doc is empty, src/ contains only unpaper.c

#cat /var/tmp/portage/media-gfx/unpaper-0.3/work/unpaper-0.3/make.sh

# Simple makefile to build/install unpaper.
#
# Usage: make.sh [install]

INST_DIR=/usr/local/bin

if [[ "$1" == "install" ]]; then
  # must be root here
  if [[ "`whoami`" != "root" ]]; then
    echo "You should be root to copy 'unpaper' to '$INST_DIR'. Or try manually if you know what you are doing."
    exit
  fi
  if [[ ! -x unpaper ]]; then
    # not compiled yet
    ./make.sh
  fi
  echo "installing to $INST_DIR/unpaper"
  cp -v unpaper $INST_DIR
  exit
fi

# $CFLAGS may contain specific processor architecture information
# or optimization flags, e.g.:
# "-O3 -funroll-all-loops -fomit-frame-pointer -ftree-vectorize".

# -lm is required to link the math-libary which provides sin(), cos() etc.

echo "compiling"
gcc ${CFLAGS} -lm -o unpaper src/unpaper.c


Is beyond my ebuild-fu to recreate without running make.sh, is that what should be done?

The unpaper author seems amenable to packaging improvements. If someone wants to create a makefile that can do the job of make.sh. Jens would likely simplify the packaging further to incorporate it.

Thanks.
Comment 7 Jimmy.Jazz 2008-01-08 17:07:01 UTC
(In reply to comment #6)

> 
> Is beyond my ebuild-fu to recreate without running make.sh, is that what should
> be done?
> 
> The unpaper author seems amenable to packaging improvements. If someone wants
> to create a makefile that can do the job of make.sh. Jens would likely simplify
> the packaging further to incorporate it.
> 
> Thanks.
> 

Hello,

I made 2 ebuilds for unpaper with and without configure.ac and co. I'm not used with that config thing, so don't be too harsh.

For the moment, the code won't compile with configure because it doesn't respect ISO C90 and C89. Anyway, the code involved seems easy to change, so it won't be long for the author to deliver a new release.

see attachment, please

Jj
Comment 8 Jimmy.Jazz 2008-01-08 17:07:57 UTC
Created attachment 140479 [details]
unpaper 0.3 ebuild tree
Comment 9 Alexey Charkov 2009-06-09 17:55:01 UTC
Created attachment 194009 [details]
Improved ebuild

Removed unneeded eclasses, added a 'doc' USE flag to trigger installation of HTML help, added LDFLAGS to the command line for compilation, added installation of README and CHANGELOG.
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-09-05 10:59:40 UTC
I've added this to the tree, but with a different ebuild (coming from my overlay) and as app-text/unpaper rather than media-gfx.

Comment 11 Henrik 2010-11-06 21:08:33 UTC
app-text/unpaper-0.3 test on an x86 works 100%