You are not logged in.

#1 2013-10-25 19:18:04

kwehmu
Member
Registered: 2013-08-04
Posts: 15

[SOLVED] think-rotate: Please review first PKGBUILD

Hi all,

I submitted my first package to the AUR, think-rotate.  It builds and works fine on my system, I believe I have followed all of the packaging guidelines, and I have run namcap on the package.  However, since is my first submission to the AUR, I'd like another set of eyes on it.

Will you please review the package and provide any comments/suggestions?

Last edited by kwehmu (2013-11-12 06:35:42)

Offline

#2 2013-10-25 20:06:15

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

Re: [SOLVED] think-rotate: Please review first PKGBUILD

If you are asking for a review, the polite thing to do would be paste it here...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-10-25 20:10:27

kwehmu
Member
Registered: 2013-08-04
Posts: 15

Re: [SOLVED] think-rotate: Please review first PKGBUILD

Sorry about that.  I linked to it, but I can see how it would be better to paste it directly.  Here it is:

PKGBUILD

# Maintainer: Jim Turner <jturner314 @t gmail dot com>

pkgname=think-rotate
pkgver=2.10beta
pkgrel=1
pkgdesc="Scripts for ThinkPad X220 Tablet rotation, docking, etc."
arch=('any')
url="http://martin-ueding.de/en/projects/think-rotate"
license=('GPL2')
depends=('acpid' 'alsa-utils' 'systemd>=196' 'xf86-input-wacom' 'xorg-xinput' 'xorg-xrandr')
makedepends=('python-docutils')
optdepends=('kdebase-kdialog: for showing dialog boxes'
            'kvkbd: for virtual keyboard'
            'libpulse: for volume control when docking'
            'networkmanager: for managing connections when docking'
            'qt4: for showing dialog boxes'
            'xorg-xbacklight: for backlight control when docking')
install=$pkgname.install
source=(http://github.com/jturner314/$pkgname/archive/v$pkgver.tar.gz)
sha256sums=('ffdda6e26a2e277ddaa1a69b25c0436391f4235154ac8f2fb0f9e72ac4ce8a6c')

build() {
    cd "$srcdir/$pkgname-$pkgver"
    make
}

package() {
    cd "$srcdir/$pkgname-$pkgver"
    make DESTDIR="$pkgdir/" install
}

think-rotate.install

post_install() {
    udevadm hwdb --update
    echo "udev rules and hwdb updated, ACPI hooks added."
    echo "You need to restart udev and acpid for these changes to take effect."
}

post_upgrade() {
    post_install $1
}

post_remove() {
    post_install $1
}

Offline

#4 2013-10-25 20:37:14

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

Re: [SOLVED] think-rotate: Please review first PKGBUILD

No problem, it just makes it easier for people.

Shouldn't it be a -git package?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-10-25 20:46:07

kwehmu
Member
Registered: 2013-08-04
Posts: 15

Re: [SOLVED] think-rotate: Please review first PKGBUILD

jasonwryan wrote:

Shouldn't it be a -git package?

Well, I could name it think-rotate-git, but I was under the impression that -git packages tracked the latest in the master branch of a Git repository.  Is that correct?  In this case, I have the PKGBUILD refer to the latest tagged release (currently v2.10beta), so the PKGBUILD is referring to a specific released version, not just the latest in Git.  The list of releases for think-rotate is available on GitHub here.

Offline

#6 2013-10-25 21:05:19

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

Re: [SOLVED] think-rotate: Please review first PKGBUILD

Yep: that makes sense.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2013-10-25 22:47:47

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] think-rotate: Please review first PKGBUILD

kwehmu wrote:

I was under the impression that -git packages tracked the latest in the master branch of a Git repository.  Is that correct?

Yes, that is correct.

The PKGBUILD looks good. You could always add the Vim mode line ("# vim: set ts=2 sw=2 et:") at the end and quote the "install" and "source" variables for consistency (it futureproofs them and you already have quotes around static, non-expandable words in the depends array), but neither is at all critical.

Kudos for a nice first PKGBUILD.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#8 2013-10-26 00:15:16

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] think-rotate: Please review first PKGBUILD

Nitpick -- you don't need to restart udev. Rule and hwdb changes are picked up automatically.

Offline

#9 2013-10-26 02:09:47

kwehmu
Member
Registered: 2013-08-04
Posts: 15

Re: [SOLVED] think-rotate: Please review first PKGBUILD

Thanks for all of your comments everyone!

falconindy wrote:

Nitpick -- you don't need to restart udev. Rule and hwdb changes are picked up automatically.

I looked into this while writing the think-rotate.install file.  While udev will detect the changes, based on my testing and this answer on the Unix & Linux Stack Exchange, the new rule/hwdb changes don't take effect on already connected devices.  (udev will apply the new rules to newly connected devices, but will not automatically reload rules for already connected devices.)  In this case, the rule/hwdb changes are for the laptop keyboard and docking port.  Since the laptop keyboard (and I think the docking port) are permanently connected, the user needs to reload the rules/hwdb manually for the new configuration to take effect.  Based on this page I could advise the user to execute 'udevadm trigger --action=change' instead of restarting udev, if you think that would be better.  What are your thoughts?

Offline

#10 2013-10-26 02:17:20

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] think-rotate: Please review first PKGBUILD

Sure. Sounds good.

Offline

Board footer

Powered by FluxBB