[nodejs-nan] support coexistence with nodejs-nan0

T.C. Hollingsworth patches at fedoraproject.org
Sun May 25 03:59:47 UTC 2014


commit ae48cc0901f1b3618c7ab5dcc96182b3e7565e3d
Author: T.C. Hollingsworth <tchollingsworth at gmail.com>
Date:   Sat May 24 20:55:10 2014 -0700

    support coexistence with nodejs-nan0

 nodejs-nan.spec |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/nodejs-nan.spec b/nodejs-nan.spec
index e6308ce..339b38d 100644
--- a/nodejs-nan.spec
+++ b/nodejs-nan.spec
@@ -5,7 +5,7 @@
 Summary:       Native Abstractions for Node.js 
 Name:          nodejs-%{npm_name}
 Version:       1.0.0
-Release:       1%{?dist}
+Release:       2%{?dist}
 Group:         Development/Languages
 License:       MIT
 URL:           http://github.com/rvagg/nan
@@ -35,14 +35,37 @@ NODE_MODULE_VERSION and get yourself into a macro-tangle.
 %build
 
 %install
-mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}
-cp -pr include_dirs.js nan.h package.json  %{buildroot}%{nodejs_sitelib}/%{npm_name}
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}@1
+cp -pr include_dirs.js nan.h package.json  %{buildroot}%{nodejs_sitelib}/%{npm_name}@1
+
+ln -sf nodejs-nan at 1 %{buildroot}%{nodejs_sitelib}/%{npm_name}
 
 %files
 %doc LICENSE README.md
 %{nodejs_sitelib}/%{npm_name}
+%{nodejs_sitelib}/%{npm_name}@1
+
+%pretrans -p <lua>
+-- Define the path to directory being replaced below.
+-- DO NOT add a trailing slash at the end.
+path = "%{nodejs_sitelib}/%{npm_name}"
+st = posix.stat(path)
+if st and st.type == "directory" then
+  status = os.rename(path, path .. ".rpmmoved")
+  if not status then
+    suffix = 0
+    while not status do
+      suffix = suffix + 1
+      status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
+    end
+    os.rename(path, path .. ".rpmmoved")
+  end
+end
 
 %changelog
+* Sun May 25 2014 T.C. Hollingsworth <tchollingsworth at gmail.com> - 1.0.0-2
+- support coexistence with nodejs-nan0
+
 * Fri May 09 2014 Troy Dawson <tdawson at redhat.com> - 1.0.0-1
 - Update to version 1.0.0
 


More information about the scm-commits mailing list