You are not logged in.

#1 2017-01-09 12:42:54

ramirezterrix
Member
Registered: 2013-04-30
Posts: 9

[Solved] Need help creating a Package / Kitty Terminal

Hi I am trying to create my first package and I need some help.

When I run makepkg I get:

mkdir: cannot create directory ‘/usr/bin/kitty’: Permission denied

I guess I didn't understood the process - here is my work so far:

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Maximilian Kindshofer <maximilian@kindshofer.net>
pkgname=kitty
pkgver=1
pkgrel=1
arch=('i368' 'x86_64')
url="https://github.com/kovidgoyal/kitty"
license=('GPL-3')
depends=('python3' 'glew' 'freetype2' 'fontconfig' 'xorg-xdpyinfo')
makedepends=('git' 'gcc' 'pkg-config')
source=('git+https://github.com/kovidgoyal/kitty.git')
md5sums=('SKIP')
build() {
	cd "$pkgname"
        python3 setup.py linux-package
    }

package() {
	cd "${srcdir}/${pkgname}/linux-package"
	mkdir /usr/bin/$pkgname
        cp bin/* /usr/bin/$pkgname -R
        cp share /usr/share/$pkgname -R
        cp lib /usr/lib/$pkgname -R
}

The package build corretly now I try to move the files to the directories...

Last edited by ramirezterrix (2017-01-10 15:47:06)

Offline

#2 2017-01-09 12:48:38

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,864
Website

Re: [Solved] Need help creating a Package / Kitty Terminal

You need to put the files in the $pkgdir prefix, not the live system root.

See https://wiki.archlinux.org/index.php/Cr … kage.28.29

EDIT: Why are you making a directory in /usr/bin anyway?

Last edited by WorMzy (2017-01-09 12:49:41)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2017-01-09 19:12:04

ramirezterrix
Member
Registered: 2013-04-30
Posts: 9

Re: [Solved] Need help creating a Package / Kitty Terminal

Yeah I made the directory because I got it totally wrong smile

Offline

#4 2017-01-09 19:31:52

pb
Member
From: Krakow, PL
Registered: 2014-12-26
Posts: 336
Website

Re: [Solved] Need help creating a Package / Kitty Terminal

Just take a look at good PKGBUILD for python apps: http://pkgbuild.com/~arojas/PKGBUILD
But...
pkgname, pkgver should be compatible with: https://wiki.archlinux.org/index.php/VC … guidelines

Offline

#5 2017-01-09 19:58:21

ramirezterrix
Member
Registered: 2013-04-30
Posts: 9

Re: [Solved] Need help creating a Package / Kitty Terminal

Ok i looked at some packages and it made me somehow more confused.

After building the pkg I have a folder called linux-package in my $srcdir
inside there is are folders called /bin /share and /lib I somehow want to copy them to $pkgdir/usr/bin/$pkgname $pkgdir/usr/share/$pkgname and $pkgdir/usr/lib/$packagename

I tried install -D -m755 for the file in bin and it worked, but it doesnt work on the other folders since they containe more than one file and subfolders.

Every package I looked at does is diffrently.

Offline

#6 2017-01-09 22:49:44

pb
Member
From: Krakow, PL
Registered: 2014-12-26
Posts: 336
Website

Re: [Solved] Need help creating a Package / Kitty Terminal

ramirezterrix wrote:

After building the pkg I have a folder called linux-package in my $srcdir

Yes, because you execute:

python3 setup.py linux-package

This directory isn't in $srcdir, but in $srcdir/kitty/

ramirezterrix wrote:

inside there is are folders called /bin /share and /lib I somehow want to copy them to $pkgdir/usr/bin/$pkgname $pkgdir/usr/share/$pkgname and $pkgdir/usr/lib/$packagename

No! This directory structure is coresponding to linux directory structure. File in $srcdir/kitty/linux-package/bin/ should be placed (after package installation) in /usr/bin/ not in /usr/bin/kitty/. Files and - maybe - directories in /share shoud be placed in /usr/share/ etc. Of course all of them should be packed to $pkgdir/something/.

ramirezterrix wrote:

I tried install -D -m755 for the file in bin and it worked, but it doesnt work on the other folders since they containe more than one file and subfolders.

Every package I looked at does is diffrently.

Packages does in different way because of sources and Makefiles etc.

Ok, there is PKGBUILD for kitty-git

pkgname=kitty-git # *-git, because kitty has not versioned ye
pkgver=r669.8e565d5 # see pkgver section
pkgrel=1
pkgdesc="A modern, hackable, featureful, OpenGL based terminal emulator" # you've missed pkgdesc which is neccessary
arch=('i686' 'x86_64')
url="https://github.com/kovidgoyal/kitty"
license=('GPL3') # GPL-3 isn't common license, but GPL3 is
depends=('python3' 'glew' 'glfw-x11' 'freetype2') # you've missed glfw-x11 dependencies
makedepends=('git' 'pkg-config' 'python-setuptools') # I'm not shure, that python-setuptools is neccessary
source=('git+https://github.com/kovidgoyal/kitty.git')
md5sums=('SKIP')

#pkgver section because of [url]https://wiki.archlinux.org/index.php/VCS_package_guidelines[/url]
pkgver() {
    cd kitty
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    }

build() {
	cd "$srcdir/kitty" # there is wrong location in your version
        python3 setup.py linux-package
    }

# all section are changed because it's completly wrong in your PKGBUILD
package() {
    cd "$srcdir/kitty/linux-package"
    mkdir -p $pkgdir/usr/bin/
    mkdir -p $pkgdir/usr/lib/
    mkdir -p $pkgdir/usr/share
    cp -r bin/* $pkgdir/usr/bin
    cp -r share/* $pkgdir/usr/share/
    cp -r lib/* $pkgdir/usr/lib/
    }

Maybe package section should be cleared... but it works.
python3 install not works with kitty (I don't know why).

Comments are after "#".

Last edited by pb (2017-01-09 22:53:25)

Offline

#7 2017-01-09 23:26:40

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

Re: [Solved] Need help creating a Package / Kitty Terminal

pb wrote:

Just take a look at good PKGBUILD for python apps: http://pkgbuild.com/~arojas/PKGBUILD
But...
pkgname, pkgver should be compatible with: https://wiki.archlinux.org/index.php/VC … guidelines

That would help a lot, if only the setup.py would use setuptools...

setup.py is a recognizable filename, which is probably why it was used, but in this case does not imply you can copy-paste any old setuptools-based PKGBUILD.


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

Offline

#8 2017-01-10 15:46:18

ramirezterrix
Member
Registered: 2013-04-30
Posts: 9

Re: [Solved] Need help creating a Package / Kitty Terminal

Thanks for the explanation and for your time!

Offline

#9 2017-01-10 16:00:15

pb
Member
From: Krakow, PL
Registered: 2014-12-26
Posts: 336
Website

Re: [Solved] Need help creating a Package / Kitty Terminal

Clear up PKGBUILD: https://aur.archlinux.org/cgit/aur.git/ … =kitty-git - pkgdesc line smile

Offline

Board footer

Powered by FluxBB