Create a .deb Package from scripts or binaries

1

Use dh_make to make a template for the package. It'll ask you a few questions and create the required debian directory.

For a package that contains both binary executables and architecture-independent programs, you have two choices: make a single architecture-dependent binary package, or make an architecture-dependent binary package containing the binary executables and an architecture-independent binary package containing the scripts and other architecture-independent files. The main advantage of architecture-independent packages is to save space on distribution mirrors that store packages for multiple architectures. You also need to put the architecture-independent files in an architecture-independent package if you have a multiarch installation and you want to install the binaries for more than one architecture. Unless you care about this, make a single package, it's simpler. If you decide to make two packages, it's common to have a foo architecture-dependent package...

0 0
2

Scripts

Skip to questions, Wiki by user kris-harper

Shell scripting with a common shell language like Bash, Perl, or PHP. Scripting in Python or other scripting languages are also appropriate topics.

Questions

Q: How do I create a deb package for a single python script?

Tags: scripts python (Next Q), packaging (Next Q)

I have a single python script that I want to distribute as a deb package. It is a indicator which shows local date in Unity panel. I did follow create a .deb Package from scripts or binaries but I could not create a deb package because it fails.

Can someone give me a step-by-step instruction on what I should do? As far as I know this script depends on python-appindicator.

NOTE:
I do not want any links to Debian/Ubuntu packaging instructions. I have seen most of them. I don't find them beginner friendly.

Tags: scripts python (Next Q), packaging (Next Q)

User: sagarchalise

Answer by...

0 0
3

I have a single python script that I want to distribute as a deb package. It is a indicator which shows local date in Unity panel. I did follow create a .deb Package from scripts or binaries but I could not create a deb package because it fails.

Can someone give me a step-by-step instruction on what I should do? As far as I know this script depends on python-appindicator.

NOTE:
I do not want any links to Debian/Ubuntu packaging instructions. I have seen most of them. I don't find them beginner friendly.

You could try with Debreate, a GUI tool for creating packages.

davidc3
December 30, 2011 13:55 PM

create a folder with any name on your home eg: mypyscript Open the folder and create two folders with names 'DEBIAN' and 'usr' Open the folder DEBIAN. Create a text file (without extension) with name 'control' there.

Open 'control' and type as follows and save it on DEBIAN

Package: mypyscript Version: 0.01 Architecture: all Maintainer:...
0 0
4

I've found this method to work in most but NOT all cases, as sometimes additional depencies are required in order to build the package.

STEP 1:

The required packages are:

build-essential
automake
autoconf
libtool
pkg-config
libcurl4-openssl-dev
intltool
libxml2-dev
libgtk2.0-dev
libnotify-dev
libglib2.0-dev
libevent-dev
checkinstall

Or simply run the following command:

$ sudo apt-get install build-essential automake autoconf libtool pkg-config libcurl4-openssl-dev intltool libxml2-dev libgtk2.0-dev libnotify-dev libglib2.0-dev libevent-dev checkinstall

STEP 2:

Now to make the package:

The source tarball "transmission-1.76.tar.bz2" is used in this example (sub the .bz2 tarball of the source code for the app you are working on for this one)

$ tar xvjf transmission-1.76.tar.bz2 (alt:or you can extract the data from the tarball using the archive...

0 0
5

I searched for a simple way to create .deb Packages for things which have no source code to compile (configs, shellscripts, proprietary software). This was quite a problem because most of the package tutorials are assuming you have a source tarball you want to compile. Then I've found this short tutorial (german).

Afterwards, I created a small script to create a simple repository. Like this:

rm /export/my-repository/repository/* cd /home/tdeutsch/deb-pkg for i in $(ls | grep my); do dpkg -b ./$i /export/my-repository/repository/$i.deb; done cd /export/avanon-repository/repository gpg --armor --export "My Package Signing Key" > PublicKey apt-ftparchive packages ./ | gzip > Packages.gz apt-ftparchive packages ./ > Packages apt-ftparchive release ./ > /tmp/Release.tmp; mv /tmp/Release.tmp Release gpg --output Release.gpg -ba Release

I added the key to the apt keyring and included the source like this:

deb http://my.default.com/my-repository/ ./

It looks like the...

0 0
6

I would like to create a Debian/Ubuntu .deb package from a set of prebuilt binaries. I don't have any access to the source code. The only tutorials I've found on creating debs require source code access, and so do all the convenient and easy tools for creating Debian packages.

So how can I create a deb from a folder of binaries?

-------------Problems Reply------------

1) you need to know where to put those binaries: in /usr/bin?

2) Then, you need you create yourself a temp directory for packaging e.g. /tmp/package

3) You need to write yourself DEBIAN control files e.g. control, postrm, preinst etc.

4) You put those DEBIAN control files in /tmp/package/DEBIAN

5) You run 'dpkg-deb'

This is just a quick overview; some steps are missing. Have a look at how I do this with my makefiles here under /trunk/project.

This should get you started anyhow. Hope this helps.

you should have a look here (part 4 and 6 for basic...

0 0
7

All of the hip kids today are into deploying packages and complex systems with things like Ansible, Docker, Chef, Puppet, Vagrent and Salt Stack. While these deployment tools are awesome, you should not forget about good old fashioned system packages for application deployment. I fully understand there are times when some of these newer deployment tools are a better fit, but, as time goes on, I run across more and more overly complicated and convoluted deployment procedures using these new tools when a simple deb or rpm package could be used. Maybe Im just oldschool, but whenever possible, I prefer to handle application deployment with system packages, such as debs or rpms.

Creating deb packages to deploy applications in Debian or Ubuntu is a fairly simple process. However, I have found that the majority of existing documentation for doing so is overly verbose or more complex than needed. This writeup aims to summaries the process of creating deb packages in just a few...

0 0
8

Ubuntu’s package management system, which it owes to it’s big brother Debian, makes it as simple as it gets to keep your system up to date. Whether through GUI programs or using “apt-get“, constantly impresses me. But there are still instances where you can’t get a particular program in DEB format, or maybe you want to distribute your own software for other Debian and Ubuntu users. Putting together a DEB package by hand is a daunting task… fortunately, Debreate makes it easy to package up software for easy installation.

Note: This is the second part of creating the deb packages series. You can read the first part: The Basics of Debian Package Management: DEB Packages [Linux 101] here.

The first thing we’ll need to do is install Debreate. You can download the package from Sourceforge here, then install with the package manager of your choice, or with the following command:

sudo dpkg -i debreate_0.7.7_all.deb

Then we can launch Debreate from KRunner by...

0 0
9
...
0 0
10

This are my initial notes on creating debian packages
1. Create a .deb to install script or file
2. Create .deb with dependencies only
3. More complicated packages
4. Package Repository

Packages typically required:

apt-get install build-essential autoconf autoconf automake autotools-dev dh-make apt-get install debhelper devscripts fakeroot xutils lintian pbuilder

1. Create a .deb to install a script or file

The goal is to create a package that simply puts a shell script where I want it. Tested on Ubuntu 10.04 LTS.

Create a directory to build your packages in. Some use "deb" and others use "packages". Others create a directory structure for making multiple packages under "deb" (or whatever).
mkdir deb Create the directory structure in deb that represents where you want the script to be placed1
mkdir -p ./deb/usr/local/bin Copy the script into your new directory
cp /path/to/my/script/myscript.sh...
0 0
11

So, how do we go about making .deb packages? Good question. This is where we capture those notes, which are eventually going to be used to make a build script that automates the process for us.

These are the pages we referenced the most when figuring out how to do this.

This is the process we used to set up the first Debian package build:

git clone https://github.com/Byzantium/ByzPi.git cd ByzPi mkdir ourpackage-v0.1 cd ourpackage-v0.1 cp ~/Byzantium/ourcode.py . dh_make -s --indep --createorig This creates a Debian package skeleton. echo "ourcode.py /usr/sbin" >> debian/install Do this one for every file and new directory that has to be installed from the package. echo "1.0" > debian/source/format This sets the package format for dpkg. echo "8" > debian/compat This is the version of the debian/ directory layout we're using. rm debian/*.ex debian/*.EX vi debian/changelog Fill out the changelog using the Debian format. This is to keep track of what we did as well...
0 0
12

While there are thousands of packages in the Ubuntu archive, there are still a lot nobody has gotten to yet. If there is an exciting new piece of software that you feel needs wider exposure, maybe you want to try your hand at creating a package for Ubuntu or a PPA. This guide will take you through the steps of packaging new software.

You will want to read the Getting Set Up article first in order to prepare your development environment.

4.1. Checking the Program

The first stage in packaging is to get the released tar from upstream (we call the authors of applications “upstream”) and check that it compiles and runs.

This guide will take you through packaging a simple application called GNU Hello which has been posted on GNU.org.

Download GNU Hello:

$ wget -O hello-2.10.tar.gz "http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"

Now uncompress it:

$ tar xf hello-2.10.tar.gz $ cd hello-2.10

This application uses the autoconf build system...

0 0
13

The intended use of such a newly created archive is to install it only on your own box, not to get them into the official Debian distribution. To follow the 'official' process, please study the Debian New Maintainers' Guide.

Normal Debian packages get a proper source package, including a debian/rules file which automates the steps involved in creating the binary package. Here we just show how to package a simple shell script or binary executable into a small binary package.

BTW, I assume you know how to use 'tar', 'man', and what a '.tar.gz' file and Debian is (and how to use an editor ;-), but I assume you have never touched programs like 'ar' or 'dpkg'.

From the Debian Reference 2.2.2 2002-11-30: "The internals of this Debian binary package format are described in the deb(5) manual page. Because this internal format is subject to change (between major releases of Debian), always use dpkg-deb(8) for manipulating .deb files."

From the dpkg-deb...

0 0
14
Create Debian and Ubuntu Packages

Create your own Debian or Ubuntu packages

Roll you own

When you're discovering Linux, especially the system administration aspects of it, you'll sooner or later will want to create and maybe even publish your own packages. Here is a small introduction in the fine art of creating Debian packages. As it happens, this can also be used to create 'virtual' packages, packages that only contain references to other packages, or packages that only contain sutomized configuration files, which can be extremely useful in reproducing a system.

In this tutorial, we'll go step by step through the pocess of creating .deb packages, starting with really simple packages and building up to compile and build from source, and publishing packages in a repository.

1. A simple package

A debian package is basically a tar archive, and the essense of creating a debian package is that you

create a directory structure in a...
0 0