From e5bdaa7d8a0d0c51d131c8ba2dd7c82b95d8c827 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 5 Nov 2012 13:23:09 -0800 Subject: [PATCH] add packaging --- packaging/baselibs.conf | 1 + packaging/nspr.spec | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 packaging/baselibs.conf create mode 100644 packaging/nspr.spec 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 -- 2.7.4