You are not logged in.

#1 2006-10-09 09:04:06

louipc
Member
Registered: 2006-10-09
Posts: 85

tomatoes

Hey this is my first attempt at a package. Does it look OK for submitting? Thanks.

PKGBUILD

# Contributor: Loui Chang <louipc>
pkgname=tomatoes
pkgver=1.55
pkgrel=1
pkgdesc="How many tomatoes can you smash in ten short minutes?."
url="http://tomatoes.sourceforge.net"
license="ZLIB"
depends=('sdl>=1.2.7' 'sdl_image>=1.2.2' 'sdl_mixer' 'mesa')
source=(http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/$pkgname-linux-src-$pkgver.tar.bz2
        http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/$pkgname-linux-1.5.tar.bz2
        http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/games-arcade/$pkgname/files/$pkgname-$pkgver-c_str.patch
        makefile.diff)
md5sums=('b0fa201bfb55d1cb402c52ab7e743086' 'a6a7ff71bb1098fd0a4098fd3d846339'
         '1dd5414f5a6fb2ddc52391b29b6f6e01' '95b6cef1f4cf4f07534244bdd8e7fe4e')

build() {
 cd $startdir/src
 mv $pkgname-$pkgver-c_str.patch $pkgname-$pkgver
 mv makefile.diff $pkgname-$pkgver
 cd $pkgname-$pkgver
 patch -p0 < makefile.diff
 patch -p0 < $pkgname-$pkgver-c_str.patch
 make
 install -D $startdir/src/$pkgname-$pkgver/$pkgname $startdir/pkg/usr/bin/$pkgname
 install -D -m644 $startdir/src/$pkgname-$pkgver/icon.png $startdir/pkg/usr/share/$pkgname/icon.png
 mv $startdir/src/$pkgname-1.5/* $startdir/pkg/usr/share/$pkgname
}

makefile.diff

--- makefile    2004-11-20 13:50:09.000000000 -0500
+++ makefile.1  2006-10-09 02:36:04.000000000 -0400
@@ -14,10 +14,10 @@
 # necessary. Remember to include the trailing /
 
 # MPK directory (where 'tomatoes.mpk' is), default: ./
-MPKDIR = ./
+MPKDIR = /usr/share/tomatoes/
 
 # Music directory (where the music files are), default: ./music/
-MUSICDIR = ./music/
+MUSICDIR = /usr/share/tomatoes/music/
 
 # Hiscore directory (where the hiscores are written to), default: ./
 # We need read/write access!

Offline

#2 2006-10-09 09:10:27

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: tomatoes

I'd prefer the high-score dir to be a hidden directory inside the users home dir, maybe ~/.tomatoes?


Haven't been here in a while. Still rocking Arch. smile

Offline

#3 2006-10-09 09:14:48

louipc
Member
Registered: 2006-10-09
Posts: 85

Re: tomatoes

Sigi wrote:

I'd prefer the high-score dir to be a hidden directory inside the users home dir, maybe ~/.tomatoes?

That's how it seems to work on testing so I didn't mess with that part.

Offline

#4 2006-10-09 09:32:02

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: tomatoes

ok, nevermind.


Haven't been here in a while. Still rocking Arch. smile

Offline

#5 2006-10-09 11:30:31

djscholl
Member
From: Michigan, USA
Registered: 2006-05-24
Posts: 56

Re: tomatoes

To be consistent with other AUR packages, I would suggest three minor changes.

While sdl is a requirement, it is pulled in by both sdl_image and sdl_mixer, so it does not need to be listed in the depends array. Since Arch does rolling releases, and is well past the minimum versions of sdl* required by tomatoes, I personally would not bother to specify the minimum version of sdl_image.

The makefile.diff that you will include in your PKGBUILD tarball does not get listed in the source array, and it does not need an MD5sum.

Standardize the error code returned by make errors with

make || return 1

following the example in the ABS wiki page.

Offline

#6 2006-10-09 16:37:55

louipc
Member
Registered: 2006-10-09
Posts: 85

Re: tomatoes

Thanks. This is what I have now. I also changed the source location and moved the .patch file into the tar file.

# Contributor: Loui Chang <louipc>
pkgname=tomatoes
pkgver=1.55
pkgdata=1.5
pkgrel=1
pkgdesc="How many tomatoes can you smash in ten short minutes?."
url="http://tomatoes.sourceforge.net"
license="ZLIB"
depends=('sdl_image' 'sdl_mixer' 'mesa')
source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-linux-src-$pkgver.tar.bz2
        http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-linux-$pkgdata.tar.bz2
)
md5sums=('b0fa201bfb55d1cb402c52ab7e743086' 'a6a7ff71bb1098fd0a4098fd3d846339')

build() {
 cd $startdir
 cp makefile.diff src/$pkgname-$pkgver
 cp $pkgname-$pkgver-c_str.patch src/$pkgname-$pkgver
 cd src/$pkgname-$pkgver
 patch -p0 < makefile.diff
 patch -p0 < $pkgname-$pkgver-c_str.patch
 make || return 1
 install -D $startdir/src/$pkgname-$pkgver/$pkgname $startdir/pkg/usr/bin/$pkgname
 install -D -m644 $startdir/src/$pkgname-$pkgver/icon.png $startdir/pkg/usr/share/$pkgname/icon.png
 mv $startdir/src/$pkgname-$pkgdata/* $startdir/pkg/usr/share/$pkgname
}

Offline

#7 2006-10-09 21:45:04

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: tomatoes

Just for clarification :  You need 2 files (diff and patch) for this package that are not listed in the source array ?

All aur packages i have seen (or made) include ALL (except .install files) necessary files in the source array and md5sum.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2006-10-09 21:57:30

cdhotfire
Member
From: Ocala, Florida
Registered: 2006-02-13
Posts: 151

Re: tomatoes

Lone_Wolf wrote:

Just for clarification :  You need 2 files (diff and patch) for this package that are not listed in the source array ?

All aur packages i have seen (or made) include ALL (except .install files) necessary files in the source array and md5sum.

Yes that is correct, I don't know why the suggestion to do otherwise was posted.

Btw, nice PKGBUILD.  smile


[img]http://www.barbarawood.com/guestbook/images/smilies/koolaid.gif[/img]
"Ooooh Yaaaa!"

Offline

#9 2006-10-09 23:06:25

louipc
Member
Registered: 2006-10-09
Posts: 85

Re: tomatoes

Doh! Haha. Ok I will change it back since it's two against one.
Tomatoes!

Offline

#10 2006-10-09 23:33:23

louipc
Member
Registered: 2006-10-09
Posts: 85

Re: tomatoes

cdhotfire wrote:

Yes that is correct, I don't know why the suggestion to do otherwise was posted.

Btw, nice PKGBUILD.  smile

Thanks! Yeah whoever make the makefile forgot to put in an install option so I just stuck some commands in build().

Offline

#11 2006-10-10 02:06:31

djscholl
Member
From: Michigan, USA
Registered: 2006-05-24
Posts: 56

Re: tomatoes

I'm surprised to read your comments. I hadn't realized that anyone was listing those files in the source and MD5sum arrays. My sgi-fonts tarball in the AUR contains a patch file. I posted the PKGBUILD on this forum, it was discussed, and it has been verified by a trusted user as safe to use. At no time did anyone suggest that I list the included patch file along with the file to download.

I don't object to voting, but I would like to add some further comments. I'm new to Arch, but I haven't seen anything in the documentation on this point. If there is a strong concensus either way, something could be added to the wiki.

I'm sticking with my vote, and here's why. The MD5sums are there to protect the person running makepkg from downloading correctly named files that may be either unsafe or incompatible with the PKGBUILD. This is a valid concern, especially the risk of incompatibility, as many files these days are served from dynamic web pages.

However, the same concerns simply do not arise with files included in the tarball. The included files cannot be unsafe or incompatible unless either the author of the PKGBUILD or a malicious person remakes the tarball. The original author can insure both safety and compatibility. If the tarball is remade by a malicious person, he could trivially update the MD5sum array to cover his tracks, rendering the protection useless.

What you are suggesting is more work, and I don't see any additional benefit. However, I am willing to be convinced otherwise, if there is something I have overlooked. If you post, I am also curious why you write that the .install file is exempt from being listed.

Offline

#12 2006-10-10 14:08:59

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: tomatoes

I checked the Arch_Packaging_Standards and it doesn't say anything about this.
I've also checked a few packages from current and some have patches listed as source files, others don't.

The .install files are meant for pre-install/post-install/upgrade/remove special actions/messages and are used through the install=( ) line in PKGBUILD .
Makepkg doesn't allow inclusion of .install files in source/md5sum array.
(i don't know the reason behind this)

Imo the main reason for adding extra files to source/md5sum array is to make sure everything needed to build the package is present and has the same contents it did have when the package was made by the maintainer.

So i see the md5sum as a way to make sure the source files have not been corrupted or changed. This doesn't say anything about whether they are safe to use.

It seems we have come across something that needs to be discussed between developers/TU's / AUR package submitters so we can get a consensus.

Can a mod split this thread  so we can continue the discussion ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#13 2006-10-10 14:40:12

cdhotfire
Member
From: Ocala, Florida
Registered: 2006-02-13
Posts: 151

Re: tomatoes

The .install is not added to the source array because it is already in the install=.  As for putting patchesin the source array, it is ideal to do because makepkg moves those files to src/ automaticly, and in AUR the files are viewed to so people can see what files are needed without opening the PKGBUILD.


[img]http://www.barbarawood.com/guestbook/images/smilies/koolaid.gif[/img]
"Ooooh Yaaaa!"

Offline

#14 2006-10-16 23:37:41

djscholl
Member
From: Michigan, USA
Registered: 2006-05-24
Posts: 56

Re: tomatoes

I also found after more reading, that this is discussed in the wiki,
http://wiki.archlinux.org/index.php/The … guidelines
and it says "If you find you need to supply files which are not downloadable on the fly, for example self-made patches, you simply put those into the same directory where your PKGBUILD is in, and add the filename to this source array. "

I also checked some packages in current, and some community packages, and all the ones I saw were done this way.  It seems kind of pointless to me to do MD5sums on files that are downloaded in a tarball with the PKGBUILD, but it's not that much extra work. I do see the value in having all of the patches, scripts, and config files listed on the website with the source code. It appears that I am on the short side of the consensus, so I'll change my ways. I retract my arguments made above.

Offline

Board footer

Powered by FluxBB