summaryrefslogtreecommitdiffstats
path: root/nspr/Pkgfile
blob: 9c7e02f5c7466bdae4e291fb7b2cdbab67da3d5d (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
# Description: Netscape Portable Runtime library
# URL: http://www.mozilla.org/projects/nspr/
# Maintainer: Fredrik Rinnestam, fredrik at rinnestam dot se
# Packager: thierryn1 at hispeed dot ch

name=nspr
version=4.9
release=1
source=(ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$version/src/$name-$version.tar.gz
        http://nutyx.meticul.eu/files/patchs/$name/$name.pc.in)

build() {
    _ARCH=`uname -m`
    local NSPR_LIBS NSPR_CFLAGS NSPR_VERSION
    [ "`uname -m`" == "x86_64" ] && confflags="--enable-64bit"
    cd $name-$version

    ./mozilla/nsprpub/configure \
        --prefix=/usr \
        --libdir=/usr/lib \
        --includedir=/usr/include/nspr \
        --enable-optimize \
        --disable-debug ${confflags}

    make
    make DESTDIR=$PKG install

    NSPR_LIBS=`./config/nspr-config --libs`
    NSPR_CFLAGS=`./config/nspr-config --cflags`
    NSPR_VERSION=`./config/nspr-config --version`

    install -d $PKG/usr/lib/pkgconfig

    sed $SRC/nspr.pc.in \
        -e "s,@libdir@,/usr/lib," \
        -e "s,@prefix@,/usr," \
        -e "s,@exec_prefix@,/usr/bin," \
        -e "s,@includedir@,/usr/include/nspr," \
        -e "s,@NSPR_VERSION@,$NSPR_VERSION," \
        -e "s,@FULL_NSPR_LIBS@,$NSPR_LIBS," \
        -e "s,@FULL_NSPR_CFLAGS@,$NSPR_CFLAGS," > \
        $PKG/usr/lib/pkgconfig/nspr.pc

    rm $PKG/usr/bin/{compile-et.pl,prerr.properties}
    rm -r $PKG/usr/include/nspr/md
}