<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bugs.maemo.com/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Port an existing Debian package - Revision history</title>
		<link>http://bugs.maemo.com/index.php?title=Port_an_existing_Debian_package&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Thu, 09 Apr 2026 14:38:39 GMT</lastBuildDate>
		<item>
			<title>amigadave:&amp;#32;/* Modifying a Debian package for Maemo */ link to packaging guidelines directly</title>
			<link>http://bugs.maemo.com/index.php?title=Port_an_existing_Debian_package&amp;diff=33617&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=Port_an_existing_Debian_package&amp;diff=33617&amp;oldid=prev</guid>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Modifying a Debian package for Maemo:&amp;#32;&lt;/span&gt; link to packaging guidelines directly&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:00, 28 April 2010&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Modifying a Debian package for Maemo ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Modifying a Debian package for Maemo ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Once you have the source of the Debian package, you will need to make some modifications to that package for it to build under Maemo. See the [[Packaging&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;#Packaging_policy&lt;/del&gt;|Maemo packaging &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;policy&lt;/del&gt;]] for more information.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Once you have the source of the Debian package, you will need to make some modifications to that package for it to build under Maemo. See the [[Packaging&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/Guidelines&lt;/ins&gt;|Maemo packaging &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;guidelines&lt;/ins&gt;]] for more information.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The maintainer field (in the &amp;lt;code&amp;gt;debian/control&amp;lt;/code&amp;gt; file) must be changed if the upstream package is modified, for example:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The maintainer field (in the &amp;lt;code&amp;gt;debian/control&amp;lt;/code&amp;gt; file) must be changed if the upstream package is modified, for example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-04-09 14:38:39 --&gt;
&lt;/table&gt;</description>
			<pubDate>Wed, 28 Apr 2010 14:00:05 GMT</pubDate>			<dc:creator>amigadave</dc:creator>			<comments>http://bugs.maemo.com/Talk:Port_an_existing_Debian_package</comments>		</item>
		<item>
			<title>amigadave:&amp;#32;split from Packaging</title>
			<link>http://bugs.maemo.com/index.php?title=Port_an_existing_Debian_package&amp;diff=33613&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=Port_an_existing_Debian_package&amp;diff=33613&amp;oldid=prev</guid>
			<description>&lt;p&gt;split from &lt;a href=&quot;/Packaging&quot; title=&quot;Packaging&quot;&gt;Packaging&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{main|Packaging}}&lt;br /&gt;
&lt;br /&gt;
== Finding your package in Debian ==&lt;br /&gt;
&lt;br /&gt;
If you want to port a Debian package to Maemo, you should check and see if it is already packaged for Debian and use that package if you can - this will save you time and effort. You can search in Debian's [http://www.debian.org/distrib/packages Package Tracking System (PTS)] to see if it is there. There is a search system on the PTS page, under the &amp;quot;distribution&amp;quot; drop-down, select 'any', this will search throughout Debian's repositories to find the package. Debian has more than 20,000 packages just in its stable distribution so your application is likely already packaged.&lt;br /&gt;
&lt;br /&gt;
If you find the package already exists in Debian, you can get the source, including the packaging source, with apt-get. To do this, you'll have to edit your &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, you can follow this recipe;&lt;br /&gt;
&lt;br /&gt;
 $ echo &amp;quot;deb http://ftp.it.debian.org/debian/ unstable main contrib non-free&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 $ echo &amp;quot;deb-src http://ftp.it.debian.org/debian/ unstable main contrib non-free&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 $ apt-get update&lt;br /&gt;
 $ apt-cache search &amp;quot;application name&amp;quot;&lt;br /&gt;
 $ apt-get source &amp;quot;application name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
''To learn more about the &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt; you can do a 'man sources.list' if you are running Debian or a Debian-based GNU/Linux distro.''&lt;br /&gt;
&lt;br /&gt;
== Modifying a Debian package for Maemo ==&lt;br /&gt;
&lt;br /&gt;
Once you have the source of the Debian package, you will need to make some modifications to that package for it to build under Maemo. See the [[Packaging#Packaging_policy|Maemo packaging policy]] for more information.&lt;br /&gt;
&lt;br /&gt;
The maintainer field (in the &amp;lt;code&amp;gt;debian/control&amp;lt;/code&amp;gt; file) must be changed if the upstream package is modified, for example:&lt;br /&gt;
 Maintainer: Tcl/Tk Debian Packagers &amp;lt;pkg-tcltk-devel@lists.alioth.debian.org&amp;gt;&lt;br /&gt;
should be replaced by&lt;br /&gt;
 Maintainer: My Name &amp;lt;my@email.com&amp;gt;&lt;br /&gt;
 XSBC-Original-Maintainer: Tcl/Tk Debian Packagers &amp;lt;pkg-tcltk-devel@lists.alioth.debian.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must add a new entry to &amp;lt;code&amp;gt;debian/changelog&amp;lt;/code&amp;gt; and append &amp;lt;code&amp;gt;maemo1&amp;lt;/code&amp;gt; to the version, for example:&lt;br /&gt;
 tk8.5 (8.5.8-1) unstable; urgency=low&lt;br /&gt;
becomes:&lt;br /&gt;
 tk8.5 (8.5.8-1maemo1) fremantle; urgency=low&lt;br /&gt;
This indicates that there have been Maemo-specific changes to the packaging. If you upload new changes, you must add a new changelog entry and increment the version number, for example &amp;lt;code&amp;gt;maemo2&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Debian way&amp;quot; is to keep all modifications to the package in the &amp;lt;code&amp;gt;package.version.diff.gz&amp;lt;/code&amp;gt; file and to leave the &amp;lt;code&amp;gt;.orig.tar.gz&amp;lt;/code&amp;gt; file untouched. There are several ways to apply patches with Debian packaging, and some are described in the [http://www.debian.org/doc/maint-guide/ch-build.en.html#s-dpatch patching section of the New Maintainer's Guide]&lt;br /&gt;
&lt;br /&gt;
However, the &amp;lt;code&amp;gt;.diff.gz&amp;lt;/code&amp;gt; cannot store binary files like icons. A possible workaround is to uuencode the binary file, for example (in &amp;lt;code&amp;gt;debian/&amp;lt;/code&amp;gt;):&lt;br /&gt;
 uuencode -m icon.png icon.png  &amp;gt; icon.png.b64&lt;br /&gt;
and in the rules file decode the file to debian/icon.png before installation&lt;br /&gt;
 uudecode debian/icon.png.b64&lt;br /&gt;
For this solution you have to add &amp;lt;code&amp;gt;sharutils&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Build-Depends&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the package should be visible in the Application Manager, the Section field should begin with &amp;lt;code&amp;gt;user/&amp;lt;/code&amp;gt;, with the [[Packaging#Sections|valid sections]]. You should also add and install a &amp;lt;code&amp;gt;.desktop&amp;lt;/code&amp;gt; file for starting the application, if one does not already exist.&lt;br /&gt;
&lt;br /&gt;
== Differences between Debian/Ubuntu and Maemo ==&lt;br /&gt;
&lt;br /&gt;
The are a couple of important differences between a Debian system and Maemo:&lt;br /&gt;
&lt;br /&gt;
* '''Busybox''':&amp;lt;br/&amp;gt;Maemo uses busybox to replace most of bsdutils, coreutils, findutils and bash, therefore most of the extended options for the commands and shell are not available. Check the postinstall and other package scripts for such options and try to replace or emulate them.&lt;br /&gt;
&lt;br /&gt;
* Outdated '''build and configuration tools''':&amp;lt;br/&amp;gt;the SDK and autobuilder provide only outdated versions of gcc, dpkg, debhelper, cdbs, debconf, ucf and other build tools. Try to replace the &amp;lt;code&amp;gt;Build-Depends&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;debian/control&amp;lt;/code&amp;gt; file with older versions or use backports like [[Packaging#Debhelper_7|debhelper7]]&lt;br /&gt;
&lt;br /&gt;
* Directories for '''temporary files''':&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt; is only 900 kB and should only be used for very small temporary files. &amp;lt;code&amp;gt;/var/tmp&amp;lt;/code&amp;gt; on the NAND is larger. A new temporary directory in &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt; could be even larger. Replace constructs like &amp;lt;code&amp;gt;${TMP-/tmp}&amp;lt;/code&amp;gt; in shell scripts with &amp;lt;code&amp;gt;${TMP-/var/tmp}&amp;lt;/code&amp;gt; (the same applies to &amp;lt;code&amp;gt;mktemp -p /tmp&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
* '''Optification''' may confuse programs:&amp;lt;br/&amp;gt;some programs try to find their data files relative to the binary location. Such a program stored in &amp;lt;code&amp;gt;/opt/maemo/usr/bin/program&amp;lt;/code&amp;gt; would search, for instance, in &amp;lt;code&amp;gt;/opt/maemo/usr/share&amp;lt;/code&amp;gt; while the actual data may be in &amp;lt;code&amp;gt;/usr/share&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Installation in &amp;lt;code&amp;gt;/opt&amp;lt;/code&amp;gt;:&amp;lt;br/&amp;gt;if you want to perform manual optification (e.g. using &amp;lt;code&amp;gt;configure --prefix=/opt/package&amp;lt;/code&amp;gt;) you should store &amp;quot;none&amp;quot; in &amp;lt;code&amp;gt;debian/optify&amp;lt;/code&amp;gt; and add some to the postinst script which symlinks the binaries and libraries of the package to &amp;lt;code&amp;gt;/usr/bin&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lib&amp;lt;/code&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
* Documentation:&amp;lt;br/&amp;gt;do not install documentation in &amp;lt;code&amp;gt;/usr/share/doc&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/usr/share/info&amp;lt;/code&amp;gt; - docpurge will remove it. You may install it in the &amp;lt;code&amp;gt;/opt&amp;lt;/code&amp;gt; hierarchy, however.&lt;br /&gt;
&lt;br /&gt;
[[Category:Packaging]]&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</description>
			<pubDate>Wed, 28 Apr 2010 13:32:55 GMT</pubDate>			<dc:creator>amigadave</dc:creator>			<comments>http://bugs.maemo.com/Talk:Port_an_existing_Debian_package</comments>		</item>
	</channel>
</rss>