The Following 45 Users Say Thank You to ammyt For This Useful Post: | ||
ahmadamaj, Bad_Habit, dadoabdallah, debernardis, drucula, dr_frost_dk, ejasmudar, emam damon, ersanpermana, Estel, F2thaK, Fatalist, fw190, guyr, Halftux, hrbani, ivgalvez, JonWW, knobtviker, marmistrz, MartinK, mattaustin, Mike Fila, MINKIN2, mscion, niloy, ranbaxy, rcolistete, rfeese, Schturman, scoobydoo, sifo, sixwheeledbeast, Soppa, SSLMM, StefanL, strange1712, sunyakram, tcm34riu234h, tecs, The Winter, thedead1440, woody14619, Xagoln, Zaerc |
|
2011-12-16
, 14:48
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#2
|
|
2011-12-16
, 14:52
|
|
Posts: 1,918 |
Thanked: 3,118 times |
Joined on Oct 2010
@ My pants
|
#3
|
Thanks for this nice tutorial. Could you please consider transferring this whole post to Wiki, as Wiki page?
Also, post about using dput to transfer .deb into repositories (omitting autobuilder) could greatly increase packages couunt in repository, at the same time decreasing number of available-only-from-forum-threads-hidden-somewhere programs
/Estel
The Following User Says Thank You to ammyt For This Useful Post: | ||
|
2011-12-16
, 15:04
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#4
|
|
2011-12-16
, 15:17
|
|
Posts: 1,918 |
Thanked: 3,118 times |
Joined on Oct 2010
@ My pants
|
#5
|
Actually, this wink wasn't meant at You program, as i don't use it (no offense). It was rather about plentora of posts like "I would put it into repos, but I don't have time to learn autobuilder, could someone do it for me?".
As for harmattan, I have no idea - thankfully, no need to even touch it
|
2011-12-16
, 15:47
|
Posts: 1,269 |
Thanked: 3,961 times |
Joined on May 2011
@ Brazil
|
#6
|
The Following User Says Thank You to rcolistete For This Useful Post: | ||
|
2011-12-16
, 15:55
|
|
Posts: 1,918 |
Thanked: 3,118 times |
Joined on Oct 2010
@ My pants
|
#7
|
Yes, MeeGo 1.2 Harmattan has 'dpkg-dev' package (when Harmattan SDK repository is enabled). As well as 'build-essential' (installation of 93 MB). Also 'bsdtar' is available.
So 'dpkg-deb', g++, etc, are available in Nokia N9/N950.
The Following User Says Thank You to ammyt For This Useful Post: | ||
|
2011-12-16
, 23:26
|
Posts: 915 |
Thanked: 3,209 times |
Joined on Jan 2011
@ Germany
|
#8
|
The Following User Says Thank You to sulu For This Useful Post: | ||
|
2011-12-21
, 16:50
|
Posts: 1,269 |
Thanked: 3,961 times |
Joined on May 2011
@ Brazil
|
#9
|
This how-to does not take into account that the N900 has very limited space on / where /usr resides. Therefore it would be good to move all package contents from /usr to /opt and create symlinks in /usr. This is what Maemo users call "optification" of a package.
|
2011-12-21
, 17:42
|
|
Posts: 1,918 |
Thanked: 3,118 times |
Joined on Oct 2010
@ My pants
|
#10
|
1. Having files of your package in /home/user/
2. Creating a folder inside the package's folder called DEBIAN, which consists of the Debian build files, we're interested in three of them:
2a) control: A file that tells dpkg how to build the package. (Mandatory)
2b) preinst: A script executed before the app installation. (Can be omitted)
2c) postinst: A script executed after the app installation. (Can be omitted)
3. The actual building of the package
Packaging Executable Apps
Let's take an example app that you have already coded, foo. Assuming the executable file foo is in ./MyDocs this is what should be done:
1. We are going to create a folder in /home/user called foopackage, which contains all the folder hierarchy. (NOTE: The path should be /home/user not /home/user/MyDocs since files there cannot have their permissions edited.)
7. This is all of the basic things prepared. If you use more files, say required by the app, then just create the corresponding hierarchies and copy them to there. In this context, foo is now complete. Final hierarchy to build is the DEBIAN folder, which consists of the files mentioned that state how to build the package. The DEBIAN folder and all files inside should have 755 permisions.
10. Let's build!
Packaging a File or a Batch of Files
Take a theme for example, it is basically a folder with lots of folders and icons in it. It is much easier than an app. We are going to take a folder called themfoo, which is a folder containing many other files and folders in it, a typical theme.
1. First thing is to copy the whole folder to /home/user:
Summary
When a .deb package is installed, its contents get extracted to the folders in the hierarchy. If a package for example consists of a folder called gaga, and that folder contains a file called lady, then after the deb package is installed you will find a folder called gaga with a file called lady in it on your device. The process is very simple, just drop whatever files and folders you want extracted to their respective hierarchies, and create the DEBIAN directory with the control file then build the package and VOILA!
A diagram illustrating foopackage,deb:
So you know now that after installing the package the files foo.desktop will be extracted to usr/share/applications/hildon and that the file foo will be extracted to /usr/bin and that foo.png will be extracted to /usr/share/pixmaps
[NITDroid] [My Qtlockscreen Skins] [QBW HTC Sense on Your N900!] [CPU Power Control] [Debian Packaging] [Build Me!]
Youtube Channel - Subscribe!
Retired Dev - Thanks for all the fish!
Last edited by ammyt; 2012-04-25 at 10:52.