I would like to create a brand new deb package to install series of files. If at all possible, I would like to untar the folder containing these files as part of the installation into a known folder location. Failing that, some knowledge how to package the source folders and files would be very useful.
Question is - is this possible and if so - how?
Lets give an example:
~/mypluginfolder/
contains the files x
, y
, a subfolder called abc
and inside that another file called z
.
I want to tar this folder: tar -cvf myfiles.tar ~/mypluginfolder
I presume my debian package would look like
myfiles.tar.gz
myfiles+ppafoss_0.1-1/
myfiles.tar
DEBIAN
changelog, compat, control, install, rules source
Is it possible to somehow untar myfiles.tar
to a known folder location for example
/usr/share/rhythmbox/plugins/
Thus the final result would be:
/usr/share/rhythmbox/plugins/mypluginfolder
/usr/share/rhythmbox/plugins/mypluginfolder\x
/usr/share/rhythmbox/plugins/mypluginfolder\y
/usr/share/rhythmbox/plugins/mypluginfolder\abc\z
If - presuming launchpad needs source, advice is sought as to where I should drop the source folders and files into the deb package structure.
This will eventually will become a series of individual launchpad PPA packages.
What I prefer (but may not be able to achieve...) is to keep my packaging to a minimum - create a series of packages from a template and adjust the bare minimum (changelog etc + the tar file/file & folder structure).
Below, I'm assuming that the source is open (e.g. Python scripts) which are therefore not bound to any architecture (e.g. amd64 or i386), hence "all". If you have some C source, you need to use
Architecture: amd64 i386
in your sourcecontrol
file.creating package ready for Launchpad
Launchpad only accepts source packages, so create a
rules
that installs the files in the correct places. For convenience, I'll use debhelper. The directory with your files should look like:A
debian/copyright
file may also be useful for informing users about the licenses associated with the package. I don't think you need apostinst
script since you only need to extract some files.compat
should contain the debhelper compatilbility level, say "8". (please refer to the manual page of debhelper for more details)The
changelog
file can be edited with thedch
command, available from thedevscripts
package. Therules
(using debhelper) should contain:Make it executable using
chmod 755 debian/rules
. A source package can be build usingdebuild -S
. Be sure to be in a directory named<package-name>-<version>
. More information about theoverride_
behavior and thedh
command can be found on its manual page.The Debian New Maintainers' Guide was very valuable for me to understand this, it's recommended reading. Example packaging can be found on https://github.com/Bumblebee-Project/bumblebee-ppa.
creating package from existing file tree
dpkg-deb -b
can be used for creating tarballs from an existing file tree. First, start with creating a directory that should be named after your package. I'll assume you want to name itmyplugin
, and put it in/usr/share/rhythmbox/plugins/mypluginfolder
. In addition, create theDEBIAN
directory (uppercase!) for storing package information:Copy over your files:
Next, you'll need a so-called control file located at
myplugin/DEBIAN/control
which describes the package. The contents of such a file are put below:Now, you can optionally verify the contents of your package. The next command lists the file and directory entries contents of
myplugin
:If you're satisfied, build the package in the current directory:
A new file will appear, named like
<package>_<version>_<architecture>.deb
which is in this examplemyplugin_1.0-1_all.deb
. You can use theless
program to peek in the file. For example,less myplugin_1.0-1_all.deb
.