You are not logged in.
pkgname=gnubg
pkgver=20070804
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=()
source=(http://www.gnubg.org/media/sources/$pkgname-source-SNAPSHOT-$pkgver.tar.gz)
md5sums=('9349e0ac90e23a46914ddcc8b3b6c094')
build() {
cd $startdir/src/$pkgname
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install || return 1
}
On making this PKGBUILD I got to the point where I needed to specify the version.
Ideally I'd of done this with as the title `date +%Y%m%d`, but the wiki says not to, so my question is how should I write/do this?
Also on a related note after installing adding a shortcut is failing on KDE unless Run in terminal is checked, is there a fix or just a note in the comments?
I've tried finding an error log but can't find anything relative, no indication except Gdk-WARNING **: locale not supported by C library which is also caught if successfully started. So though I think its related to something GTK'ish I'm not sure its a show stopper just a little annoying.
Last edited by FeatherMonkey (2007-12-07 12:18:48)
Offline
On making this PKGBUILD I got to the point where I needed to specify the version.
Ideally I'd of done this with as the title `date +%Y%m%d`, but the wiki says not to, so my question is how should I write/do this?
Exactly how you have done: just by setting the date "manually"
Also on a related note after installing adding a shortcut is failing on KDE unless Run in terminal is checked, is there a fix or just a note in the comments?
I've tried finding an error log but can't find anything relative, no indication except Gdk-WARNING **: locale not supported by C library which is also caught if successfully started. So though I think its related to something GTK'ish I'm not sure its a show stopper just a little annoying.
Don't cross post - make a new thread instead.
Offline
Ideally I'd of done this with as the title `date +%Y%m%d`, but the wiki says not to, so my question is how should I write/do this?
This kind of thing works. First, start with two files. One called 'original_PKGBUILD' and the other a build script. Make the first one the same as the actual PKGBUILD file except with a modified pkgver field:
pkgver=00000000
In the build script, 'original_PKGBUILD' is copied as 'PKGBUILD' in the current directory. Then the 'sed' command is called to tag the date. Finally makepkg is called:
cp ./original_PKGBUILD ./PKGBUILD
sed -i "1,6 s/pkgver=00000000/pkgver=`date +%Y%m%d`/" ./PKGBUILD
makepkg
Offline
i get the following error while configuring:
checking for GLIB... configure: error: "You need to have glib2 to compile GNU backgammon"
pacman says i already installed glib2
does anyone know what to do?
Offline
pacman -S base-devel, for starters
1000
Offline
OK Guys sorry forgot about this I'll finish it off was a little hard for my first one, now became harder
I need a hand so taking info from the above I now have
build
#!/bin/bash
cp ./original_PKGBUILD ./PKGBUILD
var=`date --date="2 day ago" +%Y%m%d`
sed -i "1,6 s/pkgver=00000000/pkgver=$var/" ./PKGBUILD
sum=`makepkg -g`
sed -i "s/md5sums=('')/$sum/" ./PKGBUILD
makepkg
original_PKGBUILD
pkgname=gnubg
pkgver=00000000
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686 x86_64)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=()
source=(http://www.gnubg.org/media/sources/$pkgname-source-SNAPSHOT-$pkgver.tar.gz)
md5sums=('')
build() {
cd $startdir/src/$pkgname
autoreconf
automake --add-missing
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install || return 1
}
then in the PKGBUILD proper I have
pkgname=gnubg
pkgver=000000
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686 x86_64)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=()
md5sums=('')
build() {
cd $startdir
./build
}
Now this is compiling fine but I've got a slight problem with the docs, when moving them to pkg they are moving them to $startdir/pkg/usr/share/gnubg/doc which means where I started at ~ I now have a pkg directory. Meaning I guess using something like yaourt will cause major problems..
Apart from this little glitch it installs fine, could someone please assit me in how to proceed from here, I'm guessing its a sed but not sure. Also if I've gone wrong in the structure and it can be improved any comments gratefully received I have to say I found this one a bit of a challenge.
Offline
Could someone tell me if this is fine now I've tested it installs at least on 64bit
#####PKGBUILD#####
pkgname=gnubg
pkgver=000000
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686 x86_64)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=()
md5sums=('')
build() {
cd $startdir
./build
}
#####build#####
#!/bin/bash
cp ./original_PKGBUILD ./PKGBUILD
var=`date --date="2 day ago" +%Y%m%d`
sed -i "1,6 s/pkgver=00000000/pkgver=$var/" ./PKGBUILD
sum=`makepkg -g`
sed -i "s/md5sums=('')/$sum/" ./PKGBUILD
makepkg
#####original_PKGBUILD#####
pkgname=gnubg
pkgver=00000000
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686 x86_64)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=()
source=(http://www.gnubg.org/media/sources/$pkgname-source-SNAPSHOT-$pkgver.tar.gz)
md5sums=('')
build() {
cd $startdir/src/$pkgname
autoreconf
automake --add-missing
./configure --prefix=/usr --docdir=/usr
make || return 1
make DESTDIR=$startdir/pkg install || return 1
mv $startdir/pkg$startdir/pkg/usr/share/gnubg/doc/* $startdir/pkg/usr/share/gnubg/
rm -r $startdir/pkg$startdir
}
Now this is working fine but I am finding a few flaws the docs are now going in the right place but I do have an empty structure in the pkg.tar as the rm only removes the final bit of the path. Does this matter?
Also I end up creating gnubg-000000-1-$arch.pkg.tar.gz again does this matter?
My real question is this OK if so I'll put it on aur or can anyone suggest a better way please?
Offline
FeatherMonkey wrote:On making this PKGBUILD I got to the point where I needed to specify the version.
Ideally I'd of done this with as the title `date +%Y%m%d`, but the wiki says not to, so my question is how should I write/do this?
Exactly how you have done: just by setting the date "manually"
^ dtw already clarified this. ^
Don't upload a 'dynamic' PKGBUILD like this to the AUR. It's a hack.
Set a static pkgver, and bump it occasionally if you want the version in the AUR to keep up-to-date.
Offline
OK thanks Cerebral was why I wanted clarification wasn't to keen myself didn't feel quite right.
Take it the original_PKGBUILD would be OK then?
Also the slight amount of junk left behind i.e. a empty $startdir/pkg$startdir/pkg/usr/share/gnubg/ in the pkg.tar.gz which I can shrink to $startdir/pkg$startdir is this something I can/should clean up better?
If it's fine I'll upload it to aur.
Edit correction how can I clean it up better?
Last edited by FeatherMonkey (2007-12-06 14:24:08)
Offline
Hm - aside from needing to set the pkgver and md5sums, it looks OK. If you feel adventurous, dive into the Makefile (or autoconf makefile inputs, like Makefile.in or Makefile.am) and try to figure out why it's installing documents to that dumb place, then patch it - that would be the cleanest way to fix that.
In fact, let me take a look in the tarball and see if I can figure out a patch for you.
Offline
Thankyou Cerebral took me a while to figure I needed the automake --add-missing for something don't really get these automake tools at all.
I have briefly look but its a little Chinese to my little brain, I did notice the docs folder does have those files and did look but wasn't sure what I needed to change.
Offline
Looking briefly at the configure options, have you tried --datadir=/usr/share in the ./configure line? I can't find anything else that would install to that dir, which is wierd. I'll have to take a closer look at home after work.
Offline
Phew i tried a few things why I have the --docdir=/usr still not that did it though.
I'll have a go with your suggestion see if that helps. I think its one of the make file bits in docs but not sure, wondering whether I need cd in and run one of the automake tools.
To my limited experience its like its taken the make bits from the top structure and then added them again, which is why my presumption its in docs.
Offline
Ok nope that didn't affect it. I'll have to wait for you its beyond me I'll keep looking in the mean time though.
Hopefully by the end of it at least I'll have a better understanding of these make tools.
Offline
aha! I think I've found the problem in the doc dir, like you thought. Try applying this patch (http://www.archlinux.org/~travis/src/gn … file.patch) just before running autoreconf with this line:
patch -Np1 -i $startdir/src/Makefile.patch
(be sure to add the patch to your sources array)
Last edited by Cerebral (2007-12-06 14:54:43)
Offline
Ok so close but I'm still just missing it this is going through the motions ok seems to be getting there but i have one little slip up that I just can't solve.
I know what the problem is but not how to solve it,
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh $startdir/src/gnubg/install-sh -d /usr/share/gnubg/doc/images
mkdir: cannot create directory `/usr/share/gnubg': Permission denied
make[2]: *** [install-data-local] Error 1
Which is correct my user can't mkdir there but it shouldn't be there either I've tried my hardest to work out where its being called from so I could adjust it to
/bin/sh $startdir/src/gnubg/install-sh -d $startdir/pkg/usr/share/gnubg/doc/images but alas my skills are too meagre
Edit
Thankyou for the assistance.
Last edited by FeatherMonkey (2007-12-06 16:21:46)
Offline
Was that error happening before the patch, or only after it?
Offline
Only after before the patch it'll work fine with the mv. I filled in the $startdir the actually error message is the whole path.
I have to admit I have posted it to aur with the mv but it seems horribly hackish to me.
Offline
Feathermonkey,
I was able to install and run this package using Cerebral's patch with the following PKGBUILD:
pkgname=gnubg
pkgver=20071127
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686 x86_64)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=('xorg-server' 'libpng' 'python' 'gtk2' 'libxml2' 'libpng' 'esd' 'freetype2')
source=(http://www.gnubg.org/media/sources/$pkgname-source-SNAPSHOT-$pkgver.tar.gz
Makefile.patch)
md5sums=('76ed0e2faa709f17fd86ac2229059556'
'cb36fb1f291027678f8234150b1c5178' )
build() {
cd $startdir/src/$pkgname
patch -Np1 -i $startdir/src/Makefile.patch
./autogen.sh || return 1
./configure --prefix=/usr --datadir=/usr/share --bindir=/usr/bin --sysconfdir=/etc --mandir=/usr/man || return 1
make || return 1
make install DESTDIR=$startdir/pkg || return 1
}
Some of my configure options may not be needed, but they work. I hope this can be of some use to you.
Last edited by Jason5876 (2007-12-06 17:16:17)
Offline
Well if it works good I'll repost the package, I'll test it now.
I need some more info on these build tools I think... Think I need to spend a good day googling them all.
Offline
damn doesn't work with the newer versions.
Same error as my PKGBUILD with patch.
Offline
My package installed, but /usr/share/gnubg/doc is created outside of the package, in the system root directory instead. I think that is the same thing you are seeing, but since I am running as root the directory gets created instead of giving an error. It of course made me unable to upgrade the package due to file conflicts.
Offline
Well I've posted the pkgbuild on aur I'll try to work this out but I got a steep a learning curve something else is going to need patching just not sure what yet.
Its only a minor inconvenience it works with mv a little hackish too but it does keep the docs in the pkg.tar.
Offline
My package installed, but /usr/share/gnubg/doc is created outside of the package, in the system root directory instead. I think that is the same thing you are seeing, but since I am running as root the directory gets created instead of giving an error. It of course made me unable to upgrade the package due to file conflicts.
Yeah - in general you really shouldn't be building packages as root - it's the same issue, and it's a _real_ issue, but since you're root you never notice and your filesystem gets secretly modified.
I'll take a closer look at home I suppose, and see if I can tweak the patch.
Offline
I think I figured out what else needed to be changed in the makefiles now that I am not building packages as root (thanks for the tip), so here is a patch:
http://74.237.17.82/arch/gnubg/Makefile.patch
And here is a PKGBUILD:
pkgname=gnubg
pkgver=20071127
pkgrel=1
pkgdesc="BackGammon Frontend and Backend far better than Kde BackGammon."
arch=(i686 x86_64)
url="http://www.gnubg.org"
license=('GPL')
replaces=()
depends=('xorg-server' 'libpng' 'python' 'gtk2' 'libxml2' 'libpng' 'esd' 'freetype2')
source=(http://www.gnubg.org/media/sources/$pkgname-source-SNAPSHOT-$pkgver.tar.gz
Makefile.patch)
md5sums=('76ed0e2faa709f17fd86ac2229059556'
'efa6e20f290bffcb9470bb207db25e2d' )
build() {
cd $startdir/src/$pkgname
patch -Np1 -i $startdir/src/Makefile.patch
./autogen.sh || return 1
./configure --prefix=/usr --bindir=/usr/bin --sysconfdir=/etc --mandir=/usr/man || return 1
make || return 1
make install DESTDIR=$startdir/pkg || return 1
}
Last edited by Jason5876 (2007-12-07 01:24:03)
Offline