You are not logged in.

#1 2016-12-16 13:15:58

balinbob
Member
From: North Carolina
Registered: 2010-03-07
Posts: 21

PKGBUILD review request: scenic

I have published a python2 application, which uses setup.py to install.   However, try as I may, I cannot get setup.py to correctly install into /usr/share.   So I've used the PKGBUILD to install an icon and the LICENSE.   

The pkgbuild is in the AUR already, but I'll post it here.   It does install viably in my system, but I would appreciate any advice.   Also, namcap says the depends are not needed... I'm not sure why?

One more thing:  I plan to remove the items which have no content, isn't that proper?

# Maintainer: Bob Allred  <balinbob@gmail.com>
pkgname=scenic
pkgver=r23.599d0a6
pkgrel=1
pkgdesc="wallpaper browser/cycler for fluxbox, etc, and batch image-processing frontend for CLI programs such as feh and imagemagick"
arch=('any')
url="https://github.com/balinbob/scenic"
license=('GPL3')
groups=()
depends=('python2' 'gtk2' 'pygtk' 'python2-keybinder2' 'python2-gobject' 'python2-dbus')
makedepends=('git')
optdepends=('feh' 'imagemagick')
provides=()
conflicts=()
replaces=()
backup=()
options=(!emptydirs)
install=
source=('git+https://github.com/balinbob/scenic')
_gitname='scenic'
md5sums=('SKIP')
pkgver () {
  cd "${srcdir}/${_gitname}"
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

package() {
    cd "$srcdir/$pkgname"
    python2 setup.py install --root="$pkgdir/" --optimize=1
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 "resources/scenic-folder.svg" "$pkgdir/usr/share/${pkgname}/scenic-folder.svg"
}

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

Thank you, I would appreciate any help!

Bob aka balinbob-gmail.com

Offline

#2 2016-12-16 13:25:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: PKGBUILD review request: scenic

balinbob wrote:

Also, namcap says the depends are not needed... I'm not sure why?

Namcap isn't good at scripts.

balinbob wrote:

One more thing:  I plan to remove the items which have no content, isn't that proper?

Yes, that would be recommended.

balinbob wrote:
pkgname=scenic
...
source=('git+https://github.com/balinbob/scenic')

This is the only big issue I see. If you're pulling from git master, the pkgname needs to end in "-git".

There are some formatting issues (newlines and braces), but those are minor.

Last edited by Scimmia (2016-12-16 13:26:53)

Offline

#3 2016-12-16 13:30:34

balinbob
Member
From: North Carolina
Registered: 2010-03-07
Posts: 21

Re: PKGBUILD review request: scenic

@Scimmia

Thank  you, that's good to hear.   I have not done a proper release, but I had wondered whether I should not use -git.   I will change it.

Offline

#4 2016-12-16 13:39:35

mis
Member
Registered: 2016-03-16
Posts: 234

Re: PKGBUILD review request: scenic

balinbob wrote:

So I've used the PKGBUILD to install an icon and the LICENSE. 
...
license=('GPL3')

For GPL3 you don't need to install a license file.

balinbob wrote:

options=(!emptydirs)

Only minor, but since there are no empty dirs in the package after running the package() function (edit: without using !emptydirs), it's not needed.

Last edited by mis (2016-12-16 13:47:18)

Offline

#5 2016-12-16 13:45:07

balinbob
Member
From: North Carolina
Registered: 2010-03-07
Posts: 21

Re: PKGBUILD review request: scenic

Thank you @mis, I need to review the GPL licenses, to make sure this one is appropriate.   I've used GPL2 before.   I will take care of it.

Bob

Offline

#6 2016-12-16 15:33:20

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

Re: PKGBUILD review request: scenic

_gitname is pointless, just use ${pkgname} or ${pkgname%-git}
I would also recycle variables, e.g.

pkgname=scenic-git
url="https://github.com/balinbob/${pkgname%-git}"
source=("git+${url}.git")

Also, optdepends should state the reason why each is desired. Does this integrate with those programs? Your pkgdesc suggests it is a frontend to image-processing programs in general. Quickly looking at the code suggests the user can use whatever programs they want set in a config file -- so they shouldn't be dependencies at all IMHO.
Defining whether emptydirs should be kept is only ever required when the package requires emptydirs to be installed -- otherwise there is no good reason to override the default (which is "!emptydirs" anyway).

...

Looking at your setup.py file, I have no clue why you can't get data files to install, mostly because I am not even going to try and decipher that archaic distutils mess full of irrelevant references. tongue
Switch to setuptools. Clean up, major time. Use:

data_files=[
    ('share/scenic', ['resources/scenic-folder.svg'])
]

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

Offline

#7 2016-12-16 15:46:19

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: PKGBUILD review request: scenic

Eschwartz wrote:

_gitname is pointless, just use ${pkgname} or ${pkgname%-git}
I would also recycle variables, e.g.

pkgname=scenic-git
url="https://github.com/balinbob/${pkgname%-git}"
source=("git+${url}.git")

Both are personal opinions (style choices). I personally disagree with them; the only advantage is if those variables could change, which they shouldn't.

Offline

#8 2016-12-16 16:14:39

balinbob
Member
From: North Carolina
Registered: 2010-03-07
Posts: 21

Re: PKGBUILD review request: scenic

Thanks, it is scenic-git in the AUR now, with corrections, and I'm still improving it.  I have yet to remove (!emptydirs).  Is there a way to remove or hide the original package ('scenic') ?

Bob

Offline

#9 2016-12-16 16:36:41

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

Re: PKGBUILD review request: scenic

Use the AUR web interface to file a request to have it deleted.

https://wiki.archlinux.org/index.php/Ar … r_requests


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

#10 2016-12-16 16:45:39

balinbob
Member
From: North Carolina
Registered: 2010-03-07
Posts: 21

Re: PKGBUILD review request: scenic

WorMzy wrote:

Use the AUR web interface to file a request to have it deleted.

Thanks, I'm doing so now.

Bob

Offline

#11 2016-12-16 19:01:34

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

Re: PKGBUILD review request: scenic

Scimmia wrote:
Eschwartz wrote:

_gitname is pointless, just use ${pkgname} or ${pkgname%-git}
I would also recycle variables, e.g.

pkgname=scenic-git
url="https://github.com/balinbob/${pkgname%-git}"
source=("git+${url}.git")

Both are personal opinions (style choices). I personally disagree with them; the only advantage is if those variables could change, which they shouldn't.

They do change, when I use one PKGBUILD as a template for another.


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

Offline

Board footer

Powered by FluxBB