Debian package

From Emergent

Jump to: navigation, search

TODO: Update these instructions for Emergent

Contents

How to create a Emergent .deb (on Kubuntu)

These directions are intended to create a package that is robust enough to be included in the mainstream Ubuntu repositories. Based on The Debian New Maintainer's Guide. See the todo list at the end:

Instructions

  • You will need: apt-get install dpkg-dev libc6dev autoconf automake devscripts gnupg lintian linda pbuilder
  • Make sure you have a personal gpg key. See here if you don't: GPG Quick Start.
  • First build the code (make-j6) and then make a distribution tarball (make dist) and then unpack it (tar -xzf*.tar.gz && cd pdp++-3.5)
  • Run dh_make: dh_make -e brian.mingus@colorado.edu -f ../pdp++-3.5.tar.gz. You have to answer some questions. This is a "single binary" package.
 * Now there is a backup tarball in the parent directory with orig infixed into the name, and a new subdirectory labeled debian.
  • cd debian. Edit the file called control to have accurate information. Make it look like this (See script at end of document for help):
Source: pdp++
Section: main
Priority: optional
Maintainer: Brian Mingus <Brian.Mingus@colorado.edu>
Build-Depends: debhelper (>= 5), autotools-dev
Standards-Version: 3.6.2

Package: pdp++
Architecture: i386
Depends: ${shlibs:Depends}
Description: Neural Simulation Software
  • Make the debian/copyright file look like this:
#!text
This package was debianized by Brian Mingus <brian.mingus@colorado.edu> on
Sat, 23 Dec 2006 17:18:47 -0700.

It was downloaded from ftp://grey.colorado.edu/pub/oreilly/pdp++/

Upstream Author: Randall O'Reilly

Copyright, 1995-2005, Regents of the University of
Colorado, Carnegie Mellon University, Princeton University.

TA/PDP++ 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.

TA/PDP++ 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.

The Debian packaging is (C) 2006, Brian Mingus
<brian.mingus@colorado.edu> and is licensed under the GPL, see
'/usr/share/common-licenses/GPL'.

  • Edit the debian/rules file, and edit the configure command found in the config.status target. Towards the end it has CFLAGS=blah LDFLAGS=blah. Delete from those until the end of the line, but nothing before. They stop the package from building.
  • Remove everything with a .ex extension: rm debian/*.ex
  • Make sure the Standards-Version in debian/control is the latest possible. At this time, it is listed as 3.6.2 but needs to be changed to 3.7.2
  • Now run dpkg-buildpackage -rfakeroot. Have a pot of coffee and come back.
    • In the parent directory we now have the following files (ls ../.. | grep pdp++):
        • pdp++-3.5 - Folder where the package was just debianized
          • pdp++-3.5.tar.gz - Original tarball created by make dist
          • pdp++_3.5-1.diff.gz - Contains diffs for every change/addition you made to the source code
          • pdp++_3.5-1.dsc - Summary of the source code contents
          • pdp++_3.5-1_i386.changes - Describes all the changes made in the current package revision
          • pdp++_3.5-1_i386.deb - Our complete binary package!
          • pdp++_3.5.orig.tar.gz - Backup of the original tarball
  • At this point you are done, but there still might be problems with the .deb. The debian people are just as anal retentive as the GNU people, only somewhat nicer about it. So use the lintian and linda tools as described here to fix the package up to your own level of liking...


TODO

  • Add a longer description to the control file
  • Solve the dependency problems w/ libQt*_debug.so (we basically need a .deb package for _everything_ we use)
  • Output from: linda -i pdp++_3.5-1_i386.changes
E: pdp++; Package contains dh-make or such example files.
 This package contains example files left by "Debian-izers", such as
 dh_make, with a ex suffix or prefix.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; Package contains dh-make or such example files.
E: pdp++; No manual page for binary css.
 The binary displayed doesn't have a corresponding manual page, while
 Policy dictates that every binary in /bin, /sbin, /usr/bin, /usr/sbin,
 /usr/games and /usr/X11R6/bin requires a manual page.
E: pdp++; No manual page for binary maketa.
E: pdp++; No manual page for binary pdp++.
W: pdp++; The library libpdp is not in a shlibs file.
 The library shown above is not listed in a shlibs file. This means
 that packages that depend on this one won't get ${shlibs:Depends}
 correctly.
W: pdp++; The library libtacss is not in a shlibs file.
W: pdp++; This package contains shared libraries and no shlibs file.
 The package contains shared libraries and does not have a shlibs file,
 which is going to make it hard for other packages to depend on this
 one.
W: pdp++; File /usr/share/pdp++/COPYING is considered to be an extra license file.
 The file shown above is considered to be another license file, where
 as the license for a package should be contained in the copyright
 file, which should be installed into /usr/share/doc/<pkg>.
W: pdp++; File /usr/share/pdp++/COPYING.LIB is considered to be an extra license file.
W: pdp++; Binary /usr/bin/css compiled with an RPATH of /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib.
 This binary or shared library defines the `RPATH', which is usually a
 bad thing.  Most likely you will find a Makefile with a line like: gcc
 test.o -o test -Wl,--rpath
W: pdp++; Binary /usr/bin/pdp++ compiled with an RPATH of /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib.
W: pdp++; Binary /usr/lib/libpdp-3.5.so.0.0.0 compiled with an RPATH of /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib.
W: pdp++; Binary /usr/lib/libtacss-3.5.so.0.0.0 compiled with an RPATH of /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib.
</code>

* Output from: <code>lintian -i pdp++_3.5-1_i386.changes</code>
<code>
#!text
W: pdp++ source: dh-make-template-in-source debian/cron.d.ex
N:
N:   This package contains debian/*.ex and/or debian/ex.* files installed
N:   by dh_make. These are intended to be filled in with the package's
N:   details and renamed for use by various debhelper commands. If they are
N:   not being used, they should be removed.
N:
W: pdp++ source: dh-make-template-in-source debian/emacsen-install.ex
W: pdp++ source: dh-make-template-in-source debian/emacsen-remove.ex
W: pdp++ source: dh-make-template-in-source debian/emacsen-startup.ex
W: pdp++ source: dh-make-template-in-source debian/init.d.ex
W: pdp++ source: dh-make-template-in-source debian/manpage.1.ex
W: pdp++ source: dh-make-template-in-source debian/manpage.sgml.ex
W: pdp++ source: dh-make-template-in-source debian/manpage.xml.ex
W: pdp++ source: dh-make-template-in-source debian/menu.ex
W: pdp++ source: dh-make-template-in-source debian/postinst.ex
W: pdp++ source: dh-make-template-in-source debian/postrm.ex
W: pdp++ source: dh-make-template-in-source debian/preinst.ex
W: pdp++ source: dh-make-template-in-source debian/prerm.ex
W: pdp++ source: dh-make-template-in-source debian/watch.ex
W: pdp++ source: dh-make-template-in-source debian/pdp++-default.ex
W: pdp++ source: dh-make-template-in-source debian/pdp++.doc-base.EX
W: pdp++ source: out-of-date-standards-version 3.6.2 (current is 3.7.2)
N:
N:   The source package refers to a 'Standards-Version' that is starting to
N:   get out of date, compared to current Policy. You can safely ignore
N:   this warning, but please consider updating the package to current
N:   Policy.
N:
E: pdp++ source: source-tar-is-posix-tar pdp++_3.5.orig.tar.gz
N:
N:   The source tar archive of this package is made with tar --posix. This
N:   tar format is actually not understood by woody's tar.
N:
N:   Some automake 1.7 and 1.8 versions in Debian had this wrong tar option
N:   for a short time, re-autobuilding should solve this. Please see
N:   http://lists.debian.org/debian-devel/2004/debian-devel-200404/msg01376
N:   .html and
N:   http://lists.debian.org/debian-devel/2004/debian-devel-200404/msg01586
N:   .html for more details.
N:
W: pdp++ source: changelog-should-mention-nmu
N:
N:   When you NMU a package, that fact should be mentioned on the first
N:   line in the changelog entry.
N:
N:   Maybe you didn't intend this upload to be a NMU, in that case, please
N:   doublecheck that the most recent entry in the changelog is
N:   byte-for-byte identical to the maintainer or one of the uploaders.
N:
W: pdp++ source: source-nmu-has-incorrect-version-number 3.5-1
N:
N:   A source NMU should have a Debian revision of '-x.x'. This is to
N:   prevent stealing version numbers from the maintainer (and the -x.x.x
N:   version numbers are reserved for binary-only NMU's).
N:
N:   Maybe you didn't intend this upload to be a NMU, in that case, please
N:   doublecheck that the most recent entry in the changelog is
N:   byte-for-byte identical to the maintainer or one of the uploaders.
N:
W: pdp++: binary-without-manpage css
N:
N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should
N:   have a manual page
N:
N:   Note, that though the `man' program has the capability to check for
N:   several program names in the NAMES section, each of these programs
N:   should have its own manual page (a symbolic link to the appropriate
N:   manual page is sufficient) because other manual page viewers such as
N:   xman or tkman don't support this.
N:
N:   Refer to Policy Manual, section 12.1 for details.
N:
W: pdp++: binary-without-manpage maketa
W: pdp++: binary-without-manpage pdp++
W: pdp++: extra-license-file usr/share/pdp++/COPYING
N:
N:   All license information should be collected in the debian/copyright
N:   file. This usually makes it unnecessary for the package to install
N:   this information in other places as well.
N:
N:   Refer to Policy Manual, section 12.5 for details.
N:
W: pdp++: extra-license-file usr/share/pdp++/COPYING.LIB
W: pdp++: non-dev-pkg-with-shlib-symlink usr/lib/libtacss-3.5.so.0.0.0 usr/lib/libtacss-3.5.so
N:
N:   Although this package is not a `-dev' package, it installs a
N:   `libsomething.so' symbolic link referencing the corresponding shared
N:   library. When the link doesn't include the version number, it is used
N:   by the linker when other programs are built against this shared
N:   library.
N:
N:   Shared libraries are supposed to place such symbolic links in their
N:   respective `-dev' packages, so it is a bug to include it with the main
N:   library package.
N:
N:   However, if this is a small package which includes the runtime and the
N:   development libraries, this is not a bug. In the latter case, please
N:   override this warning.
N:
N:   Refer to Policy Manual, section 8.4 for details.
N:
W: pdp++: non-dev-pkg-with-shlib-symlink usr/lib/libpdp-3.5.so.0.0.0 usr/lib/libpdp-3.5.so
E: pdp++: no-shlibs-control-file usr/lib/libtacss-3.5.so.0.0.0
N:
N:   Although the package includes a shared library, the package does not
N:   have a shlibs control file. If this is intentional, please override
N:   this error.
N:
N:   Refer to Policy Manual, section 8.6 for details.
N:
E: pdp++: no-shlibs-control-file usr/lib/libpdp-3.5.so.0.0.0
E: pdp++: postinst-must-call-ldconfig usr/lib/libpdp-3.5.so.0.0.0
N:
N:   The package installs shared libraries in a directory controlled by the
N:   dynamic library loader. Therefore, the package must call `ldconfig' in
N:   its postinst script.
N:
N:   Refer to Policy Manual, section 8.1.1 for details.
N:
E: pdp++: extended-description-is-empty
N:
N:   The extended description (the lines after the first line of the
N:   "Description:" field) is empty.
N:
W: pdp++: package-name-doesnt-match-sonames libpdp-3.5-0 libtacss-3.5-0
N:
N:   The package name of a library package should usually reflect the
N:   soname of the included library. The package name can determined from
N:   the library file name with the following code snippet:
N:
N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -e's/\([0-9]\)\.so\./\1-/; s/\.so\.//'
N:
N:   Refer to Library Packaging guide 5 for details.
N:
W: pdp++: binary-or-shlib-defines-rpath ./usr/bin/css /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib
N:
N:   The binary or shared library defines the `RPATH'. Usually this is a
N:   bad thing. Most likely you will find a Makefile with a line like:
N:       gcc test.o -o test -Wl,--rpath
N:   or
N:       gcc test.o -o test -R/usr/local/lib
N:   Please contact debian-devel@lists.debian.org if you have questions
N:   about this.
N:
W: pdp++: binary-or-shlib-defines-rpath ./usr/bin/pdp++ /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib
W: pdp++: binary-or-shlib-defines-rpath ./usr/lib/libtacss-3.5.so.0.0.0 /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib
W: pdp++: binary-or-shlib-defines-rpath ./usr/lib/libpdp-3.5.so.0.0.0 /usr/local/Trolltech/Qt-4.1.4/lib:/home/mingus/lib
W: pdp++: wrong-bug-number-in-closes l3:#nnnn
N:
N:   Bug numbers can only contain digits.
N:
N:   Refer to Policy Manual, section 4.4 for details.
N:
W: pdp++: unknown-section main
N:
N:   The `Section:' field in this package's control file is not one of the
N:   sections in use on the ftp archive. Valid sections are currently
N:   admin, base, comm, devel, doc, editors, electronics, embedded, games,
N:   gnome, graphics, hamradio, interpreters, kde, libdevel, libs, mail,
N:   math, misc, net, news, oldlibs, otherosfs, perl, python, science,
N:   shells, sound, tex, text, utils, web, and x11.
N:
N:   The section name should be preceded by `non-free/' if the package is
N:   in the non-free distribution, and by `contrib/' if the package is in
N:   the contrib distribution.
N:
N:   Refer to Policy Manual, section 2.4 for details.
N:
  • Warnings generated from creating this package:
dpkg-shlibdeps: warning: could not find any packages for libtacss-3.5.so.0
dpkg-shlibdeps: warning: unable to find dependency information for shared library libtacss-3.5 (soname 0, path libtacss-3.5.so.0, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtGui_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtGui_debug (soname 4, path libQtGui_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQt3Support_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQt3Support_debug (soname 4, path libQt3Support_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtNetwork_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtNetwork_debug (soname 4, path libQtNetwork_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtOpenGL_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtOpenGL_debug (soname 4, path libQtOpenGL_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtCore_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtCore_debug (soname 4, path libQtCore_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: unable to find dependency information for shared library libSoQt (soname 20, path libSoQt.so.20, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libpdp-3.5.so.0
dpkg-shlibdeps: warning: unable to find dependency information for shared library libpdp-3.5 (soname 0, path libpdp-3.5.so.0, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libtacss-3.5.so.0
dpkg-shlibdeps: warning: unable to find dependency information for shared library libtacss-3.5 (soname 0, path libtacss-3.5.so.0, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtGui_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtGui_debug (soname 4, path libQtGui_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQt3Support_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQt3Support_debug (soname 4, path libQt3Support_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtNetwork_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtNetwork_debug (soname 4, path libQtNetwork_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtOpenGL_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtOpenGL_debug (soname 4, path libQtOpenGL_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtCore_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtCore_debug (soname 4, path libQtCore_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: unable to find dependency information for shared library libSoQt (soname 20, path libSoQt.so.20, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtSql_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtSql_debug (soname 4, path libQtSql_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtXml_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtXml_debug (soname 4, path libQtXml_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtGui_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtGui_debug (soname 4, path libQtGui_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQt3Support_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQt3Support_debug (soname 4, path libQt3Support_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtNetwork_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtNetwork_debug (soname 4, path libQtNetwork_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtOpenGL_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtOpenGL_debug (soname 4, path libQtOpenGL_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtCore_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtCore_debug (soname 4, path libQtCore_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: unable to find dependency information for shared library libSoQt (soname 20, path libSoQt.so.20, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtSql_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtSql_debug (soname 4, path libQtSql_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtXml_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtXml_debug (soname 4, path libQtXml_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtGui_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtGui_debug (soname 4, path libQtGui_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQt3Support_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQt3Support_debug (soname 4, path libQt3Support_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtNetwork_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtNetwork_debug (soname 4, path libQtNetwork_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtOpenGL_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtOpenGL_debug (soname 4, path libQtOpenGL_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: could not find any packages for libQtCore_debug.so.4
dpkg-shlibdeps: warning: unable to find dependency information for shared library libQtCore_debug (soname 4, path libQtCore_debug.so.4, dependency field Depends)
dpkg-shlibdeps: warning: unable to find dependency information for shared library libSoQt (soname 20, path libSoQt.so.20, dependency field Depends)

Useful Scripts

  • Generates a list of -dev packages that this package depends on
#!sh
# If you have probs w/ this, just put it on one long line -- Brian Mingus on 12-23-06
for i in `objdump -p $(which pdp++) | grep NEEDED | sed -r 's/.*NEEDED.*(lib.*)$/\1/'`
do
   dpkg -S $i 2>/dev/null
done | sed -r 's/(.*)\:.*/\1/' | sort | uniq | tr "\n" " " | sed -r 's/([a-zA-Z0-9]|\-)\s/\1\-dev, /g'
  • The output looks like this:
libc6-dev, libc6-i686-dev, libcoin40c2-dev, libfontconfig1-dev, libgcc1-dev, libgl1-mesa-glx-dev, libglu1-mesa-dev, libgsl0-dev, libice6-dev, libjpeg62-dev, libpng12-0-dev, libqt4-debug-dev, libqt4-gui-dev, libqt4-qt3support-dev, libreadline5-dev, libsm6-dev, libstdc++6-dev, libx11-6-dev, libxcursor1-dev, libxext6-dev, libxi6-dev, libxinerama1-dev, libxmu6-dev, libxrandr2-dev, libxrender1-dev, soqt-dev, zlib1g-dev
Personal tools