31

Has anyone here had some experience creating a Debian / Ubuntu package? I am trying to backport the lammps package (http://packages.ubuntu.com/quantal/lammps) from Ubuntu 12.10 (Quantal) to Ubuntu 12.04

I only need it unofficially - just need a .deb package for convenience's sake when creating custom virtual machine images for deployment to IaaS platform.

Following the Ubuntu Packaging Guide at https://wiki.ubuntu.com/PackagingGuide , I can build successfully, except when I try to rebuild using the debuild command, I usually get this error:

 dpkg-source: error: aborting due to unexpected upstream changes, see
 /tmp/lammps_0~20120615.gite442279-1.diff.aie32n dpkg-source: info: you
 can integrate the local changes with dpkg-source --commit
 dpkg-buildpackage: error: dpkg-source --include-binaries -i -b
 lammps-0~20120615.gite442279 gave error exit status 2

Running 'make clean-all' at the src directory still does not solve the problem. Is there any way to completely clean off all the files that were generated during the build process, or to ask debuild to ignore any differences in the source files?

devav2
  • 37,290
hanxue
  • 700

8 Answers8

38

Avoid the Debian bureaucracy by just building the binary: dpkg-buildpackage -b

hendry
  • 660
11

This means you have applied changes to the unpacked upstream source which are not part of a patch in the debian/patches/ directory, or listed in the series file in there if they are; and/or there is some inconsistency in the state of quilt's application of the patches.

Looking at the mentioned file in /tmp will show you the changes in question.

dobey
  • 41,650
11

change the format in debian/source/format from 3.0 (quilt) to 3.0 (native) if you do not want to use quilt. This solved the problem for me anyway.

xtrade
  • 127
3

@Thomas Vander Stichele

I have come up with a workaround that uses the generated temporary file as a patch:

$ cp /tmp/path_to_diff_file_created_by_dpkg-source debian/patches/useful_name_of_applied_patch.patch
$ echo useful_name_of_applied_patch.patch >> debian/patches/series

https://web.archive.org/web/20150829023050/https://www.theo-andreou.org/?p=1112#toc-apply-patches-for-policy-compliance

2

I saw this problem when quilt incorrectly thought I had applied patches to my working copy (you can find its current status in the .pc folder). The fix in that case was to force quilt to pop all the patches with quilt pop -a -f.

1

This may happen if you did all the Debian "paperwork" but happened to have lingering artifacts from previous attempts. In particular, auto-generated changes to “config.sub”, “config.guess” and “Makefile”.

You could put this in debian/source/options:

# Don't store changes on autogenerated files
extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"

Ref: https://raphaelhertzog.com/2011/01/28/3-ways-to-not-clutter-your-debian-source-package-with-autogenerated-files/

1

https://manpages.debian.org/jessie/debhelper/dh_clean.1.en.html

Configure often modifies the source tree, you can list these files in

debian/clean

Example debian/clean

src/auto/config.h
src/auto/config.mk
dza
  • 111
  • 4
0

This issue usually appears during subsequent building of debian packages, although you may or may not have made changes to the original source during the first build. During the first time build, dpkg-source creates a <package-source>.orig.tar.{xz, gz, lzma} in the top-level directory. For eg. in the case of libva, you would find it as:

parent
├── libva
├── libva_2.11.0.orig.tar.xz

Now when you make changes inside libva/ or try to build subsequent times, it unpacks this source tar.gz and tries to compare with the new build files, finding changes in the new build.

The solution is to remove the older source tar, create a new one for the subsequent build using:

dh_make --createorig -p libva_2.11.0

And continue building the deb pkgs using the commands that you have been doing. Usually it would be:

debuild -d -uc -us

or

dpkg-buildpackage -b -uc -us