You are not logged in.

#1 2007-10-16 14:42:09

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

ratmen - my first serious PKGBUILD

Hi all, I've been trying to write my first PKGBUILD, this time reading the wiki attentively.
I was in need of a package called ratmen, a little app for ratpoison (but not only), which creates a X menu using the command line. I still don't really understand what use I could make of it, but there is a script using it quite nicely (window-menu, so I thought I could give it a go. Everything worked fine, but I'm not sure I can post it in AUR yet, I would like some feedback from more experienced users. Thanks smile

# Contributor: Emmanuele Massimi <finferflu@gmail.com>
pkgname=ratmen
pkgver=2.2.2
pkgrel=1
pkgdesc="ratmen is a program derived from ratmenu (although some code was copied and
pasted directly from its parent 9menu). This program is intended for use with
ratpoison, but I guess it'll work fine with 9wm and other similarly-minded
window managers."
arch=('i686')
url=""
license=('GPL')
depends=(perl)
makedepends=()
provides=(ratmen)
conflicts=()
replaces=(ratmen)

install=
source=(http://www.update.uu.se/~zrajm/programs/ratmen/$pkgname-$pkgver.tar.gz)

md5sums=('0091cb16db87951b9e19a9ee4b4cd08c')

build() {
  cd "$startdir/src/$pkgname-$pkgver"

  pod2man ./ratmen.c > ratmen.1
  make || return 1
  make PREFIX="$startdir/pkg" install
}

I'm not entirely sure where to find the makedepends and conflicts arguments, if any.

Last edited by finferflu (2007-10-16 14:43:00)


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#2 2007-10-16 14:49:08

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: ratmen - my first serious PKGBUILD

why does it provide and replace itself?  That's not necessary, and probably wrong/confusing.  I doubt it conflicts with anything.

Also, that description is HUGE.  Try shortening it down a bit.

To find makedepends, you'd probably need to look at the app's documentation.

Offline

#3 2007-10-16 15:27:28

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

Thanks Cerebral, I admit I was a bit confused by those two entries you mentioned. As for the app's documentation, there is only one README file which doesn't explain anything. In fact I had to look into the Gentoo ebuild they provided in order to understand how to compile it successfully...

So, so far I'm at this point:

# Contributor: Emmanuele Massimi <finferflu@gmail.com>
pkgname=ratmen
pkgver=2.2.2
pkgrel=1
pkgdesc="Display a simple X menu consisting of user defined entries."
arch=('i686')
url="http://ratpoison.antidesktop.net/cgi-bin/wiki/ratmen"
license=('GPL')
depends=(perl)
makedepends=()
conflicts=()

install=
source=(http://www.update.uu.se/~zrajm/programs/ratmen/$pkgname-$pkgver.tar.gz)

md5sums=('0091cb16db87951b9e19a9ee4b4cd08c')

build() {
  cd "$startdir/src/$pkgname-$pkgver"

  pod2man ./ratmen.c > ratmen.1
  make || return 1
  make PREFIX="$startdir/pkg" install
}

Last edited by finferflu (2007-10-16 15:28:00)


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#4 2007-10-16 19:04:26

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: ratmen - my first serious PKGBUILD

Hrm, interesting - mind posting a screenshot?

Offline

#5 2007-10-16 19:20:42

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: ratmen - my first serious PKGBUILD

makedepends=()
conflicts=()

install=

those lines are not needed and should be removed if u dont use them


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#6 2007-10-16 20:19:32

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

@ phrakture
There you go, this is a menu I have made up with a simple sh script, so that I could invoke it with a ratpoison keybinding:

shot-161007.png.xs.jpg

This is the script, by the way:

#!/bin/sh
ratmen -c -d## firefox##firefox pidgin##pidgin thunar##thunar gpicview##gpicview vlc##vlc beepmp##beep-media-player inkscape##inkscape gimp##gimp

@ dolby
Ok, thank you. What is the "install" entry for, anyway? I couldn't find it on the wiki.

Do you think I am able to add it to AUR at this stage?

# Contributor: Emmanuele Massimi <finferflu@gmail.com>
pkgname=ratmen
pkgver=2.2.2
pkgrel=1
pkgdesc="Display a simple X menu consisting of user defined entries."
arch=('i686')
url="http://ratpoison.antidesktop.net/cgi-bin/wiki/ratmen"
license=('GPL')
depends=(perl)
source=(http://www.update.uu.se/~zrajm/programs/ratmen/$pkgname-$pkgver.tar.gz)

md5sums=('0091cb16db87951b9e19a9ee4b4cd08c')

build() {
  cd "$startdir/src/$pkgname-$pkgver"

  pod2man ./ratmen.c > ratmen.1
  make || return 1
  make PREFIX="$startdir/pkg" install
}

Last edited by finferflu (2007-10-16 20:24:25)


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#7 2007-10-16 21:34:53

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: ratmen - my first serious PKGBUILD

finferflu wrote:

Ok, thank you. What is the "install" entry for, anyway? I couldn't find it on the wiki.

its for when u want to exec something or make an action pre or/and post installation and so on of the package. eg a simple one would be this

Last edited by dolby (2007-10-16 21:37:18)


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#8 2007-10-17 19:00:23

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

Thanks dolby smile
I have uploaded the PKGBUILD on AUR, since nobody seemed worried: http://aur.archlinux.org/packages.php?d … 1&ID=13347


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#9 2007-10-17 20:06:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: ratmen - my first serious PKGBUILD

Ahh.. I'm worried. smile

Actually, that's not true - mildly curious would be more accurate. When you built this, did you notice where it was installed to? To be more specific, your PREFIX is not quite right, as it installed the executable to /bin, and the man page to /man, instead of /usr/bin and /usr/man respectively.

I'd also suggest using namcap to check the package, as you have a missing dependency.

Offline

#10 2007-10-17 20:18:04

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

Thanks tomk, so, should I change PREFIX to $startdir/pkg/usr?
also, what is namcap? I guess I should find out by myself tongue


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#11 2007-10-17 20:30:06

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

Ok, now everything is alright, thanks for suggesting me namcap smile

# Contributor: Emmanuele Massimi <finferflu@gmail.com>
pkgname=ratmen
pkgver=2.2.2
pkgrel=1
pkgdesc="Display a simple X menu consisting of user defined entries."
arch=('i686')
url="http://ratpoison.antidesktop.net/cgi-bin/wiki/ratmen"
license=('GPL')
depends=('libx11-xcb')
source=(http://www.update.uu.se/~zrajm/programs/ratmen/$pkgname-$pkgver.tar.gz)

md5sums=('0091cb16db87951b9e19a9ee4b4cd08c')

build() {
  cd "$startdir/src/$pkgname-$pkgver"

  pod2man ./ratmen.c > ratmen.1
  make || return 1
  make PREFIX="$startdir/pkg/usr" install
}

Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#12 2007-10-17 20:48:09

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: ratmen - my first serious PKGBUILD

so... is it a perl app?  namcap doesn't quite properly detect perl or python deps, afaik.  If namcap told you perl wasn't a dep, but you KNOW it's a perl app, then add 'perl' as a dep.

Offline

#13 2007-10-17 20:49:47

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

Owww! It tricked me. I thought it wasn't needed because perl is part of the core repos, so I thought it was also part of the base system... see how far my logic goes? tongue
Let me re-update it now...

# Contributor: Emmanuele Massimi <finferflu@gmail.com>
pkgname=ratmen
pkgver=2.2.2
pkgrel=1
pkgdesc="Display a simple X menu consisting of user defined entries."
arch=('i686')
url="http://ratpoison.antidesktop.net/cgi-bin/wiki/ratmen"
license=('GPL')
depends=('perl' 'libx11-xcb')
source=(http://www.update.uu.se/~zrajm/programs/ratmen/$pkgname-$pkgver.tar.gz)

md5sums=('0091cb16db87951b9e19a9ee4b4cd08c')

build() {
  cd "$startdir/src/$pkgname-$pkgver"

  pod2man ./ratmen.c > ratmen.1
  make || return 1
  make PREFIX="$startdir/pkg/usr" install
}

Last edited by finferflu (2007-10-17 20:57:15)


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#14 2007-10-18 01:39:40

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: ratmen - my first serious PKGBUILD

finferflu wrote:

Owww! It tricked me. I thought it wasn't needed because perl is part of the core repos, so I thought it was also part of the base system... see how far my logic goes? tongue

Even if a dependency is part of the core repo, it's a good idea to specify it anyway as a dependency for self-documentation purposes, and as not to screw up the users who might not have all of the core packages installed.  It's not the norm, but there are quite a few people out there who trim down all the packages they don't think they need, even if they are in core.

Offline

#15 2007-10-18 10:59:18

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: ratmen - my first serious PKGBUILD

Thanks, elasticdog smile
I think that posting my first PKGBUILD here has been an excellent idea, I'm learning lots of new things.
One more reason to love Arch big_smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

Board footer

Powered by FluxBB