Debianizing a source package that has no debian subdirectory

Share your own howto's etc. Not for support questions!

Debianizing a source package that has no debian subdirectory

Postby edbarx » 2016-02-01 06:36

NOTE: Debianizing a package depends on the complexity of the package concerned. The procedure described below works for simple packages although with some more research it can be extended to work for other more complicated packages.

These are the steps:
  1. make sure the source's root directory is named name-n.x.y where n, x, y are whole numbers.
  2. cd inside the source's root directory
  3. run dh_make as follows:
    Code: Select all
    dh_make --createorig
  4. dh_make interactively asks you some questions about the nature of the package, answer them.
  5. Now cd to the newly created debian subdirectory. You need to create a new file with the name package.install where package does NOT include the version number. The format for package.install is simply:
    Code: Select all
    file /path/to/file
  6. If you need a launcher create it and save it under the source's root directory. In the package.install file list it as follows:
    Code: Select all
    launchername /usr/share/applications

    This format works for a launcher (I used it in netman):
    Code: Select all
    [Desktop Entry]
    Categories=Application;Speficy a categor;
    Name=My Little Cool App
    Categories=Speficy a category;

    Note: Keep the semicolons and consult other .desktop files.
    So, if we want to place our executable file under /usr/bin we would write:
    Code: Select all
    programname /usr/bin
  7. Check whether there is already a Makefile under the source's root directory. If present you probably need no more changes. However, make sure the compiled executable name is the same name you used in the previous step.
  8. Create an orig source tarball as Debian mandates that . While in the source's root directory issue this command:
    Code: Select all
    tar -czvf ../package_versionnumber.orig.tar.gz --exclude debian/ .
  9. Once you did these steps correctly :shock: you can now build the new package as follows:
    Code: Select all

Now, running dpkg-buildpackage should successfully create a nice .deb package for you. However, this depends on what programming language is used in the sources.


EDIT: Replaced w with y in step 1.
Last edited by edbarx on 2016-02-02 18:48, edited 3 times in total.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: Debianizing a source package that has no debian subdirec

Postby Head_on_a_Stick » 2016-02-01 07:48

Excellent guide, thank you very much for this!
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Posts: 12747
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debianizing a source package that has no debian subdirec

Postby stevepusser » 2016-02-01 20:07

I've found that I prefer using debmake to create a debian folder. It's a simple backport to Jessie, though you can also just safely download and install the current Stretch Python3 package on Jessie.
MX Linux packager and developer
User avatar
Posts: 12126
Joined: 2009-10-06 05:53

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 8 guests