summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-05 13:23:09 -0800
committerJohn L. Whiteman <john.l.whiteman@intel.com>2014-08-21 10:17:57 -0700
commite5bdaa7d8a0d0c51d131c8ba2dd7c82b95d8c827 (patch)
treec6f3f918e0c763e1fde28fd255c76f6690d47622
parentf9838f54c68ea3f4c3da75d8056e2a0c75d95b1a (diff)
downloadnspr-e5bdaa7d8a0d0c51d131c8ba2dd7c82b95d8c827.tar.gz
nspr-e5bdaa7d8a0d0c51d131c8ba2dd7c82b95d8c827.tar.bz2
nspr-e5bdaa7d8a0d0c51d131c8ba2dd7c82b95d8c827.zip
add packaging
-rw-r--r--packaging/baselibs.conf1
-rw-r--r--packaging/nspr.spec92
2 files changed, 93 insertions, 0 deletions
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644
index 0000000..2e04bc3
--- /dev/null
+++ b/packaging/baselibs.conf
@@ -0,0 +1 @@
+mozilla-nspr
diff --git a/packaging/nspr.spec b/packaging/nspr.spec
new file mode 100644
index 0000000..8a32afe
--- /dev/null
+++ b/packaging/nspr.spec
@@ -0,0 +1,92 @@
+Name: nspr
+Version: 4.9.2
+Release: 0
+License: MPL-2.0
+Summary: Netscape Portable Runtime
+Url: http://www.mozilla.org/projects/nspr/
+Group: System/Libraries
+Source: ftp://ftp.mozilla.org/pub/nspr/releases/v%{version}/src/nspr-%{version}.tar.bz2
+Source1: baselibs.conf
+BuildRequires: gcc-c++
+BuildRequires: pkg-config
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%description
+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: Netscape Portable Runtime development files
+Group: Development/Libraries/Other
+Requires: nspr = %{version}
+
+%description devel
+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.
+
+%prep
+%setup -n nspr-%{version} -q
+cd mozilla
+
+%build
+# set buildtime to "last-modification-time"
+modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
+BUILD_STRING="$(date -u -d "${modified}" "+%%F %%T")"
+BUILD_TIME="$(date -u -d "${modified}" "+%%s000000")"
+#
+cd mozilla/nsprpub
+export CFLAGS="%{optflags}"
+./configure --enable-optimize="$CFLAGS" \
+ --disable-debug \
+%ifarch x86_64
+ --enable-64bit \
+%endif
+ --libdir=%{_libdir} \
+ --includedir=%{_includedir}/nspr4 \
+ --prefix=%{_prefix}
+make SH_DATE="$BUILD_STRING" SH_NOW="$BUILD_TIME" %{?_smp_mflags}
+%check
+# Run test suite
+perl ./mozilla/nsprpub/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
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{_libdir}/nspr
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+mkdir -p %{buildroot}%{_includedir}/nspr4
+cp mozilla/nsprpub/config/nspr-config %{buildroot}%{_bindir}/
+cp mozilla/nsprpub/config/nspr.pc %{buildroot}%{_libdir}/pkgconfig
+cp -L mozilla/nsprpub/dist/lib/*.so %{buildroot}%{_libdir}
+cp -L mozilla/nsprpub/dist/lib/*.a %{buildroot}%{_libdir}/nspr/
+cp -rL mozilla/nsprpub/dist/include/nspr/* %{buildroot}%{_includedir}/nspr4/
+# #31667
+chmod -x %{buildroot}%{_includedir}/nspr4/prvrsion.h
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-, root, root)
+%{_libdir}/*.so
+
+%files devel
+%defattr(-, root, root)
+%{_bindir}/nspr-config
+%{_libdir}/pkgconfig/nspr.pc
+%{_includedir}/nspr4/
+%exclude %{_includedir}/nspr4/md/*
+%{_libdir}/nspr/
+
+%changelog