summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9a06ada5d62c1c991732be0fde93bb6525863b02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: Maurizio D'Addona <mauritiusdadd@gmail.com>

_svnname='libsnl'

pkgname=libsnl-svn
pkgver=18
pkgrel=7
pkgdesc="libSNL is a library of routines used for the manipulation of NURBS curves and surfaces."
arch=('i686' 'x86_64')
url="https://libsnl.sourceforge.net/"
license=('GPL2')
provides=('libsnl')
conflicts=('libsnl')
depends=()
makedepends=('subversion')

source=("$_svnname::svn+https://svn.code.sf.net/p/$_svnname/code/trunk")
md5sums=('SKIP')

pkgver() 
{
    cd "$srcdir/$_svnname"
    local ver="$(svnversion)"
    printf "%s" "${ver//[[:alpha:]]}"
}

prepare()
{
    cd "$srcdir/$_svnname/src"
    oldflags="export cflags = -Wall -fPIC -g"
    newflags="export cflags = -Wall -fPIC -O2 -g"
    sed -i -e "s/$oldflags/$newflags/g" ./makefile
}

build() 
{
    cd "$srcdir/$_svnname/src"
    msg "Building..."
    export CXXFLAGS="${CXXFLAGS} -O2"
    export CFLAGS="${CFLAGS} -O2"
    make
    msg2 "Build complete."
}

package()
{
    cd "$srcdir/$_svnname/src"
    msg "Copying files..."
    install -Dm644 libSNL.so.0.2 $pkgdir/usr/lib/libSNL.so.0.2
    ln -s libSNL.so.0.2 $pkgdir/usr/lib/libSNL.so
    install -d $pkgdir/usr/include/libSNL
    cp *.h $pkgdir/usr/include/libSNL
}