You are not logged in.

#1 2010-03-05 10:27:21

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Dealing with weird versioning

Hi,

I'm making a PKGBUILD for EiffelStudio, a IDE for the Eiffel language. Everything works fine so far, however the versioning scheme and package URL are kind of weird. For example, the current version of the tarball is called "Eiffel66_gpl_82484-linux-x86-64.tar.bz2". This actually stands for "EiffelStudio version 6.6 build 82484", which can be deduced from the download link in the PKGBUILD provided below. Now, should I name the package "eiffel66" with version number 82484 or name it "eiffel" version 6.6.82484 and somehow find a way to derive the tarball's name from that? If so, how would I go about doing that? Can I use sed directly in the "source=()" tag?
Also, how can I match the required dependency versions with the ones provided by arch? The website states that EiffelStudio needs glibc>=2.3 and gtk+>=2.4, but my up-to-date system says I have glibc-2.11.1-1 and gtk2-2.18.7-1 installed. I have a feeling that the versioning scheme is somehow different here, as everything works just fine when installed.

# Contributor: Your Name <youremail@domain.com>
pkgname=eiffel66
pkgver=82484
pkgrel=1
pkgdesc="EiffelStudio Integrated Development Environment"
arch=('i686' 'x86_64')
[ $CARCH = 'x86_64' ] && _arch='x86-64'
[ $CARCH = 'i686' ]   && _arch='x86'
url="http://dev.eiffel.com/Main_Page"
license=('GPL')
groups=()
depends=('glibc>=2.11.0' 'gtk2>=2.18.0')
makedepends=('cpio')
provides=()
conflicts=()
replaces=()
backup=()
install=
source=("http://heanet.dl.sourceforge.net/project/eiffelstudio/EiffelStudio 6.6 (devel)/Build_$pkgver/Eiffel66_gpl_$pkgver-linux-$_arch.tar.bz2")
noextract=()
[ $CARCH = 'x86_64' ] && md5sums=('87e618ed718a6440c5a44dab98586cec')
[ $CARCH = 'i686' ]   && md5sums=('70e39254a78e47725b347e54ee39d10b')

build() {
  cd "$srcdir/Eiffel66"

  mkdir -p $pkgdir/opt/$pkgname
  mkdir -p $pkgdir/usr/bin

  cat > $pkgdir/usr/bin/estudio << _EOF
#!/bin/sh
export ISE_EIFFEL=/opt/$pkgname
export ISE_PLATFORM=linux-$_arch
export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
/opt/$pkgname/studio/spec/linux-$_arch/bin/estudio
_EOF
  chmod 755 $pkgdir/usr/bin/estudio

  export ISE_EIFFEL=$srcdir/Eiffel66
  export ISE_PLATFORM=linux-$_arch
  export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
  yes | ./make_install || return 1

  find . | cpio -p -dum $pkgdir/opt/$pkgname || return 1
}

Offline

#2 2010-03-05 19:45:25

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

Re: Dealing with weird versioning

Use:
pkgver=6.6.82484

in the source use:
${pkgver##*.}
to get the build number.

Offline

#3 2010-03-05 20:29:39

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Dealing with weird versioning

tkdfighter wrote:

The website states that EiffelStudio needs glibc>=2.3 and gtk+>=2.4, but my up-to-date system says I have glibc-2.11.1-1 and gtk2-2.18.7-1 installed.

you should put your depends() back to what the website stated.  glibc 2.11 is in fact >= 2.3 and gtk2 2.18 is in fact >= 2.4 so the as-stated website deps are satisfied by the arch versions.

Offline

#4 2010-03-06 15:20:46

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: Dealing with weird versioning

@Snowman: thanks for pointing out that it's possible to do RE directly in bash. That's pretty neat, but I'll have to play around with it a bit more.
@brisbin33: Now I'm embarrassed smile  3 is definitively less or equal to 11. That's one brainfart I'll try to avoid in future.

Here's the latest revision, in case anyone want's to try this out. I'm not quite happy with it yet, but I'm getting there.

# Contributor: Your Name <youremail@domain.com>
pkgname=eiffel
pkgver=66.82484
pkgrel=1
pkgdesc="EiffelStudio Integrated Development Environment"
arch=('i686' 'x86_64')
[ $CARCH = 'x86_64' ] && _arch='x86-64'
[ $CARCH = 'i686' ]   && _arch='x86'
url="http://dev.eiffel.com/Main_Page"
license=('GPL')
groups=()
depends=('glibc>=2.3' 'gtk2>=2.4')
makedepends=('cpio')
provides=()
conflicts=()
replaces=()
backup=()
install=
source=("http://heanet.dl.sourceforge.net/project/eiffelstudio/EiffelStudio 6.6 (devel)/Build_${pkgver##*.}/${pkgname^e}${pkgver%.*}_gpl_${pkgver##*.}-linux-$_arch.tar.bz2")
noextract=()
[ $CARCH = 'x86_64' ] && md5sums=('87e618ed718a6440c5a44dab98586cec')
[ $CARCH = 'i686' ]   && md5sums=('70e39254a78e47725b347e54ee39d10b')

build() {
  cd "$srcdir/${pkgname^e}${pkgver%.*}"

  mkdir -p $pkgdir/opt/$pkgname                                                                                                                                                                                  
  mkdir -p $pkgdir/usr/bin                                                                                                                                                                                       
                                                                                                                                                                                                                 
  cat > $pkgdir/usr/bin/estudio << _EOF                                                                                                                                                                          
#!/bin/sh
export ISE_EIFFEL=/opt/$pkgname
export ISE_PLATFORM=linux-$_arch
export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
/opt/$pkgname/studio/spec/linux-$_arch/bin/estudio
_EOF
  chmod 755 $pkgdir/usr/bin/estudio

  export ISE_EIFFEL=$srcdir/${pkgname^e}${pkgver%.*}
  export ISE_PLATFORM=linux-$_arch
  export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
  yes | ./make_install || return 1

  find . | cpio -p -dum $pkgdir/opt/$pkgname || return 1
}

Offline

#5 2010-03-06 19:13:19

FrozenFox
Member
From: College Station, TX
Registered: 2008-03-23
Posts: 422
Website

Re: Dealing with weird versioning

My suggestions:

You should put the script there into it's own file (and remove references to makepkg/pacman-specific variables of course.. unless you want to fix them with sed or something at install time, which is more complicated than it needs to be imo) referenced by the source and md5sum lines, then replace the chmod line with a line for the "install" command which installs said file into the corresponding location in $pkgdir.

I'm not sure, but I think it would be something along the lines of

install -m755 -D $srcdir/estudio $pkgdir/usr/bin/estudio

The mkdir lines prior to that could also be replaced with install equivalents (edit: the above line would render the second 'mkdir' command unnecessary, as the -D on install would make leading dirs iirc.. an install -d could make the other needed folder/folders). There was a reason for doing this I read before that would be better in some unlikely scenarios, but I don't remember what it was, so take that with a grain of salt.

Also, you're missing parentheses after the install= line.

Last edited by FrozenFox (2010-03-06 19:30:55)

Offline

Board footer

Powered by FluxBB