summaryrefslogtreecommitdiffstats
path: root/abs/extra/nss/PKGBUILD
blob: 4e847616af8db72dfebe315e73e124ecb2f70bfd (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=nss
pkgname=(nss ca-certificates-mozilla)
pkgver=3.33
pkgrel=2
pkgdesc="Network Security Services"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
arch=(i686 x86_64)
license=(MPL GPL)
_nsprver=4.15
depends=("nspr>=${_nsprver}" sqlite zlib sh p11-kit)
makedepends=(perl python2 xmlto docbook-xsl gyp)
options=(!strip !makeflags staticlibs)
source=("https://ftp.mozilla.org/pub/security/nss/releases/NSS_${pkgver//./_}_RTM/src/nss-${pkgver}.tar.gz"
        certdata2pem.py bundle.sh nss.pc.in nss-config.in nss-config.xml enable-libpkix.patch no-plt.diff bug1400603.patch)
sha256sums=('98f0dabd36408e83dd3a11727336cc3cdfee4cbdd9aede2b2831eb2389c284e4'
            '512b12a2f13129be62c008b4df0153f527dd7d71c2c5183de99dfa2a1c49dd8a'
            '3bfadf722da6773bdabdd25bdf78158648043d1b7e57615574f189a88ca865dd'
            'f2208c4f70373ff9b60f53d733f8071d4e390c384b776dfc04bf26c306882faf'
            'e44ac5095b4d88f24ec7b2e6a9f1581560bd3ad41a3d198596d67ef22f67adb9'
            '98ace873c63e8e870286bce3ed53249aa2655cc1f53e7049061476e650ab06f1'
            '0b68c5ffbfeec090e950e5703e6b0519eafcb7eaf4fe2f64c355d0ddf17eed30'
            'ea8e1b871c0f1dd29cdea1b1a2e7f47bf4713e2ae7b947ec832dba7dfcc67daa'
            'c2a477710a53738e91712a7a203b84d65a514af62d8efffaa977070843a7794a')

prepare() {
  mkdir certs path

  ln -s /usr/bin/python2 path/python

  echo -n "$(date +"%e %B %Y")" >date.xml
  echo -n "$pkgver" >version.xml
  xmlto man nss-config.xml

  cd nss-$pkgver

  patch -Np1 -i ../enable-libpkix.patch
  patch -Np2 -i ../no-plt.diff

  ln -sr nss/lib/ckfw/builtins/certdata.txt ../certs/
  ln -sr nss/lib/ckfw/builtins/nssckbi.h ../certs/

  cd nss
  patch -Np0 -i ../../bug1400603.patch
}

build() {
  cd certs
  python2 ../certdata2pem.py

  cd ..
  sh bundle.sh

  cd nss-$pkgver/nss
  PATH="$srcdir/path:$PATH" bash -x ./build.sh -v \
    --opt --system-sqlite --system-nspr --disable-tests
}

package_nss() {
  cd nss-$pkgver

  { read _vmajor; read _vminor; read _vpatch; } \
    < <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)

  sed ../nss.pc.in \
    -e "s,%libdir%,/usr/lib,g" \
    -e "s,%prefix%,/usr,g" \
    -e "s,%exec_prefix%,/usr/bin,g" \
    -e "s,%includedir%,/usr/include/nss,g" \
    -e "s,%NSPR_VERSION%,${_nsprver},g" \
    -e "s,%NSS_VERSION%,${pkgver},g" |
    install -Dm644 /dev/stdin "$pkgdir/usr/lib/pkgconfig/nss.pc"
  ln -s nss.pc "$pkgdir/usr/lib/pkgconfig/mozilla-nss.pc"

  sed ../nss-config.in \
    -e "s,@libdir@,/usr/lib,g" \
    -e "s,@prefix@,/usr/bin,g" \
    -e "s,@exec_prefix@,/usr/bin,g" \
    -e "s,@includedir@,/usr/include/nss,g" \
    -e "s,@MOD_MAJOR_VERSION@,${_vmajor},g" \
    -e "s,@MOD_MINOR_VERSION@,${_vminor},g" \
    -e "s,@MOD_PATCH_VERSION@,${_vpatch},g" |
    install -D /dev/stdin "$pkgdir/usr/bin/nss-config"
  install -Dt "$pkgdir/usr/share/man/man1" -m644 ../nss-config.1

  cd nss/doc/nroff
  install -Dt "$pkgdir/usr/share/man/man1" -m644 *util.1 signtool.1 signver.1 ssltap.1

  cd ../../../dist
  install -Dt "$pkgdir/usr/include/nss" -m644 public/nss/*.h

  cd Release/bin
  install -Dt "$pkgdir/usr/bin" *util shlibsign signtool signver ssltap

  cd ../lib
  install -Dt "$pkgdir/usr/lib" *.so
  install -Dt "$pkgdir/usr/lib" -m644 *.chk

  ln -sf libnssckbi-p11-kit.so "$pkgdir/usr/lib/libnssckbi.so"
}

package_ca-certificates-mozilla() {
  pkgdesc="Mozilla's set of trusted CA certificates"
  depends=(ca-certificates-utils)

  install -Dm644 ca-bundle.trust.p11-kit \
    "$pkgdir/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit"
}