You are not logged in.

#1 2020-09-28 18:51:34

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,565

[Solved] Package permission issues on installing from PKGBUILD

I have written a PKGBUILD for a python package SimpleGUICS2Pygame:

pkgname=python-simpleguics2pygame
_pkgname=SimpleGUICS2Pygame
pkgver=2.0.2
pkgrel=1
pkgdesc="A module reimplementing the SimpleGUI particular module of CodeSkulptor and CodeSkulptor3 (a Python browser environment)"
arch=('any')
url="https://simpleguics2pygame.readthedocs.io/en/latest/"
license=("Apache License 2.0")
depends=('python')
makedepends=('python-setuptools')
conflicts=("${pkgname}" "${pkgname}-git")
source=("https://bitbucket.org/OPiMedia/simpleguics2pygame/downloads/$_pkgname-$pkgver.tar.gz")
sha256sums=('b89d488740912b7db61184965c97608b1240474403c334a88fc8f6016ccabcb6')

build() {
    cd "$srcdir/$_pkgname-$pkgver"
    python setup.py build
}

package() {
    cd "$srcdir/$_pkgname-$pkgver"
    python setup.py install --skip-build --root="$pkgdir/" --optimize=1 
}

The package builds and installs ok.

The problem is I can't use the module because I'm getting an ERRNO 13 Permission denied error whenever I include the module.  Checking the package installation, I discovered the permission level in the inner files and directories (but not the base) of the package are all -rw --- ---. I would need at least need rw-r--r-- for the files to be usable.

I of course can change the permissions manually but my question is is there a way of rewriting the PKGBUILD so that it installs the package with the right permissions in the installation directory?

Last edited by d_fajardo (2020-09-28 20:03:41)

Offline

#2 2020-09-28 19:21:11

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

Re: [Solved] Package permission issues on installing from PKGBUILD

prepare()
{
    cd "$srcdir/$_pkgname-$pkgver"
    find -type f \! -perm -go=r -execdir chmod go+r '{}' \;
}

Off topic the license "Apache License 2.0" should be changed to the standard name APACHE or Apache.
Edit:
Changed the chmod to add r for group and other instead of setting 755 permissions.

I would suggest asking upstream why the permissions in their repository are set to 0 for group and other.

Last edited by loqs (2020-09-28 19:30:00)

Offline

#3 2020-09-28 20:03:22

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,565

Re: [Solved] Package permission issues on installing from PKGBUILD

Thanks loqs. It works!
I think I know why the permissions are set to 0. According to the site, the package needs to be installed with 'pip --user' but I'm avoiding to use pip thus my PKGBUILD.
Solved.

Offline

#4 2020-10-02 04:10:09

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] Package permission issues on installing from PKGBUILD

d_fajardo wrote:

I think I know why the permissions are set to 0. According to the site, the package needs to be installed with 'pip --user' but I'm avoiding to use pip thus my PKGBUILD.
Solved.

pip is the official way to install all python modules, and pip install --user is the recommended way for anyone who doesn't have root. There's nothing special or unusual there.

It's still incorrect for the permissions to be set like this, no other modules do so -- no matter how much they're "supposed to" be installed with "pip install --user". It needs to be fixed upstream.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2020-10-02 05:20:06

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,565

Re: [Solved] Package permission issues on installing from PKGBUILD

Thanks eschwartz. I emailed upstream regarding the issue. And yes I have used pip in the past but I have had issues with conflicting package that's why I try to avoid it. I also avoided creating a virtual env since I really just needed this one package for what I was trying to achieve. Besides it was part of my learning to write my own PKGBUILD.

EDIT: Maintainer responded positively to update archive. I will test with new PKGBUILD once it's updated.

Last edited by d_fajardo (2020-10-02 09:25:56)

Offline

#6 2020-10-02 10:02:13

OPiMedia
Member
From: Brussels, Belgium
Registered: 2020-10-02
Posts: 1
Website

Re: [Solved] Package permission issues on installing from PKGBUILD

I'm here. ;-) I fixed the problem.
Tell me if there is another problem.

Thanks to you.

P.-S.: If you make some nice programs in CodeSkulptor tell me and I will add them to this list:
https://simpleguics2pygame.readthedocs. … links.html

Last edited by OPiMedia (2020-10-02 10:03:43)

Offline

#7 2020-10-02 11:52:23

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,565

Re: [Solved] Package permission issues on installing from PKGBUILD

I can confirm the updated archive works and there are no more problems with permissions. The prepare() section of the PKGBUILD can thus be removed.
Thanks for the quick fix.

Offline

Board footer

Powered by FluxBB