You are not logged in.

#1 2017-05-21 00:22:07

socialloser1
Member
Registered: 2017-04-04
Posts: 32

why makepkg create symlinks instead of real files in the final package

here is my PKGBUILD file:

pkgname=my_pkg
pkgver=0.01
pkgrel=1
pkgdesc="mypkg"
arch=(any)
license=('unknown')
depends=(
    'python'
)
makedepends=(
    'git'
)
install='my_pkg.install'

source=('my_pkg.py'
	'my_pkg.service'
	'my_pkg.sysusers'
	)




package() {
    mkdir -p ${pkgdir}/opt/my_pkg
    cp -r $srcdir/* $pkgdir/opt/my_pkg
    install -Dm644 "$srcdir/my_pkg.service" "${pkgdir}/etc/systemd/system/my_pkg.service"
    install -Dm644 "$srcdir/my_pkg.sysusers" "$pkgdir/usr/lib/sysusers.d/my_pkg.conf"
}

in the final tar.xz package file , the files copied via the 'cp' command in package() function are all symlinks. why and how to solve it ?

Last edited by socialloser1 (2017-05-21 01:59:39)

Offline

#2 2017-05-21 01:14:13

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: why makepkg create symlinks instead of real files in the final package

Whats the output of ...

ls -l

when your in the directory containing your PKGBUILD and source files?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-05-21 01:20:15

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: why makepkg create symlinks instead of real files in the final package

drwxr-xr-x  5 user user 4.0K May 21 08:30 ./
drwxr-xr-x 12 user user 4.0K May 21 08:01 ../
-rw-r--r--  1 user user  295 May 21 08:13 init.sql
-rw-r--r--  1 user user  974 May 21 08:13 manual_test.py
-rw-r--r--  1 user user 2.5K May 21 08:13 pkglib.py
lrwxrwxrwx  1 user user   58 May 21 08:13 pkg_server-0.01-1-any.pkg.tar.xz -> /home/user/build/packages/pkg_server-0.01-1-any.pkg.tar.xz
-rw-r--r--  1 user user   93 May 20 19:42 pkg_server.install
-rw-r--r--  1 user user 2.5K May 21 08:13 pkg_server.py
-rw-r--r--  1 user user  236 May 21 08:13 pkg_server.service
-rw-r--r--  1 user user   27 May 21 08:13 pkg_server.sysusers
drwxr-xr-x  3 user user 4.0K May 21 08:16 pkg/
-rw-r--r--  1 user user  928 May 21 08:16 PKGBUILD
drwxr-xr-x  2 user user 4.0K May 20 18:44 __pycache__/
drwxr-xr-x  2 user user 4.0K May 21 08:16 src/
-rw-r--r--  1 user user  268 May 19 16:33 test.sql

all original files , no symlinks. the only link in the list is a link to the final pkg.tar.xz file cause I configured the $pkgdir to other location.

Last edited by socialloser1 (2017-05-21 01:25:34)

Offline

#4 2017-05-21 01:22:35

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: why makepkg create symlinks instead of real files in the final package

I don't see any filenames in that output.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2017-05-21 01:26:07

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: why makepkg create symlinks instead of real files in the final package

slithery wrote:

I don't see any filenames in that output.

sorry , now it shows. by the way, my default shell is fish, don't know if that matters or not.

Last edited by socialloser1 (2017-05-21 01:27:16)

Offline

#6 2017-05-21 02:08:32

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: why makepkg create symlinks instead of real files in the final package

Makepkg symlinks the source files into $srcdir.  Using cp -r copies symlinks instead of dereferencing them.

Offline

#7 2017-05-21 02:16:46

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: why makepkg create symlinks instead of real files in the final package

Allan wrote:

Makepkg symlinks the source files into $srcdir.  Using cp -r copies symlinks instead of dereferencing them.

thanks, I added a '-L' to the cp command , now it works.

Last edited by socialloser1 (2017-05-21 02:26:24)

Offline

#8 2017-05-21 02:28:32

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

Re: why makepkg create symlinks instead of real files in the final package

You can also use the install command with a glob.  You'd probably want to use the "-t DIRECTORY" format.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2017-05-21 06:53:22

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: why makepkg create symlinks instead of real files in the final package

Trilby wrote:

You can also use the install command with a glob.  You'd probably want to use the "-t DIRECTORY" format.

thank you for the tip smile

Offline

Board footer

Powered by FluxBB