Subject: Building Debian Package From Upstream Source

From: Stephen Allen <[email-masked]>
Date: Sun, 25 Sep 2016 10:43:04 -0400

Hi, wanting to upgrade to a newer version of Liferea than what's in
Testing.

So, I downloaded the upstream source, downloaded the most recent version
of the Debian Package, so that I have a Debian source tree. Next I
copied the Debian source tree directory from the existing Debian source
package into the upstream source, with Debian dsc and OrigSrc one level
up.
Then I ran 'dpkg-buildpackage -us -uc -j4' as root' which gave me the
following error;

dpkg-buildpackage: info: source package liferea
dpkg-buildpackage: info: source version 1.10.19-2
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by David Michael Smith
<[email-masked]>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build liferea-1.12-rc1a
 dpkg-source: info: using options from
 liferea-1.12-rc1a/debian/source/options: --compression=xz
 dpkg-source: info: applying debian-example-feeds.patch
 dpkg-source: info: applying www-browser.patch
 patching file src/browser.c
 Hunk #1 FAILED at 72.
 1 out of 1 hunk FAILED
 patching file net.sf.liferea.gschema.xml.in
 dpkg-source: info: the patch has fuzz which is not allowed, or is
 malformed
 dpkg-source: info: if patch 'www-browser.patch' is correctly applied by
 quilt, use 'quilt refresh' to update it
 dpkg-source: info: restoring quilt backup files for www-browser.patch
 dpkg-source: error: LC_ALL=C patch -t -F 0 -N -p1 -u -V never -E -b -B
 .pc/www-browser.patch/ --reject-file=- <
 liferea-1.12-rc1a/debian/patches/www-browser.patch gave error exit
 status 1
 dpkg-buildpackage: error: dpkg-source --before-build liferea-1.12-rc1a
 gave error exit status 2

 ========================================================================

 I'm new to building Debian packages, so any suggestions appreciated,
 I'm running Debian 'Testing'.

---

From: Santiago Vila <[email-masked]>
Date: Sun, 25 Sep 2016 17:21:41 +0200

On Sun, Sep 25, 2016 at 10:43:04AM -0400, Stephen Allen wrote:
> Then I ran 'dpkg-buildpackage -us -uc -j4' as root' [...]

Note: Debian packages do not require to be built by root, so it's better
that you don't. Using fakeroot is the default. Just install it
and it will be used automatically by dpkg-buildpackage.

---

From: Mark Fletcher <[email-masked]>
Date: Mon, 26 Sep 2016 00:01:02 +0900

> Then I ran 'dpkg-buildpackage -us -uc -j4' as root' which gave me the

<Snip>

>  patching file src/browser.c

I think what you have here is a package-specific problem. The Debian 
build is attempting to apply patches to the source. Since you have 
grafted in newer source, I suspect the affected source file has been 
updated in an incompatible way and now the patch doesn't work 
(presumably because the lines it expects to change are either gone or 
are no longer at the expected line numbers in the source file).

What can you do about this? Not a lot, except maybe if you have the 
skills take the Debian Testing source, apply the patch yourself to get 
the patched source file, then diff this with the newer source file and 
figure out if the intent of the patch is still needed. If so, you'd need 
to apply it manually to the updated source, or, if you are lucky, obtain 
an updated patch from somewhere.

Depending on how strong a programmer you are, you may or may not be able 
to do this. Another option would be to go back to the package developers 
(the original developers, not the Debian package maintainer) and ask if 
they have an updated version of the patch, if it is still needed / 
recommended.

I assume there isn't a sufficiently up to date version of the package in 
sid??? :-)

Mark