You are not logged in.

#1 2006-05-17 15:22:35

barebones
Member
Registered: 2006-04-30
Posts: 235

PKGBUILD for swiftfox: can someone check this for me?

I just finished my first PKGBUILD, one for swiftfox. Its pre-compiled, so essentially I just dumped all the contents of a tarball into a directory in /opt. If you guys could check it out before I submit it to the aur, I'd really appreciate it.

pkgname=swiftfox
pkgver=1.5.0.3
pkgrel=1
_pkgarch=athlon-xp
pkgdesc="Swiftfox is a prebuilt version of Firefox,optimized for AMD AthlonXP processors"
url="http://www.getswiftfox.com"
license="MPL"
depends=(gtk2 libidl2 mozilla-common nss desktop-file-utils)
makedepends=()
conflicts=()
replaces=()
backup=()
install=('swiftfox.install')
source=(http://www.getswiftfox.com/builds/releases/$pkgname-$pkgver-$_pkgarch.tar.bz2)
md5sums=('d3b810d27f655c4908bcd4c7730d9427')

build() {
  cd $startdir/src/
  mkdir $startdir/pkg/opt/
  cp -r $pkgname $startdir/pkg/opt/$pkgname
}

and here is the swiftfox.install file

# arg 1:  the new package version
pre_install() {
  /bin/true
}

# arg 1:  the new package version
post_install() {
  ln -s /opt/swiftfox/swiftfox /usr/bin/swiftfox
  /bin/true
}

# arg 1:  the new package version
# arg 2:  the old package version
pre_upgrade() {
  /bin/true
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  /bin/true
}

# arg 1:  the old package version
pre_remove() {
  /bin/true
}

# arg 1:  the old package version
post_remove() {
  rm /usr/bin/swiftfox
  /bin/true
}

op=$1
shift
$op $*

Edit1: added dependencies

Offline

#2 2006-05-17 15:27:53

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: PKGBUILD for swiftfox: can someone check this for me?

Thanks a lot wink

Is it conflicting with mozilla-firefox ? (Edit: Ok no, you put it in its own folder)
Look at the dependencies of mozilla-firefox: for example gtk2 is probably needed

Edit2: I think the variables (like _pkgvar) should be avoided as much as possible.
Maybe you can call this package "swiftfox-athlon-xp" and use some string manipulation to extract the architecture, or just hardwrite it.

Offline

#3 2006-05-17 15:37:48

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: PKGBUILD for swiftfox: can someone check this for me?

Gotcha, I was wondering about dependencies myself, since the swiftfox website doesn't actually list any. For now I'll list whatever ones that mozilla-firefox has.

Offline

#4 2006-05-17 15:43:27

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: PKGBUILD for swiftfox: can someone check this for me?

try to run ldd on the binary (have a look at the wiki guidelines to create a pkgbuild for the dependencies)
-> ok it's static so there is no dependency


I am wondering too: can't the link be made in the build() function ?

Answer yes:

mkdir -p $startdir/pkg/usr/bin
ln -s /opt/$pkgname/$pkgname $startdir/pkg/usr/bin/$pkgname

Offline

#5 2006-05-17 16:58:30

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: PKGBUILD for swiftfox: can someone check this for me?

Running ldd on the swiftfox binary threw an error, so I didn't find out anything new there, but I did run namcap on it and narrowed down the dependencies a bit. Heres the newest PKGBUILD:

pkgname=swiftfox
pkgver=1.5.0.3
pkgrel=1
_pkgarch=athlon-xp
pkgdesc="Swiftfox is a prebuilt version of Firefox,optimized for AMD AthlonXP processors"
url="http://www.getswiftfox.com"
license="MPL"
depends=(gconf libgnomecanvas nss)
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://www.getswiftfox.com/builds/releases/$pkgname-$pkgver-$_pkgarch.tar.bz2)
md5sums=('d3b810d27f655c4908bcd4c7730d9427')

build() {
  cd $startdir/src/
  mkdir $startdir/pkg/opt/
  cp -r $pkgname $startdir/pkg/opt/$pkgname
  mkdir -p $startdir/pkg/usr/bin 
  ln -s /opt/$pkgname/$pkgname $startdir/pkg/usr/bin/$pkgname
}

Offline

#6 2006-05-17 17:42:02

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: PKGBUILD for swiftfox: can someone check this for me?

1. Keep it with the firefox dependencies in your first post. It is an optimized firefox build, so the deps should be the same.

2. You should do something about your pkgname, as other people might want to contribute swiftfox for other archs to the AUR (eg p4, p3, etc)
You should consider a naming scheme as

swiftfox-athlon-xp
swiftfox-pentium4
swiftfox-pentium3
swiftfox-atholon64
etc

Offline

#7 2006-05-17 18:17:43

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: PKGBUILD for swiftfox: can someone check this for me?

I added some dependencies, namcap doesn't beleive they're necessary, but I have no way of actually testing them (without removing a ton of programs).

I'm hesitant to change the name of the package to corrispond with the architecture. Mainly this is because I already have a _pkgarch varible in the package, so building it for a different architecture should not be that hard. It doesn't really seem KISS complient to have a different PKGBUILD made for all 10 different architectures on the swiftfox website.

Offline

#8 2006-05-17 18:45:12

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: PKGBUILD for swiftfox: can someone check this for me?

It indeed is not hard to change the arch in the PKGBUILD, but that is not what it is about. Having an _arch variable in the PKGBUILD, you cannot see from neither the AUR site (well maybe as comment, but most people don't read those) nor using aurbuild. so people might actually swiftfox-athlon-xp on a p4 or so.
Having different swiftfox packages in the AUR for the different archs doesn't harm anyone.
I really don't see your point why not changing the pkgname according the arch.

Offline

#9 2006-05-17 18:53:07

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: PKGBUILD for swiftfox: can someone check this for me?

Ahh, yes.  But packaging standards for archlinux are that we are an i686 optimized distro.  It should always be assumed that someone is trying to build this on an i686 machine.  So I believe at a minimum you should have the pkg name reflect the architecture, and in comments tell people how to do it for others.

I like how you did package it though.  If we were to support multiple architectures, _pkgarch was a clear way of doing this.

Offline

#10 2006-05-17 19:40:30

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: PKGBUILD for swiftfox: can someone check this for me?

Allright, you do have a point about having something in the title, so I've added that, and I've also added to the description. Unless there are any more suggestions, I'll put this into the aur tonight.

pkgname=swiftfox-amd
_pkgname=swiftfox
pkgver=1.5.0.3
pkgrel=1
_pkgarch=athlon-xp
pkgdesc="Swiftfox is a prebuilt version of Firefox,optimized for AMD AthlonXP processors. To install the build for a different architecture, go to getswiftfox.com, find the name they use for your processor, and replace the _pkgarch variable."
url="http://www.getswiftfox.com"
license="MPL"
depends=(gconf libgnomecanvas nss mozilla-common desktop-file-utils libidl2)
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://www.getswiftfox.com/builds/releases/$_pkgname-$pkgver-$_pkgarch.tar.bz2)
md5sums=('d3b810d27f655c4908bcd4c7730d9427')

build() {
  cd $startdir/src/
  mkdir $startdir/pkg/opt/
  cp -r $_pkgname $startdir/pkg/opt/$_pkgname
  mkdir -p $startdir/pkg/usr/bin 
  ln -s /opt/$_pkgname/$_pkgname $startdir/pkg/usr/bin/$_pkgname
}

Offline

#11 2006-05-18 00:42:47

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: PKGBUILD for swiftfox: can someone check this for me?

_post="""why dont you just edit your CFLAGS in /etc/makepkg.conf and rebuild the firefox PKGBUILD?

there's no need to make the whole url variable's that's overdoing it. once you start using a different variable for package name and the source url, you ought to just put it into the source url directly."""

_name="James"

echo $_post
echo $_name

Offline

#12 2006-05-19 10:59:57

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: PKGBUILD for swiftfox: can someone check this for me?

I was thinking about it too, first (recompiling firefox). But this is a binary file, so it is easier/faster for users to get this binary instead of recompiling firefox with the optimizations (we are not gentoo).

About the dependencies: I think that some are already included: e.g.:

libmozjs.so  libnss3.so     libplc4.so   libsmime3.so    libssl3.so   libxpcom_compat.so  libxpistub.so
libnspr4.so  libnssckbi.so  libplds4.so  libsoftokn3.so  libxpcom.so  libxpcom_core.so


PS: I don't manage to build the firefox PKGBUILD:

creating gfx/gfx-config.h
creating netwerk/necko-config.h
creating xpcom/xpcom-config.h
creating xpcom/xpcom-private.h
make[1]: Leaving directory `/var/abs/local/mozilla-firefox/src/mozilla'
==> ERROR: Build Failed.  Aborting...

Don't know if it's a bug...

Offline

#13 2006-05-19 13:15:30

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: PKGBUILD for swiftfox: can someone check this for me?

Unfortunatly, I can't help you with the firefox compile errors, make is not my friend. The swiftfox PKGBUILD is up in the AUR though, so try that out, eh? wink

P.S. Thanks for your suggestions guys.

Offline

#14 2006-05-19 13:47:07

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: PKGBUILD for swiftfox: can someone check this for me?

Already tried and adopted big_smile

Well I removed some dependencies and it is still working:
libidl2, nss, libgnomecanvas, gconf

Offline

#15 2007-06-09 16:39:18

sandstorm
Member
From: Zurich [CH] & Mannheim [DE]
Registered: 2005-08-13
Posts: 169

Re: PKGBUILD for swiftfox: can someone check this for me?

Is this an official makepkg instruction?

_pkgarch=athlon

Best regards,
Martin

Offline

#16 2007-06-10 00:19:01

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: PKGBUILD for swiftfox: can someone check this for me?

sandstorm wrote:

Is this an official makepkg instruction?

_pkgarch=athlon

Best regards,
Martin

No. That's just a custom variable.

Offline

#17 2007-07-20 07:10:11

blum
Member
From: Plovdiv, Bulgaria
Registered: 2004-04-05
Posts: 77
Website

Re: PKGBUILD for swiftfox: can someone check this for me?

@ sebcactus:

PS: I don't manage to build the firefox PKGBUILD:

creating gfx/gfx-config.h
creating netwerk/necko-config.h
creating xpcom/xpcom-config.h
creating xpcom/xpcom-private.h
make[1]: Leaving directory `/var/abs/local/mozilla-firefox/src/mozilla'
==> ERROR: Build Failed.  Aborting...

Don't know if it's a bug...

You need to disable export MAKEFLAGS="-j2" in your makepkg.conf
It worked for me.

Last edited by blum (2007-07-20 08:51:02)


..,

Offline

Board footer

Powered by FluxBB