2 # Copyright (C) 2019 Lucian Cristian
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
13 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 https
://download.cdn.mozilla.net
/pub
/security
/$(PKG_NAME
)/releases
/NSS_
$(subst .
,_
,$(PKG_VERSION
))_RTM
/src \
16 https
://archive.mozilla.org
/pub
/security
/$(PKG_NAME
)/releases
/NSS_
$(subst .
,_
,$(PKG_VERSION
))_RTM
/src
17 PKG_HASH
:=0a0aeb0cdda65ddcb64f746223df58b150f6803f4bfa1a4e876bbe6f9c4c1561
19 PKG_MAINTAINER
:=Lucian Cristian
<lucian.cristian@gmail.com
>
21 PKG_LICENSE_FILES
:=nss
/COPYING
22 PKG_CPE_ID
:=cpe
:/a
:mozilla
:network_security_services
26 include $(INCLUDE_DIR
)/package.mk
32 TITLE
:=Mozilla
's SSL and TLS implementation
33 URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
34 DEPENDS:=+libpthread +libsqlite3 +nspr
37 define Package/nss-utils
40 TITLE:=Utilities for Mozilla's SSL and TLS implementation
41 URL
:=https
://developer.mozilla.org
/en-US
/docs
/Mozilla
/Projects
/NSS
45 define Package
/libnss
/description
46 Network Security Services
(NSS
) is a set of libraries designed to support
47 cross-platform development of security-enabled client and server applications.
48 Applications built with NSS can support SSL v2 and v3
, TLS
, PKCS
5, PKCS
7,
49 PKCS
11, PKCS
12, S
/MIME
, X
.509 v3 certificates
, and other security standards.
52 CONFIGURE_PATH
= .
/nss
55 LBITS
= $(shell $(TARGET_CC
) -dM
-E
- </dev
/null | grep
-q
"__LP64__" && echo
64 || echo
32)
61 ifeq ($(CONFIG_CPU_TYPE
),"xscale")
62 TARGET_CFLAGS
+= -mfloat-abi
=softfp
65 TARGET_CFLAGS
+= -D_GNU_SOURCE
66 TARGET_LDFLAGS
+= -Wl
,--gc-sections
,--as-needed
68 export CROSS_COMPILE
=1
70 export NATIVE_CC
=$(HOSTCC
)
71 export NATIVE_FLAGS
=$(HOST_CFLAGS
)
72 export NSDISTMODE
=copy
73 export NSS_ENABLE_WERROR
=0
74 export NSS_DISABLE_GTESTS
=1
75 export NSS_USE_SYSTEM_SQLITE
=1
76 export OS_TARGET
=Linux
78 export OS_TEST
=$(ARCH
)
79 export CPU_ARCH
=$(ARCH
)
81 export NSPR_INCLUDE_DIR
=$(STAGING_DIR
)/usr
/include/nspr
82 export SEED_ONLY_DEV_URANDOM
=1
83 export OS_REL_CFLAGS
=$(TARGET_CFLAGS
)
85 export FREEBL_NO_DEPEND
=1
86 #size optimisation, seems to not impact speed
87 export NSS_DISABLE_DBM
=1
88 export NSS_PKIX_NO_LDAP
=1
89 export ALLOW_OPT_CODE_SIZE
=1
90 export OPT_CODE_SIZE
=1
92 #native compile nsinstall
94 $(call Build
/Prepare
/Default
)
95 USE_NATIVE
=1 OS_REL_CFLAGS
="$(HOST_CFLAGS)" LDFLAGS
="$(HOST_LDFLAGS)" CC
="$(HOSTCC)" \
96 $(MAKE
) -C
$(PKG_BUILD_DIR
)/nss
/coreconf
/nsinstall
99 define Package
/libnss
/conffiles
103 define Build
/InstallDev
105 $(1)/usr
/include/nss \
107 $(1)/usr
/lib
/pkgconfig
108 $(CP
) $(PKG_BUILD_DIR
)/dist/private
/nss
/*.h \
109 $(1)/usr
/include/nss
/
110 $(CP
) $(PKG_BUILD_DIR
)/dist/public
/nss
/*.h \
111 $(1)/usr
/include/nss
/
112 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/*.so \
114 $(CP
) $(PKG_BUILD_DIR
)/nss
/config
/*.
pc \
115 $(1)/usr
/lib
/pkgconfig
/
118 define Package
/nss-utils
/install
121 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/bin
/certutil
$(1)/usr
/bin
122 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/bin
/pk12util
$(1)/usr
/bin
125 #for now pack only libreswan needed libs
126 define Package
/libnss
/install
132 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libfreebl3.so
$(1)/usr
/lib
/
133 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libnss3.so
$(1)/usr
/lib
/
134 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libnssckbi.so
$(1)/usr
/lib
/
135 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libnssutil3.so
$(1)/usr
/lib
/
136 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libsmime3.so
$(1)/usr
/lib
/
137 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libsoftokn3.so
$(1)/usr
/lib
/
138 $(CP
) $(PKG_BUILD_DIR
)/dist/build_dir
/lib
/libssl3.so
$(1)/usr
/lib
/
139 # Provide databases with a blank certificate
140 $(CP
) .
/files
/blank-cert9.db
$(1)/etc
/pki
/nssdb
/cert9.db
141 $(CP
) .
/files
/blank-key4.db
$(1)/etc
/pki
/nssdb
/key4.db
142 $(CP
) .
/files
/system-pkcs11.txt
$(1)/etc
/pki
/nssdb
/pkcs11.txt
143 ln
-s
/etc
/pki
/nssdb
/cert9.db
$(1)/etc
/ipsec.d
/cert9.db
144 ln
-s
/etc
/pki
/nssdb
/key4.db
$(1)/etc
/ipsec.d
/key4.db
145 ln
-s
/etc
/pki
/nssdb
/pkcs11.txt
$(1)/etc
/ipsec.d
/pkcs11.txt
148 $(eval
$(call BuildPackage
,nss-utils
))
149 $(eval
$(call BuildPackage
,libnss
))