summaryrefslogtreecommitdiff
path: root/extra/nspr/PKGBUILD
blob: d57d1f83345945542c015b6157a093da6f1a7b56 (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
54
55
56
57
58
59
60
61
62
63
# $Id: PKGBUILD 151239 2012-02-25 09:44:23Z ibiru $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
pkgname=nspr
pkgver=4.9
pkgrel=1
pkgdesc="Netscape Portable Runtime"
arch=(i686 x86_64 'mips64el')
url="http://www.mozilla.org/projects/nspr/"
license=('MPL' 'GPL')
depends=('glibc')
makedepends=('zip')
options=(!emptydirs)
source=(ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${pkgver}/src/${pkgname}-${pkgver}.tar.gz
        nspr.pc.in)
md5sums=('aa0c960b23a9d66a3c30c3e6ba80a99a'
         'bce1611f3117b53fc904cab549c09967')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  if [ "$CARCH" = "x86_64" ]; then
    confflags="--enable-64bit"
  else
    confflags=""
  fi

  sed -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
      -i mozilla/nsprpub/config/rules.mk

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

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  NSPR_LIBS=`./config/nspr-config --libs`
  NSPR_CFLAGS=`./config/nspr-config --cflags`
  NSPR_VERSION=`./config/nspr-config --version`
  install -m755 -d "${pkgdir}/usr/lib/pkgconfig"
  sed "${srcdir}/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}," > "${pkgdir}/usr/lib/pkgconfig/nspr.pc"
  chmod 644 "${pkgdir}/usr/lib/pkgconfig/nspr.pc"
  ln -sf nspr.pc "${pkgdir}/usr/lib/pkgconfig/mozilla-nspr.pc"

  chmod 644 ${pkgdir}/usr/lib/*.a

  rm -rf "${pkgdir}/usr/bin/compile-et.pl" \
	"${pkgdir}/usr/bin/prerr.properties" \
	"${pkgdir}/usr/share/aclocal/nspr.m4" \
	"${pkgdir}/usr/include/nspr/md"
}