Blame SPECS/nodejs-inherits.spec

095068
%{?scl:%scl_package nodejs-inherits}
095068
%{!?scl:%global pkg_name %{name}}
095068
%{?nodejs_find_provides_and_requires}
095068
095068
Name:       %{?scl_prefix}nodejs-inherits
095068
Version:    2.0.0
095068
Release:    15%{?dist}
095068
Summary:    A tiny simple way to do classic inheritance in js
095068
License:    WTFPL
095068
Group:      Development/Libraries
095068
URL:        https://github.com/isaacs/inherits
095068
Source0:    http://registry.npmjs.org/inherits/-/inherits-%{version}.tgz
095068
Source1:    https://raw.github.com/isaacs/inherits/112807f2670160b6e3bafdf39e395c10ae7d0fac/LICENSE
095068
BuildRoot:  %{_tmppath}/%{pkg_name}-%{version}-%{release}-root-%(%{__id_u} -n)
095068
BuildArch:  noarch
095068
ExclusiveArch: %{nodejs_arches} noarch
095068
095068
BuildRequires:  %{?scl_prefix}nodejs-devel
095068
095068
%description
095068
%{summary}.
095068
095068
%prep
095068
%setup -q -n package
095068
095068
#copy the license into %%{_builddir} so it works with %%doc
095068
cp -p %{SOURCE1} LICENSE
095068
095068
%build
095068
#nothing to do
095068
095068
%install
095068
rm -rf %{buildroot}
095068
095068
mkdir -p %{buildroot}%{nodejs_sitelib}/inherits
095068
cp -pr inherits.js package.json %{buildroot}%{nodejs_sitelib}/inherits
095068
095068
%nodejs_symlink_deps
095068
095068
ln -sf inherits %{buildroot}%{nodejs_sitelib}/inherits@2
095068
095068
%clean
095068
rm -rf %{buildroot}
095068
095068
# there have been reports that the symlinks are messed up when upgrading
095068
# from older versions, so let's make sure everything's copacetic
095068
%triggerun -- nodejs-inherits < 2.0.0-4
095068
ln -sf inherits@2 %{nodejs_sitelib}/inherits
095068
%{__python} <
095068
import json, os, sys
095068
095068
for moddir in os.listdir('%{nodejs_sitelib}'):
095068
    if os.path.isdir(moddir):
095068
        md = json.load(open(os.path.join(moddir, 'package.json')))
095068
        
095068
        if 'dependencies' in md and 'inherits' in md['dependencies']:
095068
            if isinstance(md['dependencies'], dict) and '1' in md['dependencies']['inherits']:
095068
                src = os.path.join('%{nodejs_sitelib}', 'inherits@1')
095068
            else:
095068
                src = os.path.join('%{nodejs_sitelib}', 'inherits@2')
095068
               
095068
            dest = os.path.join('%{nodejs_sitelib}', moddir, 'inherits')
095068
            
095068
            if not os.path.realpath(dest) == src:
095068
                try:
095068
                    os.unlink(dest)
095068
                except OSError:
095068
                    pass
095068
                    
095068
                try:
095068
                    os.symlink(src, dest)
095068
                except OSError, e:
095068
                    sys.stderr.write(e + '\n')
095068
EOF
095068
095068
# rpm blows up if you try to replace a dir with a symlink or vice-versa
095068
#%%pretrans -p <lua>
095068
#if posix.stat("%{nodejs_sitelib}/inherits", "type") == "directory" then
095068
#    os.rename('%{nodejs_sitelib}/inherits', '%{nodejs_sitelib}/inherits@2')
095068
#end
095068
095068
%files
095068
%defattr(-,root,root,-)
095068
%{nodejs_sitelib}/inherits@2
095068
%{nodejs_sitelib}/inherits
095068
%doc README.md LICENSE
095068
095068
%changelog
095068
* Sun Feb 14 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-15
095068
- rebuilt
095068
095068
* Sat Feb 13 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-14
095068
- rebuilt
095068
095068
* Tue Feb 09 2016 Tomas Hrcka <thrcka@redhat.com> - 2.0.0-13
095068
- Fix simlink issues
095068
095068
* Fri Oct 23 2015 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-10
095068
- Rebuilt
095068
095068
* Thu Oct 15 2015 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-9
095068
- Fix bad indentation in python script
095068
095068
* Wed Oct 14 2015 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-8
095068
- Rebuild
095068
095068
* Fri Oct 09 2015 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-7
095068
- Enable multiversioning (BZ#1268882)
095068
095068
* Wed Mar 05 2014 Tomas Hrcka <thrcka@redhat.com> - 2.0.0-6
095068
- Disable multiversion inherits
095068
095068
* Thu Oct 17 2013 Tomas Hrcka <thrcka@redhat.com> - 2.0.0-5
095068
- replace provides and requires with macro
095068
095068
* Fri Aug 16 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0.0-4
095068
- add some post-install hackery to work around potential RPM bug resulting in
095068
  symlinks still pointing to their old locations on upgrade (RHBZ#997978)
095068
095068
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-4
095068
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
095068
095068
* Sat Jul 06 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0.0-3
095068
- only run the hack when we really need to
095068
095068
* Sat Jul 06 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0.0-2
095068
- use lua for pretrans
095068
095068
* Sun Jun 23 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0.0-1
095068
- new upstream release 2.0.0
095068
- include license file
095068
- follow the mutiple version spec
095068
095068
* Sun Jun 23 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-9
095068
- restrict to compatible arches
095068
095068
* Mon Apr 15 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-8
095068
- add macro for EPEL6 dependency generation
095068
095068
* Thu Apr 11 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.0.0-8
095068
- Add support for software collections
095068
095068
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-7
095068
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
095068
095068
* Tue Jan 08 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-6
095068
- add missing build section
095068
095068
* Thu Jan 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-5
095068
- correct license tag (thanks to Robin Lee)
095068
095068
* Mon Dec 31 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-4
095068
- clean up for submission
095068
095068
* Fri Apr 27 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-3
095068
- guard Requires for F17 automatic depedency generation
095068
095068
* Sat Feb 11 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-2
095068
- switch to automatically generated provides/requires
095068
095068
* Sat Jan 21 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0.0-1
095068
- initial package