[packages/nodejs] shared bcond
glen
glen at pld-linux.org
Sat Oct 17 21:03:01 CEST 2015
commit 9ea1462f83d3c91d6158cdf8347877912064a648
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Oct 17 21:35:07 2015 +0300
shared bcond
nodejs.spec | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/nodejs.spec b/nodejs.spec
index 91f1c84..9f918c4 100644
--- a/nodejs.spec
+++ b/nodejs.spec
@@ -1,6 +1,7 @@
#
# Conditional build:
%bcond_without system_v8 # system v8
+%bcond_without shared # build libnode.so shared library
# NOTES:
# - https://nodejs.org/en/download/releases/
@@ -87,7 +88,7 @@ This package contains the documentation for nodejs.
%prep
%setup -q -n node-v%{version}
-%patch1 -p1
+%{?with_shared:%patch1 -p1}
%if %{_lib} == "lib64"
%patch3 -p1
%else
@@ -134,9 +135,11 @@ LDFLAGS="%{rpmldflags}" \
rm -rf $RPM_BUILD_ROOT
%{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_lib}"
+%if %{with shared}
lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
+%endif
echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
@@ -180,16 +183,20 @@ rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with shared}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
+%endif
%files
%defattr(644,root,root,755)
%doc README.md AUTHORS ChangeLog LICENSE
%attr(755,root,root) %{_bindir}/node
%attr(755,root,root) %{_bindir}/nodejs
+%if %{with shared}
%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
%ghost %{_libdir}/libnode.so.10
+%endif
%if "%{_lib}" != "lib"
%dir %{_libdir}/node
%endif
@@ -200,7 +207,9 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(644,root,root,755)
+%if %{with shared}
%{_libdir}/libnode.so
+%endif
%{_includedir}/node
%{_pkgconfigdir}/nodejs.pc
%{_usrsrc}/%{name}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nodejs.git/commitdiff/9ea1462f83d3c91d6158cdf8347877912064a648
More information about the pld-cvs-commit
mailing list