You are not logged in.

#1 2019-07-25 08:06:57

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

[SOLVED] questions regarding symlinking

Hello,

I would like to create my own pkgbuild for 'adoptopenjdk' and I was looking into the AUR version(https://aur.archlinux.org/cgit/aur.git/ … optopenjdk) to get started,
but I don't understand why for example the following symlink is created:

# Conf
  install -dm 755 "${pkgdir}/etc"
  mv conf "${pkgdir}/etc/${pkgname}"
  ln -sf /etc/${pkgname} conf

Why is this link necessary? What's its use?
Also, I would think the symlink command will not work as the 'conf' folder is being moved to another location and the link command is called from the original location without changing directory....


Another question I have is for the following package:
https://git.archlinux.org/svntogit/pack … va-openjdk

What exactly does the following command accomplish:

ln -s ${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"

Isn't pkgbase a temporary directory location?

Last edited by chrisdb (2019-07-26 06:49:41)


Failure is success in progress.
A.E.

Offline

#2 2019-07-25 13:32:57

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] questions regarding symlinking

Not sure about the first one, but the second one does make more sense.

https://wiki.archlinux.org/index.php/PKGBUILD#pkgbase

java-openjdk is a split package that consists of 5 packages .
Everyone of those packages need to include the license files in their "${pkgdir}/usr/share/licenses/${pkgname}" folder .

The creator/maintainer didn't want to have multiple copies of the same files.
jre-openjdk-headless is a requirement for all 4 other packages and puts the license files in "${pkgdir}/usr/share/licenses/${pkgbase}"

The other packages create their own "${pkgdir}/usr/share/licenses/${pkgname}" folder and symlink to the /usr/share/licenses/${pkgbase} folder that was created upon installing the jre-openjdk-headless package.

This method is used in many split pacakges in arch repos.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2019-07-25 15:59:45

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

Re: [SOLVED] questions regarding symlinking

Lone_Wolf wrote:

Not sure about the first one, but the second one does make more sense.

https://wiki.archlinux.org/index.php/PKGBUILD#pkgbase

java-openjdk is a split package that consists of 5 packages .
Everyone of those packages need to include the license files in their "${pkgdir}/usr/share/licenses/${pkgname}" folder .

The creator/maintainer didn't want to have multiple copies of the same files.
jre-openjdk-headless is a requirement for all 4 other packages and puts the license files in "${pkgdir}/usr/share/licenses/${pkgbase}"

The other packages create their own "${pkgdir}/usr/share/licenses/${pkgname}" folder and symlink to the /usr/share/licenses/${pkgbase} folder that was created upon installing the jre-openjdk-headless package.

This method is used in many split pacakges in arch repos.

Ok I'm beginning to understand :-) But I don't get which path 'pkgbase' is referring to...
On which line is this directory created?

Last edited by chrisdb (2019-07-25 16:22:48)


Failure is success in progress.
A.E.

Offline

#4 2019-07-25 17:05:49

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] questions regarding symlinking

[1] sets the pkgbase to java-openjdk
so the following creates the directory usr/share/licenses/java-openjdk [2]

  cp -r legal "${pkgdir}/usr/share/licenses/${pkgbase}"

the following creates the symlink to the directory usr/share/licenses/java-openjdk (symlink is created at usr/share/licenses/${pkgname})

  ln -s ${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"

[1] https://git.archlinux.org/svntogit/pack … openjdk#n6
[2] https://git.archlinux.org/svntogit/pack … enjdk#n150

Offline

#5 2019-07-25 18:42:17

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

Re: [SOLVED] questions regarding symlinking

loqs wrote:

the following creates the symlink to the directory usr/share/licenses/java-openjdk (symlink is created at usr/share/licenses/${pkgname})

  ln -s ${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"

I understand $pkgbase is initially set to value 'java-openjdk', but what I don't get is how $pkgbase becomes '/usr/share/licenses/java-openjdk'. I don't see this set explicitly...

The cp command created the directory, but at this point the value of $pkgbase is still 'java-openjdk', or not?

Last edited by chrisdb (2019-07-25 18:55:44)


Failure is success in progress.
A.E.

Offline

#6 2019-07-25 21:39:11

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] questions regarding symlinking

mkdir -p a/b/c
ln -s d a/b
ls a/b
c  d

Edit:
See also man 1 ln the description for 3rd form.

Last edited by loqs (2019-07-25 21:43:09)

Offline

#7 2019-07-26 06:49:11

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

Re: [SOLVED] questions regarding symlinking

loqs wrote:
mkdir -p a/b/c
ln -s d a/b
ls a/b
c  d

Edit:
See also man 1 ln the description for 3rd form.

thx, now I get it smile


Failure is success in progress.
A.E.

Offline

Board footer

Powered by FluxBB