Skip to content

Instantly share code, notes, and snippets.

@trap000d
Created February 23, 2018 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trap000d/58a2f45f0115373833145dad42e4736c to your computer and use it in GitHub Desktop.
Save trap000d/58a2f45f0115373833145dad42e4736c to your computer and use it in GitHub Desktop.
Create Ubuntu DEB package from a Qt application for Launchpad
Create Ubuntu DEB package from a Qt application
Setting up the environment
sudo apt-get install build-essential devscripts ubuntu-dev-tools debhelper dh-make diff patch gnupg fakeroot lintian pbuilder
sudo apt-get install cdbs
Pbuilder lets you build in a clean, chroot environment, ensuring
all dependencies are present. Create a file .pbuilderrc
nano .pbuilderrc
and fill it with
COMPONENTS="main restricted universe multiverse"
Then construct the base environment (note: it can take a long time)
sudo pbuilder create
#Export Info Variables
export DEBFULLNAME="VORNAME NACHNAME"
export DEBEMAIL="MAIL@ADRESSE"
#create orig file and debian Folder
dh_make -s -p appname_0.1 -c gpl2 --createorig
#remove crap files
rm debian/*.ex debian/*.EX
rm debian/README.Debian
rm debian/README.source
Then save the debian/rules file with these contents
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/qmake.mk
#debian/changelog example
appname-1.0 (1.0-1) precise; urgency=low
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
-- max muster <max@muster.com> Tue, 05 Nov 2013 21:23:34 +0100
Add the following Lines to your .pro-file in the parent directory
TARGET = <application>
target.path = /usr/bin
INSTALLS += target
optional: add supplementary files to the installation
data.path = /usr/share/<application>/data
data.files = data/*
INSTALLS += data
Building the package
alternative version of an existing package (will be uploaded without the .orig.tar.gz file):
debuild -S -sd
brand new package with no existing version in Ubuntu's repositories (will be uploaded with the .orig.tar.gz file):
debuild -S -sa
Infos from:
https://wiki.ubuntu.com/PackagingGuideDeprecated/QtApplication
http://wiki.siduction.de/index.php?title=Debian-Paket_erstellen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment