I have created rpm packages for a software along with debuginfo. For Ubuntu/Debian , I have only the software packaged as .deb but don't know how to create debuginfo .deb package. Please let me know how to create them.
Ubuntu – How to create debuginfo package
debdebianpackaging
Related Solutions
The tutorial you have linked uses a low level approach for building a package. Such an approach is not usually recommended and may lead to all sorts of issues when not done carefully.
Creating a .deb for a script is very simple once you understand packaging basics. In a nutshell:
# Configure your paths and filenames
SOURCEBINPATH=~
SOURCEBIN=myscript.sh
DEBFOLDER=~/somescripts
DEBVERSION=0.1
DEBFOLDERNAME=$DEBFOLDER-$DEBVERSION
# Create your scripts source dir
mkdir $DEBFOLDERNAME
# Copy your script to the source dir
cp $SOURCEBINPATH/$SOURCEBIN $DEBFOLDERNAME
cd $DEBFOLDERNAME
# Create the packaging skeleton (debian/*)
dh_make -s --indep --createorig
# Remove make calls
grep -v makefile debian/rules > debian/rules.new
mv debian/rules.new debian/rules
# debian/install must contain the list of scripts to install
# as well as the target directory
echo $SOURCEBIN usr/bin > debian/install
# Remove the example files
rm debian/*.ex
# Build the package.
# You will get a lot of warnings and ../somescripts_0.1-1_i386.deb
debuild
Adding more scripts requires them to be copied to the directory and added to the debian/install file -- then just re-run debuild. You should also check and update the debian/* files as required .
You should read the man pages for: dh_make
, dh_install
, and debuild
What follows is a basic example of how a source package for a python script might look. While most of the packaging tutorials are a bit complex, they can really help if you hit a problem. That said, I first learned the basics of Debian packaging by simply looking at Debian packages. apt-get source
something similar and learn by example.
Here's your basic source package layout:
my-script/
-- myScript
-- debian/
-- changelog
-- copyright
-- compat
-- rules
-- control
-- install
Run dch --create
in the directory to create a properly formatted debian/changelog
entry.
debian/copyright should look like:
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: myScript
Upstream-Contact: Name, <email@address>
Files: *
Copyright: 2011, Name, <email@address>
License: (GPL-2+ | LGPL-2 | GPL-3 | whatever)
Full text of licence.
.
Unless there is a it can be found in /usr/share/common-licenses
debian/compat can just be: 7
debian/rules:
#!/usr/bin/make -f
%:
dh $@ --with python2
Note that there must be "tab" before dh $@ --with python2
, not spaces.
debian/control:
Source: my-script
Section: python
Priority: optional
Maintainer: Name, <email@address>
Build-Depends: debhelper (>= 7),
python (>= 2.6.6-3~)
Standards-Version: 3.9.2
X-Python-Version: >= 2.6
Package: my-script
Architecture: all
Section: python
Depends: python-appindicator, ${misc:Depends}, ${python:Depends}
Description: short description
A long description goes here.
.
It can contain multiple paragraphs
debian/install:
myScript usr/bin/
This file indicates which file will be installed into which folder.
Now build it with debuild --no-tgz-check
This will create a functional deb package. Lintian is going to throw a few warnings regarding the lack of an orig.tar.gz, but unless you plan on creating a proper upstream project that makes tarball releases you'll probably just want to ignore that for now.
Best Answer
Packages in the official archives have debug packages build for them automatically. They are stored in a different archive though. They will have the names
foo-dbgsym
You can access them by putting the following in your/etc/apt/sources.list
:(Replace natty with the release you are running.)
Information on how these are generated can be found here:
If you'd like to provide debug packages for a package which you maintain outside of the official archives, that is possible as well. This Debian wiki article is the best place to start.
Briefly, you must first create the new package in
debian/control
by adding:Then in
debian/rules
, usedh_strip
to strip debugging symbols from binaries, but retain them for use in the debug packages.