You are not logged in.

#1 2017-11-11 20:31:11

jemadux
Member
From: Thessaloniki City / Greece
Registered: 2010-07-17
Posts: 66

[Request] can someone upload curseradio to AUR ?

Offline

#2 2017-11-11 20:52:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Request] can someone upload curseradio to AUR ?

# Maintainer: Your Name <youremail@domain.com>
pkgname=curseradio-git
_pkgname=curseradio
pkgver=r15.1bd4bd0
pkgrel=1
pkgdesc="Command line radio player"
arch=('any')
url="https://github.com/chronitis/curseradio"
license=('MIT')
depends=('python' 'python-requests' 'python-xdg' 'python-lxml')
makedepends=('git')
provides=('curseradio-git')
options=(!emptydirs)
source=("git+https://github.com/chronitis/curseradio.git")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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

# vim:set ts=2 sw=2 et:

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-11-11 23:35:40

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

Re: [Request] can someone upload curseradio to AUR ?

jasonwryan wrote:
# Maintainer: Your Name <youremail@domain.com>
pkgname=curseradio-git
_pkgname=curseradio
pkgver=r15.1bd4bd0
pkgrel=1
pkgdesc="Command line radio player"
arch=('any')
url="https://github.com/chronitis/curseradio"
license=('MIT')

https://wiki.archlinux.org/index.php/PKGBUILD#license
The MIT license must be installed to /usr/share/licenses/$pkgname/ but this one isn't.

depends=('python' 'python-requests' 'python-xdg' 'python-lxml')

python setuptools packages must makedepend on setuptools, and depend on it if (as this package does) they install entry_points scripts. Now, it is true that requests depends on chardet which depends on setuptools, so this is currently covered. On the other hand, so is python itself covered through requests, xdg, and lxml -- but you explicitly specified it anyway, leading me to believe you ascribe to the philosophy of explicitly specifying all top-level dependencies lest in the future an implicit dependency get dropped from the dependency that is currently dragging it in.

So you should either drop python, or add python-setuptools. smile

makedepends=('git')
provides=('curseradio-git')

Why does this provide itself, rather than the non-git version?
For that matter, if you are going to add a provides, why doesn't it also conflict the non-git version, as insurance against the software getting a stable release and an AUR package (in which case the pkgver() would need to be changed anyway -- note the Wiki example has a fallback for that)?

options=(!emptydirs)

As far as I can tell, this software should not install any empty directories regardless, why is this necessary? Generally speaking, PKGBUILDs should strive to include as few extra configurations as possible...

source=("git+https://github.com/chronitis/curseradio.git")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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

# vim:set ts=2 sw=2 et:

python setuptools packages should have a build step running setup.py build, and be packaged with setup.py install --skip-build. It is really no different from Makefile=powered packages -- if the buildsystem modifies $srcdir, it should only do that in build().

Last edited by eschwartz (2017-11-11 23:40:27)


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

Offline

#4 2017-11-11 23:56:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Request] can someone upload curseradio to AUR ?

It wasn't intended as a PKGBUILD for submission (thanks for the pointers anyway), just to give the OP an idea of how simple it is to write a PKGBUILD (even a slightly incorrect one smile ) for non-complex applications.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2017-11-12 00:00:56

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

Re: [Request] can someone upload curseradio to AUR ?

Fair enough. smile Happy to give the pointers regardless though. big_smile


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

Offline

Board footer

Powered by FluxBB