How to create a debian for a dolphin service menu with a bash script and upload it on launchpad


Hi in this tutorial you will learn how to create your own debian package for a simple project like this:

first of all, here you can see the project tree:

/kate-folder-service-menu-0.1.0$ tree
/kate-folder-service-menu-0.1.0

/kate-folder-service-menu-0.1.0
└── usr
    ├── bin
    │   └── ktexeditor-open-folder
    └── share
        └── kde4
            └── services
                └── ServiceMenus
                      └── kate-folder.desktop

so we have a bash script

ktexeditor-open-folder

and a service menu for dolphin

kate-folder.desktop

first of all you need to create the folder where you have the source code with this name

kate-folder-service-menu-0.1.0

note that are ALL MINUS and note there is the version …. 0.1.0

now compress again your sources files using tar.gz and RENAME in this way MAKE SURE YOU HAVE COMPRESSED THE MAIN FOLDER  (inside the tar.gz must see this kate-folder-service-menu like main folder)

kate-folder-service-menu_0.1.0.orig.tar.gz

note the there is _0.1.0 and not -0.1.0 for the tar.gz

ok now go in the folder

cd /kate-folder-service-menu-0.1.0

and type

dh_make -s -c gpl

this will create all the stuff even too much …. REMOVE ALL .EX FILES you should get this :

debianpackagingtest/
├── kate-folder-service-menu-0.1.0
│   ├── debian
│   │   ├── changelog
│   │   ├── compat
│   │   ├── control
│   │   ├── copyright
│   │   ├── docs
│   │   ├── README.Debian -----> you can remove it 
│   │   ├── README.source -----> you can remove it 
│   │   ├── rules
│   │   └── source
│   │       └── format
│   ├── install
│   └── usr
│       ├── bin
│       │   └── ktexeditor-open-folder
│       └── share
│           └── kde4
│               └── services
│                   └── ServiceMenus
│                       └── kate-folder.desktop
└── kate-folder-service-menu_0.1.0.orig.tar.gz
        ||
     kate-folder-service-menu
     └── usr
         ├── bin
         │   └── ktexeditor-open-folder
         └── share
             └── kde4
                 └── services
                     └── ServiceMenus
                           └── kate-folder.desktop

now we need to create a file here debian/install

where we put these lines :

usr/bin/ktexeditor-open-folder
usr/share/kde4/services/ServiceMenus/kate-folder.desktop

this is the system path where the script and the service menu should be ok save and exist like install now we have

debianpackagingtest/
├── kate-folder-service-menu-0.1.0
│   ├── debian
│   │   ├── changelog
│   │   ├── compat
│   │   ├── control
│   │   ├── copyright
│   │   ├── docs
│   │   ├── install
│   │   ├── README.Debian
│   │   ├── README.source
│   │   ├── rules
│   │   └── source
│   │       └── format
│   ├── install
│   └── usr
│       ├── bin
│       │   └── ktexeditor-open-folder
│       └── share
│           └── kde4
│               └── services
│                   └── ServiceMenus
│                       └── kate-folder.desktop
└── kate-folder-service-menu_0.1.0.orig.tar.gz
        ||
     kate-folder-service-menu
     └── usr
         ├── bin
         │   └── ktexeditor-open-folder
         └── share
             └── kde4
                 └── services
                     └── ServiceMenus
                           └── kate-folder.desktop

now what we need to build it’s edit :

changelog

it’s very important edit

kate-folder-service-menu (0.1.0-1) precise; urgency=low

* Initial release

— Nowardev Peace Thu, 12 Apr 2012 11:16:18 +0200

because you will see unstable instead of precise and ubuntu doens’t allow this … expecially if you want upload on launchpad

control

file should be like this

Source: kate-folder-service-menu
Section: kde
Priority: extra
Maintainer: Nowardev Peace
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Homepage: http://kde-apps.org/content/show.php/kate+folder+service+menu?content=147325
#Vcs-Git: git://git.debian.org/collab-maint/kate-folder-service-menu.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/kate-folder-service-menu.git;a=summary

Package: kate-folder-service-menu
Architecture: any
Depends: kate , dolphin
Description: kate service menu to open folders
It's a service menu for dolphin that allow you
to open folders skipping no-text files

rules should be like this :

#!/usr/bin/make -f
%:
	dh $@

copyright

well copyright it’s your stuff so…

Format: http://dep.debian.net/deps/dep5
Upstream-Name: kate-folder-service-menu
Source: http://kde-apps.org/content/show.php/kate+folder+service+menu?content=147325

Files: *
Copyright: 2012 Nowardev Peace nowardev@gmail.com

License: GPL-3.0+

Files: debian/*
Copyright: 2012 Peace nowardev@gmail.com
License: GPL-3.0+

License: GPL-3.0+
 This program 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 3 of the License, or
 (at your option) any later version.
 .
 This package 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.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see .
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

 

now we have all done!

so give this command :

debuild -uc -us --source-option=--include-binaries --source-option=-isession 

try to build it with

sudo pbuilder build debianpackagingtest/kate-folder-service-menu-0.1.0/kate-folder-service-menu_0.1.0-1.dsc

you will find it here

debianpackagingtest/
|    ├──kate-folder-service-menu-0.1.0/
|    ├── debian
|    │   ├── changelog
|    │   ├── compat
|    │   ├── control
|    │   ├── copyright
|    │   ├── docs
|    │   ├── install
|    │   ├── README.Debian
|    │   ├── README.source
|    │   ├── rules
|    │   ├── source
|    │   │   ├── format
|    │   │   └── include-binaries
|    │   └── usr
|    │       ├── bin
|    │       │   └── ktexeditor-open-folder
|    │       └── share
|    │           └── kde4
|    │               └── services
|    │                   └── ServiceMenus
|    │                       └── kate-folder.desktop
|    └── usr
|        ├── bin
|        └── ktexeditor-open-folder
|        └── share
|            └── kde4
|                └── services
|                    └── ServiceMenus
|                        └── kate-folder.desktop
├── kate-folder-service-menu_0.1.0-1.debian.tar.gz
├── kate-folder-service-menu_0.1.0-1.dsc                    >========pbuilder file ======================
├── kate-folder-service-menu_0.1.0-1_i386.build
├── kate-folder-service-menu_0.1.0-1_i386.changes
├── kate-folder-service-menu_0.1.0-1_i386.deb
├── kate-folder-service-menu_0.1.0-1_source.build
├── kate-folder-service-menu_0.1.0-1_source.changes    >=============lauchpad file 
├── kate-folder-service-menu_0.1.0-1_source.ppa.upload
└── kate-folder-service-menu_0.1.0.orig.tar.gz

now

debuild -k17E874FB -S -sa

where -k17E874FB it’s -k your openpgp key as you can see here

finallynow you can try to upload it on lauchpad with

dput ppa:nowardev/ppa  debianpackagingtest/kate-folder-service-menu-0.1.0/kate-folder-service-menu_0.1.0-1_source.changes 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: