You are not logged in.

#1 2012-06-25 03:49:57

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

[SOLVED] Problem with symlinking and PKGBUILD

Hello Everyone,

I have created the javafx-sdk package on AUR, and make the installation a lot simplier. But I am having a problem with the creationg of the symlink.

So I have 1 binary file "javafxpackager" in the "bin" folder that I need to symlink into /usr/bin. This is the method I am using

mkdir -p ${pkgdir}/usr/bin
chmod +x ${pkgdir}/usr/lib/jvm/${pkgname}/bin/javafxpackager
ln -s ${pkgdir}/usr/lib/jvm/${pkgname}/bin/javafxpackager ${pkgdir}/usr/bin/javafxpackager

My problem is that this method doesn't work at all. The only way to me after the installation to make the symlink working is by doing this :

ls chmod +x /usr/lib/jvm/javafx-sdk/bin/javafxpackager
sudo ln -s /usr/lib/jvm/javafx-sdk/bin/javafxpackager /usr/bin/

In order to make it work.

How can I solve this problem ?

Thanks in Advance,
Luis Da Costa

Last edited by aliasbody (2012-06-26 00:27:15)

Offline

#2 2012-06-25 07:32:48

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: [SOLVED] Problem with symlinking and PKGBUILD

aliasbody wrote:
ln -s ${pkgdir}/usr/lib/jvm/${pkgname}/bin/javafxpackager /usr/bin/javafxpackager

Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2012-06-25 23:53:56

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Problem with symlinking and PKGBUILD

ngoonee wrote:
aliasbody wrote:
ln -s ${pkgdir}/usr/lib/jvm/${pkgname}/bin/javafxpackager /usr/bin/javafxpackager

I can't do that :

ln: failed to create symbolic link «/usr/bin/javafxpackager»: Permission denied

Offline

#4 2012-06-25 23:57:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: [SOLVED] Problem with symlinking and PKGBUILD

I suspect the order was reversed and should have been

ln -s /usr/bin/javafxpackager ${pkgdir}/usr/lib/jvm/${pkgname}/bin/javafxpackager

edit: I don't link much, but saw this:

man ln wrote:

SYNOPSIS
       ln [OPTION]... [-T] TARGET LINK_NAME   (1st form)
...
DESCRIPTION
       In  the 1st form, create a link to TARGET with the name LINK_NAME.

That does seem to be an unintuitive order, but that's what the man says.

Last edited by Trilby (2012-06-25 23:59:15)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2012-06-26 00:09:51

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Problem with symlinking and PKGBUILD

That doesn't work because the first is the SOURCE and the second is the TARGET.

On the example you gave, he uses the argument -T (Description : "-T, --no-target-directory   treat LINK_NAME as a normal file always")

Offline

#6 2012-06-26 00:27:01

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Problem with symlinking and PKGBUILD

Problem solved ! Here's how to do it :

	mkdir -p ${pkgdir}/usr/bin
	chmod +x ${pkgdir}/usr/lib/jvm/${pkgname}/bin/javafxpackager
	ln -s /usr/lib/jvm/javafx-sdk/bin/javafxpackager ${pkgdir}/usr/bin/javafxpackager

I didn't know, but you can symlink a file that doesn't exist yet, and this is what I did. I use and non existing (yet) javafxpackager binary from the non existing (yet) "/usr/lib/jvm/javafx-sdk/bin/" folder, and send it to the ${pkgdir}/usr/bin/javafxpackager, that will be copied into the original "/usr/bin/" folder.

So this problem is solved and I'm happy big_smile

(PS : thanks @ngoonee and @Trilby for you help ! Thanks to you I found out a little bit faster where the problem was ^^)

Offline

Board footer

Powered by FluxBB