commit 591899afb56a8e2d40ec714120b79cb8345af588 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:10:02 2019 -0400 Package init diff --git a/6000-Bug-1525173-prbith-should-use-builtin-function-on-aarch64.patch b/6000-Bug-1525173-prbith-should-use-builtin-function-on-aarch64.patch new file mode 100644 index 0000000..da001e3 --- /dev/null +++ b/6000-Bug-1525173-prbith-should-use-builtin-function-on-aarch64.patch @@ -0,0 +1,38 @@ +# HG changeset patch +# User Makoto Kato +# Date 1549579831 25200 +# Thu Feb 07 15:50:31 2019 -0700 +# Node ID 753fe0f7964c3faef5e4410ed7e0c965df7b180b +# Parent 5f4fed68d661de81638c8e1f108aff075a33d46e +diff --git a/pr/include/prbit.h b/pr/include/prbit.h +--- a/nspr/pr/include/prbit.h ++++ b/nspr/pr/include/prbit.h +@@ -14,7 +14,8 @@ + ** functions. + */ + #if defined(_WIN32) && (_MSC_VER >= 1300) && \ +- (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM)) ++ (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \ ++ defined(_M_ARM64)) + # include + # pragma intrinsic(_BitScanForward,_BitScanReverse) + __forceinline static int __prBitScanForward32(unsigned int val) +@@ -33,7 +34,8 @@ + # define pr_bitscan_clz32(val) __prBitScanReverse32(val) + # define PR_HAVE_BUILTIN_BITSCAN32 + #elif ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \ +- (defined(__i386__) || defined(__x86_64__) || defined(__arm__)) ++ (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ ++ defined(__aarch64__)) + # define pr_bitscan_ctz32(val) __builtin_ctz(val) + # define pr_bitscan_clz32(val) __builtin_clz(val) + # define PR_HAVE_BUILTIN_BITSCAN32 +@@ -136,7 +138,7 @@ + */ + + #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \ +- defined(_M_X64) || defined(_M_ARM)) ++ defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)) + #include + #pragma intrinsic(_rotl, _rotr) + #define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits) diff --git a/nspr-4.20.tar.gz b/nspr-4.20.tar.gz new file mode 100644 index 0000000..eb4758a Binary files /dev/null and b/nspr-4.20.tar.gz differ diff --git a/nspr-config-pc.patch b/nspr-config-pc.patch new file mode 100644 index 0000000..482b141 --- /dev/null +++ b/nspr-config-pc.patch @@ -0,0 +1,37 @@ +diff -up a/nspr/config/nspr-config.in.flags b/nspr/config/nspr-config.in +--- a/nspr/config/nspr-config.in.flags 2013-05-29 13:46:34.147971410 -0700 ++++ b/nspr/config/nspr-config.in 2013-05-29 14:17:10.990838914 -0700 +@@ -102,7 +102,7 @@ if test -z "$includedir"; then + includedir=@includedir@ + fi + if test -z "$libdir"; then +- libdir=@libdir@ ++ libdir=`pkg-config --variable=libdir nspr` + fi + + if test "$echo_prefix" = "yes"; then +@@ -136,12 +136,12 @@ if test "$echo_libs" = "yes"; then + if test -n "$lib_nspr"; then + libdirs="$libdirs -lnspr${major_version}" + fi +- os_ldflags="@LDFLAGS@" ++ os_ldflags=`pkg-config --variable=ldflags nspr` + for i in $os_ldflags ; do + if echo $i | grep \^-L >/dev/null; then + libdirs="$libdirs $i" + fi + done +- echo $libdirs @OS_LIBS@ ++ echo $libdirs `pkg-config --variable=os_libs nspr` + fi + +diff -up a/nspr/config/nspr.pc.in.flags b/nspr/config/nspr.pc.in +--- a/nspr/config/nspr.pc.in.flags 2013-05-29 13:48:15.026643570 -0700 ++++ b/nspr/config/nspr.pc.in 2013-05-29 13:49:47.795202949 -0700 +@@ -6,5 +6,5 @@ includedir=@includedir@ + Name: NSPR + Description: The Netscape Portable Runtime + Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@ +-Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ ++Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@ + Cflags: -I@includedir@ diff --git a/nspr-config.xml b/nspr-config.xml new file mode 100644 index 0000000..9e3f99c --- /dev/null +++ b/nspr-config.xml @@ -0,0 +1,127 @@ + + + +]> + + + + + &date; + Netscape Portable Runtime + nspr + &version; + + + + nspr-config + 1 + + + + nspr-config + Return meta information about nspr libraries + + + + + nspr-config + + + + + + + + + + + + Description + nspr-config is a shell script which can be used to obtain gcc options for building client pacakges of nspr. + + + + Options + + + + + Returns the top level system directory under which the nspr libraries are installed. + + + + + Returns the top level system directory under which any nspr binaries would be installed. + + + + count + Returns the path to the directory were the nspr headers are installed. + + + + + Returns the upstream version of nspr in the form major_version-minor_version-patch_version. + + + + + Returns the compiler linking flags. + + + + + Returns the compiler include flags. + + + + + Returns the path to the directory were the nspr libraries are installed. + + + + + + + Examples + + The following example will query for both include path and linkage flags: + + /usr/bin/nspr-config --cflags --libs + + + + + + + + Files + + /usr/bin/nspr-config + + + + + See also + pkg-config(1) + + + + Authors + The NSPR liraries were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google. + + Authors: Elio Maldonado <emaldona@redhat.com>. + + + + + + LICENSE + Licensed under the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + + + + diff --git a/nspr.spec b/nspr.spec new file mode 100644 index 0000000..8a8167f --- /dev/null +++ b/nspr.spec @@ -0,0 +1,99 @@ +%global nspr_version 4.20 +Name: nspr +Version: 4.20.0 +Release: 2 +Summary: Netscape Portable Runtime +License: MPLv2.0 +URL: http://www.mozilla.org/projects/nspr +BuildRequires: gcc git +Source0: %{name}-%{nspr_version}.tar.gz +Source1: nspr-config.xml + +Patch1: nspr-config-pc.patch + +Patch6000: 6000-Bug-1525173-prbith-should-use-builtin-function-on-aarch64.patch + +%description +NetScape Portable Runtime (NSPR) provides platform independence for non-GUI +operating system facilities. These facilities include threads, thread +synchronization, normal file and network I/O, interval timing and calendar +time, basic memory management (malloc and free) and shared library linking. + +%package devel +Summary: Development libraries for the Netscape Portable Runtime +BuildRequires: xmlto +Requires: nspr = %{version}-%{release} +Requires: pkgconfig + +%description devel +Development package for nspr. + +%prep +%autosetup -n %{name}-%{nspr_version} -p1 -Sgit +cp ./nspr/config/nspr-config.in ./nspr/config/nspr-config-pc.in + +%build +%define _configure ./nspr/configure +%configure \ + --includedir=%{_includedir}/nspr4 \ + --enable-64bit \ + --enable-optimize="$RPM_OPT_FLAGS" +%make_build +date +"%e %B %Y" | tr -d '\n' > date.xml +echo -n %{version} > version.xml +cp %{SOURCE1} . +xmlto man nspr-config.xml + +%check +perl ./nspr/pr/tests/runtests.pl 2>&1 | tee output.log +TEST_FAILURES=`grep -c FAILED ./output.log` || : +if [ $TEST_FAILURES -ne 0 ]; then + echo "error: test suite returned failure(s)" + exit 1 +fi +echo "test suite completed" + +%install +rm -rf $RPM_BUILD_ROOT +%make_install +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig +NSPR_LIBS=`./config/nspr-config --libs` +NSPR_CFLAGS=`./config/nspr-config --cflags` +NSPR_VERSION=`./config/nspr-config --version` +install -c -m 644 nspr-config.1 $RPM_BUILD_ROOT%{_mandir}/man1/nspr-config.1 + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +%files +%{_libdir}/libnspr4.so +%{_libdir}/libplc4.so +%{_libdir}/libplds4.so +%exclude %{_bindir}/compile-et.pl +%exclude %{_bindir}/prerr.properties +%exclude %{_libdir}/libnspr4.a +%exclude %{_libdir}/libplc4.a +%exclude %{_libdir}/libplds4.a +%exclude %{_datadir}/aclocal/nspr.m4 +%exclude %{_includedir}/nspr4/md +%license nspr/LICENSE + +%files devel +%{_bindir}/nspr-config +%{_libdir}/pkgconfig/nspr.pc +%{_includedir}/nspr4 +%{_mandir}/man*/* + +%changelog +* Fri Apr 19 2019 liusirui - 4.20.0-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:backport patches from https://hg.mozilla.org/projects/nspr + +* Mon Sep 10 2018 openEuler Buildteam - 4.20.0-1 +- Package init