Editing User:Mohammad7410/Packaging

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 21: Line 21:
'''The debian directory should contain at least this basic set of files, without them, a package cannot be built''':
'''The debian directory should contain at least this basic set of files, without them, a package cannot be built''':
-
A '''control''' file, this holds information such as name of package(s - multiple packages can be built from one source), description, maintainer name, section, packages needed to build the source, and the dependencies, and (for Maemo), icons for the application manager and "pretty" names, also for the application manager.
+
A control file, this holds information such as name of package(s - multiple packages can be built from one source), description, maintainer name, section, packages needed to build the source, and the dependencies, and (for Maemo), icons for the application manager and "pretty" names, also for the application manager.
-
A '''changelog''' file, this holds again, the name of the source (not the separate packages), the version number, the changes in that version number, and a signature with the name and email for the person who edited the old source, as well as a timestamp, this file can be auto-generated with dch.
+
A changelog file, this holds again, the name of the source (not the separate packages), the version number, the changes in that version number, and a signature with the name and email for the person who edited the old source, as well as a timestamp, this file can be auto-generated with dch.
-
A '''compat''' file, which contains the version of debhelper needed, only a number is held in this file, usually 5.
+
A compat file, which contains the version of debhelper needed, only a number is held in this file, usually 5.
-
A '''rules''' file, which contains the build instructions.
+
A rules file, which contains the build instructions.
-
 
+
-
'''What should these files contain?'''
+
-
These files can be generated using dh_make, however, I find cleaning the examples it generates a bit tedious, so I copy the files from my own sample debian/ folder.
+
-
 
+
-
control file:
+
-
Source: source_name
+
-
Section: section_goes_here, possible sections listed here http://wiki.maemo.org/Packaging#Sections
+
-
Priority: extra
+
-
Maintainer: Your_FULL_REAL_name <email_must_NOT_be_fake>
+
-
Build-Depends: debhelper (>= 5) # deps needed to build the package (e.g libqt4-dev for
+
-
Standards-Version: 3.7.2
+
-
+
-
Package: first_package_name
+
-
XB-Maemo-Display-Name: Name to be displayed in HAM
+
-
Architecture: architecture, can be all/i386/armel
+
-
Depends: dependencies for the package
+
-
Description: short description here
+
-
  hildon-theme-alpha's boxes have a black border around theme, this package fixes the size 70 one.
+
-
 
+
-
Example:
+
-
 
+
-
Source: maemodeb
+
-
Section: user/system
+
-
Priority: extra
+
-
Maintainer: Mohammad Abu-Garbeyyeh <mohammad7410@gmail.com>
+
-
Build-Depends: debhelper (>= 5)
+
-
Standards-Version: 3.7.2
+
-
+
-
Package: maemodeb
+
-
XB-Maemo-Display-Name: Maemo Deb
+
-
Architecture: all
+
-
Depends: apt, ${shlibs:Depends}
+
-
Description: Sample package to show how packaging works
+
-
  Long description of the application to be shown if a user clicks Description in HAM
+
-
 
+
-
changelog:
+
-
source_name (version_number) unstable; urgency=low
+
-
+
-
  * Initial release.
+
-
+
-
  -- Mohammad Abu-Garbeyyeh <mohammad7410@gmail.com>  Sun, 10 Oct 2010 23:31:54 +0200
+
-
 
+
-
Example:
+
-
maemodeb (0.1) unstable; urgency=low
+
-
+
-
  * Initial release.
+
-
+
-
  -- Mohammad Abu-Garbeyyeh <mohammad7410@gmail.com>  Sun, 10 Oct 2010 23:31:54 +0200
+
-
 
+
-
This file can further be edited using dch, part of the package devscripts, apt-get install devscripts.
+
-
 
+
-
compat file:
+
-
5
+
-
 
+
-
rules file:
+
-
This is the only part of packaging where you have to think what to do, you will need to add the parts needed to configure-stamp, for example ./configure should be added there, or qmake if you're using Qt and a .pro file.
+
-
 
+
-
You will need to add the parts to compile the files to build-stamp, e.g make.
+
-
 
+
-
And finally, the parts needed to install the file, e.g $(MAKE) DESTDIR=$(CURDIR)/debian/package_name install.
+
-
If your make file does not handle file installations, you can use an install file in debian/ and keep dh_install in the rules file, as per below.
+
-
#!/usr/bin/make -f
+
-
# -*- makefile -*-
+
-
# Sample debian/rules that uses debhelper.
+
-
# This file was originally written by Joey Hess and Craig Small.
+
-
# As a special exception, when this file is copied by dh-make into a
+
-
# dh-make output file, you may use that output file without restriction.
+
-
# This special exception was added by Craig Small in version 0.37 of dh-make.
+
-
+
-
# Uncomment this to turn on verbose mode.
+
-
#export DH_VERBOSE=1
+
-
+
-
CFLAGS = -Wall -g
+
-
+
-
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+
-
  CFLAGS += -O0
+
-
else
+
-
CFLAGS += -O2
+
-
endif
+
-
+
-
configure: configure-stamp
+
-
configure-stamp:
+
-
dh_testdir
+
-
# Add here commands to configure the package.
+
-
+
-
touch configure-stamp
+
-
+
-
+
-
build: build-stamp
+
-
+
-
build-stamp: configure-stamp
+
-
dh_testdir
+
-
touch build-stamp
+
-
+
-
clean:
+
-
dh_testdir
+
-
dh_testroot
+
-
rm -f build-stamp configure-stamp
+
-
dh_clean
+
-
+
-
install: build
+
-
dh_testdir
+
-
dh_testroot
+
-
dh_clean -k
+
-
dh_installdirs
+
-
+
-
# Build architecture-independent files here.
+
-
binary-indep: build install
+
-
# We have nothing to do by default.
+
-
+
-
# Build architecture-dependent files here.
+
-
binary-arch: build install
+
-
dh_testdir
+
-
dh_testroot
+
-
dh_installchangelogs debian/changelog
+
-
  dh_install
+
-
# dh_installmenu
+
-
# dh_installdebconf
+
-
# dh_installpam
+
-
# dh_installmime
+
-
# dh_installinit
+
-
dh_installman
+
-
dh_link
+
-
dh_strip
+
-
dh_compress
+
-
dh_fixperms
+
-
# dh_perl
+
-
# dh_makeshlibs
+
-
dh_installdeb
+
-
dh_shlibdeps
+
-
dh_gencontrol
+
-
dh_md5sums
+
-
dh_builddeb
+
-
+
-
binary: binary-indep binary-arch
+
-
.PHONY: build clean binary-indep binary-arch binary install configure
+
-
 
+
-
Sample install file:
+
-
bin/psfreedom-enable-n900.sh usr/sbin
+
-
bin/psfreedom-disable-n900.sh usr/sbin
+
-
bin/psfreedommoduledetection.sh usr/sbin
+
-
bin/psfreedom usr/bin
+
-
src/ui/PSFreedom opt/psfreedom
+
-
data/psfreedom.sudoers etc/sudoers.d
+
-
data/psfreedomicon.png usr/share/pixmaps
+
-
data/psfreedom.desktop usr/share/applications/hildon
+
-
 
+
-
== Additional files ==
+
-
Although basic packaging was covered above, you might need extra files such as:
+
-
 
+
-
A '''postinst''' file, which is a file that is run post installation (Setting up <packagename> ...), these files should be normal shell scripts that run the commands you need (such as chmod +x, update-sudoers etc...). Variations exist such as postinst/postrm/preinst/prerm, post is after, pre is before, inst is installation, rm is removal. Keep in mind that these are all run as root (with sudo!), so dbus-send commands should be run with run-standalone.sh(!!!), and permissions have to be kept in mind.
+
-
 
+
-
#!/bin/sh
+
-
+
-
echo "Updating sudoers"
+
-
update-sudoers
+
-
+
-
exit 0
+
-
 
+
-
A '''.desktop''' file, which is a menu icon, this is installed to /usr/share/applications/hildon/, either by an install file, or a makefile.
+
-
 
+
-
[Desktop Entry]
+
-
Encoding=UTF-8
+
-
Version=0.1
+
-
Type=Application
+
-
Name=PSFreedom # As shown in the menu.
+
-
Icon=psfreedomicon # Icon file, e.g psfreedomicon.png in /usr/share/pixmaps/
+
-
Exec=psfreedom # What to run, full path needed if not in $PATH (i.e if it's run from /opt)
+
-
X-Osso-Service=org.maemo.psfreedom # (Fully optional! Should only be added if a .service file exists.
+
-
 
+
-
A '''.service''' file, this is not normally needed, except if you want to launch your application via dbus and if you want to load a splash screen with hildon-desktop, again, this is optional. This is installed/copied to /usr/share/dbus-1/services/
+
-
 
+
-
[D-BUS Service]
+
-
Name=org.maemo.psfreedom # Name of service file, you decide what you want it to be.
+
-
Exec=/usr/bin/psfreedom # What to execute.
+

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)