summaryrefslogtreecommitdiff
path: root/multilib/lib32-nspr/PKGBUILD
blob: dbb4d43eb0c3828de5c0061394dc99899845be4f (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
# $Id: PKGBUILD 55627 2011-09-16 13:38:37Z bluewind $
# Maintainer : Ionut Biru <ibiru@archlinux.org>

_pkgbasename=nspr
pkgname=lib32-$_pkgbasename
pkgver=4.8.9
pkgrel=1
pkgdesc="Netscape Portable Runtime (32-bit)"
arch=('x86_64')
url="http://www.mozilla.org/projects/nspr/"
license=('MPL' 'GPL')
depends=('lib32-glibc' $_pkgbasename)
makedepends=('zip' 'gcc-multilib')
options=(!emptydirs)
source=(ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${pkgver}/src/${_pkgbasename}-${pkgver}.tar.gz
        nspr.pc.in)
md5sums=('60770d45dc08c0f181b22cdfce5be3e8'
         'bce1611f3117b53fc904cab549c09967')

build() {
  cd "${srcdir}/${_pkgbasename}-${pkgver}"

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

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

  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/lib32," \
  	-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}," > "${srcdir}/nspr.pc"
}

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

  install -m755 -D "${srcdir}/nspr.pc"  "${pkgdir}"/usr/lib32/pkgconfig/nspr.pc
  chmod 644 "${pkgdir}/usr/lib32/pkgconfig/nspr.pc"
  ln -sf nspr.pc "${pkgdir}/usr/lib32/pkgconfig/mozilla-nspr.pc"

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

  rm -rf "${pkgdir}"/usr/{bin,share,include}
}