maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to give permission to a script file inside a deb? (https://talk.maemo.org/showthread.php?t=89562)

Schturman 2013-03-23 02:29

Re: How to give permission to a script file inside a deb?
 
do you have scrstchbox installed ?

coderus 2013-03-23 06:24

Re: How to give permission to a script file inside a deb?
 
Quote:

Originally Posted by Schturman (Post 1330968)
OK, you can do it like this..
1. Before packaging you need your_package.aegis file that include this:
Code:

<aegis>
    <request policy="add">
    <credential name="UID::root" />
    <credential name="GID::root" />
    <credential name="GRP::root" />

    <for path="/opt/mytheme/changer/script.sh" />
    </request>
</aegis>

2. The .desktop file should look like this:
Code:

[Desktop Entry]
Type=Application
Name=My Theme
Exec=/usr/bin/aegis-exec -s -u user -l "/opt/mytheme/changer/script.sh"
Icon=/opt/mytheme/icon/icon.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable


oh, really, aegis-exec -s -u user ... ?

coderus 2013-03-23 06:25

Re: How to give permission to a script file inside a deb?
 
@flotron. how you packaging to geb? you can use aegis-deb-add to inject aegis manifest ot existing deb package.

peterleinchen 2013-03-23 09:19

Re: How to give permission to a script file inside a deb?
 
A big SORRY from my side.
As soon as I stepped out and Schturmann stepped in, it was obvious that this imeant for N9. And all my guides of course only work for N900. Must have overread that in your first post.

Schturman 2013-03-23 10:59

Re: How to give permission to a script file inside a deb?
 
Quote:

Originally Posted by coderus (Post 1331006)
oh, really, aegis-exec -s -u user ... ?

Exactly... You are right he can change it to "root" too.. But for me in N9QT it work with "user". If i change it to root, the version-auto-checker script, that run from n9qt script, not work correctly..

Schturman 2013-03-23 11:17

Re: How to give permission to a script file inside a deb?
 
Quote:

Originally Posted by coderus (Post 1331007)
@flotron. how you packaging to geb? you can use aegis-deb-add to inject aegis manifest ot existing deb package.

Can you write please the full command how to do it? And first he need to create the aegis manifest file?

flotron 2013-03-23 19:44

Re: How to give permission to a script file inside a deb?
 
Quote:

Originally Posted by Schturman (Post 1331057)
Can you write please the full command how to do it? And first he need to create the aegis manifest file?

I package my debs with my n9 :( with this script

/home/user/MyDocs/makedeb.sh /home/user/mypackagefolder (inside folder: DEBIAN,opt,usr.. with control,postint,etc...)

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


Schturman 2013-03-23 20:13

Re: How to give permission to a script file inside a deb?
 
Ok, thanks, but I meant to Coderus :)
I also want to learn how inject aegis manifest ot existing deb package :)

flotron 2013-03-23 20:21

Re: How to give permission to a script file inside a deb?
 
I tried yours Schturman (adding the aegis an rules files and modifyng the desktop file) but when i press the icon nothing happens.
The script only works in the postint or preinst, etc.. Not executing from icon

Schturman 2013-03-23 20:53

Re: How to give permission to a script file inside a deb?
 
Packaging on n9 it's not really the same like packaging on the Linux pc via scratchbox. I don't know how to do it, we need to wait for Coderus that can explain how inject aegis manifest ot existing deb package.
Or another way, install scratchbox on Linux pc and i will try to help you crate this package..


All times are GMT. The time now is 07:04.

vBulletin® Version 3.8.8