You are not logged in.

#1 2013-01-26 04:04:32

herrflockig
Member
Registered: 2012-10-15
Posts: 8

First PKGBUILD, is it alright to submit?

I wrote a python Youtube search client with a curses interface. I wrote a PKGBUILD for it aswell so I can easily share it with my archie friends. However, this is the first PKGBUILD I wrote, so I ask you to please review it for me and let me know if it's good enough to submit to AUR.

# Maintainer: Tyler Cone <herrflockig@gmail.com>
pkgname=yt-git
pkgver=20130125
pkgrel=1
pkgdesc="A curses Youtube search client written in python"
arch=('any')
url="https://github.com/herrflockig/yt"
license=('WTFPL')
depends=('mplayer' 'youtube-dl' 'python2')
makedepends=('git')
conflicts=('yt')
provides=('yt')

_gitname="yt"
_gitroot="https://github.com/herrflockig/yt"

pkgver() {
  cd "$srcdir/$_gitname"
  echo $(git describe --always | sed 's/-/./g')
}

build() {
 cd $srcdir
 msg "Connecting to GIT server..."
 if [ -d $_gitname ]; then
   cd $_gitname && git pull origin
   msg "The local files are updated."
 else
   git clone --depth=1 $_gitroot $_gitname
 fi
 msg "GIT checkout done or server timeout"
}


package() {
  cd "$srcdir/$_gitname"
  mkdir -p $pkgdir/usr/bin
  cp yt.py $pkgdir/usr/bin/yt
  chmod +x $pkgdir/usr/bin/yt
}

And while you're at it, why not give the script a try and let me know what you think? wink

Offline

#2 2013-01-26 04:12:57

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: First PKGBUILD, is it alright to submit?

herrflockig wrote:
  mkdir -p $pkgdir/usr/bin
  cp yt.py $pkgdir/usr/bin/yt
  chmod +x $pkgdir/usr/bin/yt

This can be condensed to 1 command:

install -Dm755 yt.py "$pkgdir/usr/bin/yt"

Also WTFPL should be "custom" or "custom:WTFPL" since it's not an officially recognized common license in arch.

herrflockig wrote:

And while you're at it, why not give the script a try and let me know what you think? wink

I'm liking this a lot..

Is it expected that I can't resize/fullscreen the videos? The video just stays in the center at the same size with surrounding black space.

(Maybe you can start a Community Contributions thread for this.)

Last edited by tdy (2013-01-26 04:45:12)

Offline

#3 2013-01-26 04:31:47

herrflockig
Member
Registered: 2012-10-15
Posts: 8

Re: First PKGBUILD, is it alright to submit?

Suggestions noted and changes made. Thanks for the help!

tdy wrote:

I'm liking this a lot..

Thanks!

tdy wrote:

Is it expected that I can't resize/fullscreen the videos? The video just stays in the center at the same size with surrounding black space.

Hrm,  hitting 'f' usually works for me. Either that or edit the script to call mplayer with the -fs flag. Or it's a bug in my script. Most likely the latter xP


tdy wrote:

(Maybe you can start a Community Contributions thread for this.)

Will do! Thanks again for all the help.

Last edited by herrflockig (2013-01-26 04:36:10)

Offline

#4 2013-01-26 13:07:21

Morn
Member
Registered: 2012-09-02
Posts: 348

Re: First PKGBUILD, is it alright to submit?

"makedepends=('git')" isn't needed…

Offline

#5 2013-01-26 15:31:55

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: First PKGBUILD, is it alright to submit?

Morn wrote:

"makedepends=('git')" isn't needed…

Umm what? As it's currently written, this package definitely needs git as a makedep.

Offline

#6 2013-01-26 16:14:14

Morn
Member
Registered: 2012-09-02
Posts: 348

Re: First PKGBUILD, is it alright to submit?

Somewhere on the Wiki it says that git is always supposed to be available to makepkg, so you don't have to list it explicitly.

Offline

#7 2013-01-26 16:20:36

Awebb
Member
Registered: 2010-05-06
Posts: 4,418

Re: First PKGBUILD, is it alright to submit?

I just uninstalled git and the build broke. Sounds reasonable to me.

Offline

#8 2013-01-26 16:23:35

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: First PKGBUILD, is it alright to submit?

Morn wrote:

Somewhere on the Wiki it says that git is always supposed to be available to makepkg, so you don't have to list it explicitly.

If it does, it needs to be changed. I can only guess that someone took the idea that "base-devel should be assumed" and incorrectly applied that to VCSes.

Offline

#9 2013-01-26 16:35:16

Morn
Member
Registered: 2012-09-02
Posts: 348

Re: First PKGBUILD, is it alright to submit?

Well, looking through the random sample of AUR packages in my ~/aur/, I am getting the impression that quite a few git-based PKGBUILDs do not list git as a dependency. So, wouldn't it be easier to fix /usr/bin/makepkg so it offers to install git if it's not there?

I think the Wiki will have to go to bed without dinner tonight. Bad, bad Wiki! smile

Offline

#10 2013-01-26 16:38:26

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 438

Re: First PKGBUILD, is it alright to submit?

I think makepkg in the next version of pacman might have better support for VCSes, but I haven't followed pacman-git closely enough to say for sure.

Last edited by tdy (2013-01-26 16:39:22)

Offline

#11 2013-01-26 18:46:47

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,966
Website

Re: First PKGBUILD, is it alright to submit?

Oh dear - I hope I won't be expected to install every possible VCS just to have PKGBUILDS work.

Git should definitely be listed.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#12 2013-01-26 19:14:43

Morn
Member
Registered: 2012-09-02
Posts: 348

Re: First PKGBUILD, is it alright to submit?

Meanwhile, I've fixed my own PKGBUILDs, and other than that it looks like this mostly affects some older, seldom-updated PKGBUILDs. So maybe it's not a big problem in practice, especially if nobody has noted this inconsistency in PKGBUILDs before. I don't think namcap has ever complained about it either.

But I'm not sure why makepkg is unable to realize on its own that git/hg/bzr are missing and add them as build dependencies. Failing with an error message is a bit lame when an error can be so easily avoided.

Last edited by Morn (2013-01-26 19:14:59)

Offline

#13 2013-01-26 20:27:11

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,966
Website

Re: First PKGBUILD, is it alright to submit?

Makepkg does not automatically install any other missing dependencies - why would these be different.

Makepkg should not install *anything* unless passed the -s or -i flags.  It should just make a package.

Last edited by Trilby (2013-01-26 22:33:08)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#14 2013-01-26 21:30:23

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,066

Re: First PKGBUILD, is it alright to submit?

https://wiki.archlinux.org/index.php/VC … Guidelines

"Don't forget to include the appropriate VCS tool (cvs, subversion, git, ...) in makedepends=...."

It was part of the initial wiki commit in 2005, so anyone that's written PKGBUILDs since then can't blame the Wiki

Last edited by Scimmia (2013-01-26 21:30:34)

Offline

Board footer

Powered by FluxBB