You are not logged in.

#1 2008-08-22 20:20:05

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Some help with the `install` command

I'm trying to make a PKGBUILD for phun, because the one on AUR is broken.

After unpacking the source, there is a folder on src named Phun, with some other folders inside. How can I copy it all to $pkgdir/usr/share/Phun also setting the mode to 644?

I've tried

cd $srcdir
mkdir -p $pkgdir/usr/share
install -d -m644 Phun $pkgdir/usr/share/

but it didn't work.

man isn't helping me very much.

Can someone help me? Thanks! smile


(lambda ())

Offline

#2 2008-08-23 02:11:14

rooloo
Member
Registered: 2008-07-09
Posts: 218

Re: Some help with the `install` command

install  -Dm644 Phun $startdir/pkg/usr/share/Phun

pacman installs what is listed in pkg dir. of the *.pkg.tar.gz

it would help if you posted your whole PKGBUILD.

Last edited by rooloo (2008-08-23 02:12:26)

Offline

#3 2008-08-23 02:33:51

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Some help with the `install` command

andre.ramaciotti wrote:

... here is a folder on src named Phun, with some other folders inside. How can I copy it all to $pkgdir/usr/share/Phun also setting the mode to 644?

I've tried

cd $srcdir
mkdir -p $pkgdir/usr/share
install -d -m644 Phun $pkgdir/usr/share/

but it didn't work.

with install you can only copy/install files, but no whole directories.
in your case you can try a for loop. smth like:

install -d -m 0755 "$pkgdir/usr/share/Phun/"
for file in Phun/; do 
install -m 0644 $file "$pkgdir/usr/share/Phun/$file"
done

man isn't helping me very much.

Can someone help me? Thanks! smile

the manpage is helping.
but you´re right, when using install for the first time, it´s somehow confusing, because one is used to cp which can copy anything.

vlad

Offline

#4 2008-08-23 02:38:58

rooloo
Member
Registered: 2008-07-09
Posts: 218

Re: Some help with the `install` command

Oh I missed the important part, files inside of folder Phun. Install doesn't do things recursively? That is weird and should be implimented, NO?

I say feature request!

Offline

#5 2008-08-23 02:51:12

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Some help with the `install` command

rooloo wrote:

Oh I missed the important part, files inside of folder Phun. Install doesn't do things recursively? That is weird and should be implimented, NO?

I say feature request!

no. i think it´s a security and accuracy thing. you are supposed to install each file and not blindly everything around. you have cp for that.

Last edited by DonVla (2008-08-23 02:53:52)

Offline

#6 2008-08-23 11:43:35

rooloo
Member
Registered: 2008-07-09
Posts: 218

Re: Some help with the `install` command

DonVla wrote:
rooloo wrote:

Oh I missed the important part, files inside of folder Phun. Install doesn't do things recursively? That is weird and should be implimented, NO?

I say feature request!

no. i think it´s a security and accuracy thing. you are supposed to install each file and not blindly everything around. you have cp for that.

yeah but copy does not set permissions. Nor do I see what the difference would be if you knowingly used a loop to accomplish the same task as if you had used a switch for install.

Last edited by rooloo (2008-08-23 11:44:06)

Offline

#7 2008-08-23 11:58:29

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: Some help with the `install` command

Ok, thank you guys!

rooloo, I don't know since when, I think it's since pacman 3.2, you can use $srcdir and $pkgdir in your PKGBUILDs, as you can see in the example files in /usr/share/pacman.


(lambda ())

Offline

#8 2008-08-23 14:58:42

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Some help with the `install` command

rooloo wrote:

I say feature request!

Say it here - mailing list details at the bottom of the page.

Offline

Board footer

Powered by FluxBB