maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   The Grand DEB Packaging Thread! (https://talk.maemo.org/showthread.php?t=80914)

F2thaK 2012-09-02 02:09

Re: The Grand DEB Packaging Thread!
 
did you change bash to sh or sb??

where are you running script?

flotron 2012-09-02 02:55

Re: The Grand DEB Packaging Thread!
 
Quote:

Originally Posted by F2thaK (Post 1259487)
did you change bash to sh or sb??

where are you running script?

Sorry, sh

i package the scripts files ("postrm" and "preinst") inside "DEBIAN" folder with "control" file.

Then i execute the deb package

F2thaK 2012-09-02 02:57

Re: The Grand DEB Packaging Thread!
 
On what? PC? What OS?

flotron 2012-09-02 03:00

Re: The Grand DEB Packaging Thread!
 
with nokia n9

and i use this script to package:

Code:

#!/bin/sh

#create .deb files for packages (fremantle&harmattan)

if [ ! $1 ];then
 echo Create .deb files for fremantle and harmattan devices
 echo Usage: make-deb /path/to/package
 exit 0
fi

#step in package directory
chdir "$1"

#versionnumber and packagename from control file
packagename=`grep "Package: " DEBIAN/control | cut -d ' ' -f 2`
versionnumber=`grep "Version: " DEBIAN/control | cut -d ' ' -f 2`

#remove old md5 and digsig sums
rm -f DEBIAN/md5sums 2>/dev/null
rm -f DEBIAN/digsigsums 2>/dev/null

#list all folders except DEBIAN
find | grep -v "./DEBIAN" > ../md5

#get md5 and digsig sums to DEBIAN/
while read line
do
 if [ -f "$line" ]; then
  #cut "./" from beginning
  line=`echo "$line" | cut -c 3-`

  #get md5
  md5sum "$line" >> DEBIAN/md5sums

  #get sha1 for digital signatures
  echo S 15 com.nokia.maemo H 40 `sha1sum "$line" | cut -c -40` R `expr length "$line"` $line >> DEBIAN/digsigsums
 fi
done < "../md5"

#remove temp file list
rm -f ../md5

#package control.tar.gz and data.tar.gz
tar -cvzf ../control.tar.gz -C DEBIAN/ . >/dev/null
tar -cvzf ../data.tar.gz . --exclude=DEBIAN >/dev/null
echo 2.0>../debian-binary

#step outside package folder
cd ..

#create debian archive "package_version.deb"
ar -rcv $packagename"_"$versionnumber.deb debian-binary control.tar.gz data.tar.gz >/dev/null

#remove packaged files
rm -f debian-binary control.tar.gz data.tar.gz 2>/dev/null


thedead1440 2012-09-02 03:13

Re: The Grand DEB Packaging Thread!
 
aha so digsigsums file is just the sha1sum values...now it will be easier to package postint and prerm files...

thedead1440 2012-09-02 05:59

Re: The Grand DEB Packaging Thread!
 
I've read thru' this whole thread and saw a couple of posters with the following error:

Code:

tar: unrecognized option '--format=gnu'
BusyBox v1.19.0.git (MeeGo 3:1.19-8+0m6) multi-call binary.
Usage: tar -[cxtzjhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...
dpkg-deb: subprocess tar -cf returned error exit status 1


There is a work-around for the above:
- Download this tar file from my dropbox: http://db.tt/zSChAgJA

In terminal as root:

- cp -R /path/to/downloaded/tar /bin/

- chmod 775 /bin/tar

Now just repeat your packaging and you are done :)



Edit:
If you are wondering what I did; i downloaded gnu-tar to my system from harmattan sdk repo...Doing a dpkg -i to the downloaded tar didn't work as diversions are not allowed on the n9...

So i extracted from the .deb that i downloaded the above tar file and voila doing the above fixed it up...


Edit 2: Now for packaging just follow the first post's instructions with the above fix and it should work...

flotron 2012-09-20 20:04

Re: The Grand DEB Packaging Thread!
 
I still get "installation interrupted" even without postrm and preinst inside the deb package.

I only package this: /usr/share/themes/base/meegotouch/libsysuid-screenlock-nokia/style/libsysuid-screenlock-nokia.css

So when deb installs its replaces the original

Do my deb need some permission to replace that file? why i can install my packaged themes (/usr/share/themes) without problems and i get trouble with this (inside base folder)?

peterleinchen 2012-09-20 21:07

Re: The Grand DEB Packaging Thread!
 
Aegis?
Hash tables?
Opem mode / interception?
Just a few key words, but keep in mind I do not own a N9!

kainerious 2012-11-08 07:14

Re: The Grand DEB Packaging Thread!
 
Hello!
After doing this:
" There is a work-around for the above:
- Download this tar file from my dropbox: http://db.tt/zSChAgJA

In terminal as root:

- cp -R /path/to/downloaded/tar /bin/

- chmod 775 /bin/tar

Now just repeat your packaging and you are done"

Now I have this problem (again):
Can't install. Damaged Installation Package
More details:
http://talk.maemo.org/showthread.php?t=87576

Can you help me? I want to avoid flash--- Thanks!!


All times are GMT. The time now is 00:16.

vBulletin® Version 3.8.8