Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debianizing a source package that has no debian subdirectory

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Debianizing a source package that has no debian subdirectory

#1 Post by edbarx »

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; 
    Exec=executablename
    Comment=
    GenericName=executablename
    Icon=icon-if-any.ico
    Name=My Little Cool App
    Terminal=true/false
    Type=Application
    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

    dpkg-buildpackage
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.

Enjoy.

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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Debianizing a source package that has no debian subdirec

#2 Post by Head_on_a_Stick »

Excellent guide, thank you very much for this!
:)
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Debianizing a source package that has no debian subdirec

#3 Post by stevepusser »

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

Post Reply