Hello community,

here is the log from the commit of package nodejs-packaging for 
openSUSE:Factory checked in at 2015-07-08 06:59:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-packaging (Old)
 and      /work/SRC/openSUSE:Factory/.nodejs-packaging.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nodejs-packaging"

Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-packaging/nodejs-packaging.changes        
2015-02-16 21:14:25.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.nodejs-packaging.new/nodejs-packaging.changes   
2015-07-08 06:59:30.000000000 +0200
@@ -1,0 +2,11 @@
+Sat Jul  4 16:33:33 UTC 2015 - [email protected]
+
+- update version 7
+- set fedora scm as its upstream url
+- no conditional source
+  * add patch: nodejs-packaging-compat-opensuse-pre1320.patch
+  * add patch: nodejs-packaging-compat-opensuse.patch
+  * drop patch: nodejs-packaging-pre1320-macros.patch
+- rename the macros file only on specific version of openSUSE
+
+-------------------------------------------------------------------

Old:
----
  nodejs-packaging-pre1320-macros.patch
  nodejs-packaging-pre1320.tar.bz2
  nodejs-packaging.tar.xz

New:
----
  nodejs-packaging-compat-opensuse-pre1320.patch
  nodejs-packaging-compat-opensuse.patch
  nodejs-packaging-fedora-7.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nodejs-packaging.spec ++++++
--- /var/tmp/diff_new_pack.9dXnhn/_old  2015-07-08 06:59:30.000000000 +0200
+++ /var/tmp/diff_new_pack.9dXnhn/_new  2015-07-08 06:59:30.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package nodejs-packaging
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,15 @@
 
 
 Name:           nodejs-packaging
-Version:        1
+Version:        7
 Release:        0
 Summary:        RPM Macros and Utilities for Node.js Packaging
 License:        MIT
 Group:          Development/Languages/Other
-Url:            http://www.nodejs.org
-Source0:        nodejs-packaging.tar.xz
-Source1:        nodejs-packaging-pre1320.tar.bz2
-Patch0:         nodejs-packaging-pre1320-macros.patch
+Url:            http://pkgs.fedoraproject.org/cgit/nodejs-packaging.git
+Source:         
https://fedorahosted.org/released/%{name}/%{name}-fedora-%{version}.tar.xz
+Patch:          %{name}-compat-opensuse.patch
+Patch1:         %{name}-compat-opensuse-pre1320.patch
 BuildArch:      noarch
 Requires:       nodejs
 Requires:       python
@@ -35,20 +35,25 @@
 RPM macros and support scripts for packaging Node.js modules.
 
 %prep
+%setup -q -n %{name}-fedora-%{version}
 %if 0%{?suse_version} >= 1320
-%setup -q -n %{name}
+%patch -p1
 %else
 %define         _rpmconfigdir %{_prefix}/lib/rpm
-%setup -q -T -b 1 -n %{name}
+%patch1 -p1
 %endif
-%patch0
 
 %build
 %install
 mkdir -p %{buildroot}%{_sysconfdir}/rpm
 mkdir -p %{buildroot}%{_rpmconfigdir}
 mkdir -p %{buildroot}%{_datadir}/node
+# 13.2's nodejs-devel package has a /etc/rpm/macros.nodejs
+%if 0%{?suse_version} == 1320
 install -m0644 macros.nodejs %{buildroot}%{_sysconfdir}/rpm/macros.%{name}
+%else
+install -m0644 macros.nodejs %{buildroot}%{_sysconfdir}/rpm/macros.nodejs
+%endif
 %if 0%{?suse_version} >= 1320
 mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs
 install -m0644 nodejs.attr %{buildroot}%{_rpmconfigdir}/fileattrs/nodejs.attr
@@ -61,13 +66,17 @@
 
 %files
 %defattr(-,root,root)
+%doc LICENSE
+%if 0%{?suse_version} == 1320
 %config %{_sysconfdir}/rpm/macros.%{name}
+%else
+%config %{_sysconfdir}/rpm/macros.nodejs
+%endif
 %if 0%{?suse_version} >= 1320
 %{_rpmconfigdir}/fileattrs/nodejs*.attr
 %endif
 %{_rpmconfigdir}/nodejs*
 %dir %{_datadir}/node
 %{_datadir}/node/multiver_modules
-%doc LICENSE
 
 %changelog

++++++ nodejs-packaging-compat-opensuse-pre1320.patch ++++++
diff -urN nodejs-packaging-fedora-7/macros.nodejs nodejs-packaging/macros.nodejs
--- nodejs-packaging-fedora-7/macros.nodejs     2014-05-25 14:08:21.000000000 
+0800
+++ nodejs-packaging/macros.nodejs      2015-07-05 00:16:26.188133579 +0800
@@ -8,6 +8,16 @@
 #for future-proofing only; we don't do multilib
 %nodejs_sitearch %{nodejs_sitelib}
 
+#compat
+%nodejs_modulesdir %{nodejs_sitelib}
+
+%nodejs_requires \
+Requires:       nodejs
+
+%nodejs_install \
+mkdir -p %{buildroot}%{nodejs_modulesdir} \
+npm_config_prefix=%{buildroot}%{_prefix} npm install -g %{S:0}
+
 # currently installed nodejs version
 %nodejs_version %(%{__nodejs} -v | sed s/v//)
 
@@ -15,19 +25,24 @@
 # this should be run in every module's %%install section
 # pass --check to work in the current directory instead of the buildroot
 # pass --no-devdeps to ignore devDependencies when --check is used
-%nodejs_symlink_deps %{_rpmconfigdir}/nodejs-symlink-deps %{nodejs_sitelib}
+%nodejs_symlink_deps %{_prefix}/lib/rpm/nodejs-symlink-deps %{nodejs_sitelib}
 
 # patch package.json to fix a dependency
 # see `man npm-json` for details on writing dependencies for package.json files
 # e.g. `%%nodejs_fixdep frobber` makes any version of frobber do
 #      `%%nodejs_fixdep frobber '>1.0'` requires frobber > 1.0
 #      `%%nodejs_fixdep -r frobber removes the frobber dep
-%nodejs_fixdep %{_rpmconfigdir}/nodejs-fixdep
+%nodejs_fixdep %{_prefix}/lib/rpm/nodejs-fixdep
 
 # macro to filter unwanted provides from Node.js binary native modules
-%nodejs_default_filter %{expand: \
-%global __provides_exclude_from ^%{nodejs_sitearch}/.*\\.node$
-}
+%nodejs_default_filter %{?filter_setup: %{expand: \
+%filter_provides_in %{nodejs_sitearch}/.*\\.node$ \
+%filter_setup \
+}}
 
-# no-op macro to allow spec compatibility with EPEL
-%nodejs_find_provides_and_requires %{nil}
+# macro to invoke the Node.js provides and requires generators
+%nodejs_find_provides_and_requires %{expand: \
+%global _use_internal_dependency_generator 0
+%global __find_provides %{_prefix}/lib/rpm/nodejs.prov
+%global __find_requires %{_prefix}/lib/rpm/nodejs.req
+}
diff -urN nodejs-packaging-fedora-7/nodejs.attr nodejs-packaging/nodejs.attr
--- nodejs-packaging-fedora-7/nodejs.attr       2014-05-25 14:08:21.000000000 
+0800
+++ nodejs-packaging/nodejs.attr        1970-01-01 08:00:00.000000000 +0800
@@ -1,3 +0,0 @@
-%__nodejs_provides  %{_rpmconfigdir}/nodejs.prov
-%__nodejs_requires  %{_rpmconfigdir}/nodejs.req
-%__nodejs_path  ^/usr/lib.*/node_modules/.*/package\\.json$
diff -urN nodejs-packaging-fedora-7/nodejs.prov nodejs-packaging/nodejs.prov
--- nodejs-packaging-fedora-7/nodejs.prov       2014-05-25 14:08:21.000000000 
+0800
+++ nodejs-packaging/nodejs.prov        2014-05-24 11:05:36.000000000 +0800
@@ -26,6 +26,7 @@
 # IN THE SOFTWARE.
 
 import json
+import subprocess
 import sys
 
 paths = [path.rstrip() for path in sys.stdin.readlines()]
@@ -43,3 +44,7 @@
                 print '= ' + metadata['version']
             else:
                 print
+
+# invoke the regular RPM provides generator                
+p = subprocess.Popen(['/usr/lib/rpm/find-provides'], stdout=subprocess.PIPE, 
stdin=subprocess.PIPE)
+print p.communicate(input='\n'.join(paths))[0]
diff -urN nodejs-packaging-fedora-7/nodejs.req nodejs-packaging/nodejs.req
--- nodejs-packaging-fedora-7/nodejs.req        2014-05-25 14:08:21.000000000 
+0800
+++ nodejs-packaging/nodejs.req 2014-05-24 11:05:36.000000000 +0800
@@ -28,7 +28,9 @@
 
 from __future__ import unicode_literals
 import json
+import os
 import re
+import subprocess
 import sys
 
 RE_VERSION = re.compile(r'\s*v?([<>=~^]{0,2})\s*([0-9][0-9\.\-]*)\s*')
@@ -45,6 +47,11 @@
     for path in paths:
         if not path.endswith('package.json'):
             continue
+
+        # we only want the package.json in the toplevel module directory
+        pathparts = path.split(os.sep)
+        if not pathparts[-5:-2] == ['usr', 'lib', 'node_modules']:
+            continue
         
         fh = open(path)
         metadata = json.load(fh)
@@ -75,6 +82,10 @@
                 raise TypeError('invalid package.json: dependencies not a 
valid type')
 
     print '\n'.join(deps)
+    
+    # invoke the regular RPM requires generator                
+    p = subprocess.Popen(['/usr/lib/rpm/find-requires'], 
stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+    print p.communicate(input='\n'.join(paths))[0]
 
 def process_dep(req, version):
     """Converts an individual npm dependency into RPM dependencies"""
diff -urN nodejs-packaging-fedora-7/nodejs-symlink-deps 
nodejs-packaging/nodejs-symlink-deps
--- nodejs-packaging-fedora-7/nodejs-symlink-deps       2014-05-25 
14:08:21.000000000 +0800
+++ nodejs-packaging/nodejs-symlink-deps        2014-05-24 11:05:36.000000000 
+0800
@@ -73,9 +73,6 @@
 
 def symlink_deps(deps, check):
     if isinstance(deps, dict):
-        #read in the list of mutiple-versioned packages
-        mvpkgs = open('/usr/share/node/multiver_modules').read().split('\n')
-            
         for dep, ver in deps.iteritems():
             if dep in mvpkgs and ver != '' and ver != '*':
                 depver = ver.lstrip('~').split('.')[0]
@@ -104,6 +101,9 @@
 #the %nodejs_symlink_deps macro passes %nodejs_sitelib as the first argument
 sitelib = sys.argv[1]
 
+#read in the list of mutiple-versioned packages
+mvpkgs = open('/usr/share/node/multiver_modules').read().split('\n')
+
 if '--check' in sys.argv or '--build' in sys.argv:
     check = True
     modules = [os.getcwd()]
++++++ nodejs-packaging-compat-opensuse.patch ++++++
Index: nodejs-packaging-fedora-7/macros.nodejs
===================================================================
--- nodejs-packaging-fedora-7.orig/macros.nodejs
+++ nodejs-packaging-fedora-7/macros.nodejs
@@ -8,6 +8,9 @@
 #for future-proofing only; we don't do multilib
 %nodejs_sitearch %{nodejs_sitelib}
 
+#compat opensuse
+%nodejs_modulesdir %{nodejs_sitelib}
+
 # currently installed nodejs version
 %nodejs_version %(%{__nodejs} -v | sed s/v//)
 

Reply via email to