Blame SPECS/rh-nodejs10.spec

fb565e
%global scl_name_prefix rh-
fb565e
%global scl_name_base nodejs
fb565e
%global scl_name_version 10
1b7847
fb565e
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
fb565e
fb565e
%scl_package %scl
fb565e
%global install_scl 1
fb565e
1b7847
%global rpm_magic_name %{lua: name, _ = string.gsub(rpm.expand("%{scl_name}"), "-", "_"); print(name)}
1b7847
fb565e
# do not produce empty debuginfo package
fb565e
%global debug_package %{nil}
fb565e
fb565e
Summary: %scl Software Collection
fb565e
Name: %scl_name
fb565e
Version: 3.2
1b7847
Release: 3%{?dist}
fb565e
fb565e
Source1: macros.nodejs
fb565e
Source2: nodejs.attr
fb565e
Source3: nodejs.prov
fb565e
Source4: nodejs.req
fb565e
Source5: nodejs-symlink-deps
fb565e
Source6: nodejs-fixdep
fb565e
Source7: nodejs_native.attr
fb565e
Source8: README
fb565e
Source9: LICENSE
fb565e
Source10: multiver_modules
fb565e
Source11: nodejs-setversion
fb565e
fb565e
License: MIT
fb565e
fb565e
%if 0%{?install_scl}
fb565e
Requires: %{scl_prefix}nodejs
fb565e
Requires: %{scl_prefix}npm
fb565e
Requires: %{scl_prefix}runtime
fb565e
%endif
fb565e
fb565e
BuildRequires: scl-utils-build
fb565e
BuildRequires: python-devel
fb565e
BuildRequires: help2man
fb565e
fb565e
%description
fb565e
This is the main package for %scl Software Collection.
fb565e
fb565e
%package runtime
fb565e
Summary: Package that handles %scl Software Collection.
fb565e
Requires: %{_root_bindir}/scl_source
fb565e
fb565e
%description runtime
fb565e
Package shipping essential scripts to work with %scl Software Collection.
fb565e
fb565e
%package build
fb565e
Summary: Package shipping basic build configuration
fb565e
Requires: scl-utils-build
fb565e
fb565e
%description build
fb565e
Package shipping essential configuration macros to build %scl Software Collection.
fb565e
fb565e
%package scldevel
fb565e
Summary: Package shipping development files for %scl
1b7847
fb565e
%description scldevel
fb565e
Package shipping development files, especially usefull for development of
fb565e
packages depending on %scl Software Collection.
fb565e
fb565e
%prep
fb565e
%setup -c -T
fb565e
fb565e
# This section generates README file from a template and creates man page
fb565e
# from that file, expanding RPM macros in the template file.
fb565e
cat >README <<'EOF'
fb565e
%{expand:%(cat %{SOURCE8})}
fb565e
EOF
fb565e
fb565e
# copy the license file so %%files section sees it
fb565e
cp %{SOURCE9} .
fb565e
fb565e
%build
fb565e
# generate a helper script that will be used by help2man
fb565e
cat >h2m_helper <<'EOF'
fb565e
#!/bin/bash
fb565e
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
fb565e
EOF
fb565e
fb565e
chmod a+x h2m_helper
fb565e
fb565e
# generate the man page
fb565e
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
fb565e
fb565e
%install
fb565e
rm -rf %{buildroot}
fb565e
mkdir -p %{buildroot}%{_scl_scripts}/root
fb565e
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
fb565e
export PATH=%{_bindir}\${PATH:+:\${PATH}}
fb565e
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
fb565e
export PYTHONPATH=%{_scl_root}%{python_sitelib}\${PYTHONPATH:+:\${PYTHONPATH}}
fb565e
export MANPATH=%{_mandir}:\$MANPATH
fb565e
#. scl_source enable v8314
fb565e
# new nodejs bundles v8
fb565e
EOF
fb565e
fb565e
# install rpm magic
fb565e
install -Dpm0644 %{SOURCE1} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{name}
1b7847
install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/%{rpm_magic_name}.attr
1b7847
install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/%{rpm_magic_name}.prov
1b7847
install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/%{rpm_magic_name}.req
fb565e
install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps
fb565e
install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/%{name}-fixdep
1b7847
install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/%{rpm_magic_name}_native.attr
fb565e
install -Dpm0644 %{SOURCE10} %{buildroot}%{_datadir}/node/multiver_modules
fb565e
install -pm0755 %{SOURCE11} %{buildroot}%{_rpmconfigdir}/%{name}-symlink-deps
fb565e
fb565e
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
fb565e
%%scl_%{scl_name_base} %{scl}
fb565e
%%scl_prefix_%{scl_name_base} %{scl_prefix}
fb565e
EOF
fb565e
fb565e
# ensure Requires are added to every native module that match the Provides from
fb565e
# the nodejs build in the buildroot
1b7847
cat << EOF > %{buildroot}%{_rpmconfigdir}/%{rpm_magic_name}_native.req
fb565e
#!/bin/sh
fb565e
echo 'nodejs10-nodejs(abi) = %nodejs_abi'
fb565e
echo 'nodejs10-nodejs(v8-abi) = %v8_abi'
fb565e
EOF
1b7847
chmod 0755 %{buildroot}%{_rpmconfigdir}/%{rpm_magic_name}_native.req
fb565e
fb565e
cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-require.sh
fb565e
#!/bin/sh
fb565e
%{_rpmconfigdir}/%{name}.req $*
fb565e
%{_rpmconfigdir}/find-requires $*
fb565e
EOF
fb565e
chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-require.sh
fb565e
fb565e
cat << EOF > %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh
fb565e
#!/bin/sh
fb565e
%{_rpmconfigdir}/%{name}.prov $*
fb565e
%{_rpmconfigdir}/find-provides $*
fb565e
EOF
fb565e
chmod 0755 %{buildroot}%{_rpmconfigdir}/%{name}-provide.sh
fb565e
fb565e
%scl_install
fb565e
# scl doesn't include this directory
fb565e
mkdir -p %{buildroot}%{_scl_root}%{python_sitelib}
fb565e
mkdir -p %{buildroot}%{_libdir}/pkgconfig
fb565e
fb565e
# install generated man page
fb565e
mkdir -p %{buildroot}%{_mandir}/man7/
fb565e
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
fb565e
fb565e
# own license dir (RHBZ#1420294)
fb565e
mkdir -p %{buildroot}%{_datadir}/licenses/
fb565e
fb565e
1b7847
%check
1b7847
# Assert that installed file attributes are named appropriately
1b7847
for attr_file in %{buildroot}%{_rpmconfigdir}/fileattrs/*.attr; do
1b7847
    macro_name="$(basename "$attr_file"|sed -E 's|\.attr$||')"
1b7847
1b7847
    # Delete comments and empty lines
1b7847
    # Select all remaining lines that start unexpectedly
1b7847
    # Fail if any such line is found, cotinue otherwise
1b7847
    sed -E -e '/^$/d;/^#/d' "$attr_file" \
1b7847
    | grep -E -v "^%%__${macro_name}_" \
1b7847
    && exit 1 || :
1b7847
done
1b7847
fb565e
%files
fb565e
fb565e
%files -f filesystem runtime
fb565e
%doc README
fb565e
%{!?_licensedir:%global license %%doc}
fb565e
%license LICENSE
fb565e
%scl_files
fb565e
#%%dir %%{_scl_root}%%{python_sitelib}
fb565e
%dir %{_prefix}/lib/python2.*
fb565e
%dir %{_libdir}/pkgconfig
fb565e
%dir %{_datadir}/licenses
fb565e
%{_datadir}/node/multiver_modules
fb565e
%{_mandir}/man7/%{scl_name}.*
fb565e
%dir %{_datadir}/node
fb565e
fb565e
%files build
fb565e
%{_root_sysconfdir}/rpm/macros.%{scl}-config
fb565e
%{_root_sysconfdir}/rpm/macros.%{name}
1b7847
%{_rpmconfigdir}/fileattrs/%{rpm_magic_name}*.attr
fb565e
%{_rpmconfigdir}/%{name}*
1b7847
%{_rpmconfigdir}/%{rpm_magic_name}*
fb565e
fb565e
%files scldevel
fb565e
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
fb565e
fb565e
%changelog
1b7847
* Fri Sep 06 2019 Jan Staněk <jstanek@redhat.com> - 3.2-3
1b7847
- Import enhanced Provides/Requires generators from Fedora
1b7847
fb565e
* Thu Sep 20 2018 Zuzana Svetlikova <zsvetlik@redhat.com> - 3.2-2
fb565e
- Resolves: RHBZ#1584252
fb565e
- update to fedora packaging, generate bundled provides automaticaly
fb565e
fb565e
* Thu Jul 19 2018 Zuzana Svetlikova <zsvetlik@redhat.com> - 3.2-1
fb565e
- Update to v10
fb565e
fb565e
* Thu Jul 13 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 3.0-4
fb565e
- Use macro for python sitelib in doc
fb565e
fb565e
* Mon Jul 03 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 3.0-3
fb565e
- Fix typo in symlink script
fb565e
fb565e
* Tue Jun 27 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 3.0-2
fb565e
- Enable installing the collection
fb565e
fb565e
* Mon Jun 19 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 3.0-1
fb565e
- SCL 3.0, nodejs v8.x
fb565e
fb565e
* Thu Feb 16 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.4-5
fb565e
- Own %%{_licensedir} ((RHBZ#1420294))
fb565e
fb565e
* Fri Jan 27 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.4-4
fb565e
- Enable installing main package set
fb565e
fb565e
* Wed Jan 11 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.4-2
fb565e
- RHSCL 2.4
fb565e
- Update macros
fb565e
- Use zvetlik/rh-nodejs6 as base for rh-nodejs6, change sclo- for rh-
fb565e
fb565e
* Wed Jan 11 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.4-1
fb565e
- Use zvetlik/rh-nodejs6 as base for rh-nodejs6
fb565e
fb565e
* Mon Sep 05 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.3-2
fb565e
- Use sclo- prefix
fb565e
fb565e
* Tue Aug 30 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.3-1
fb565e
- New meta-package for Nodejs v6
fb565e
fb565e
* Thu Mar 03 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.2-5
fb565e
- Enable installing whole scl (RBZ#1314093)
fb565e
fb565e
* Fri Feb 12 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.2-4
fb565e
- Add prefixes to provides and requires
fb565e
fb565e
* Wed Feb 10 2016 Tomas Hrcka <thrcka@redhat.com> - 2.2-3
fb565e
- Add missing rh- prefix
fb565e
fb565e
* Wed Feb 03 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.2-1
fb565e
- RHSCL 2.2
fb565e
- add %%license tag to %%files
fb565e
fb565e
* Thu Jan 14 2016 Tomas Hrcka <thrcka@redhat.com> - 2.1-5
fb565e
- Include nodemon in collection
fb565e
- Update packaging scripts and macros
fb565e
fb565e
* Fri Oct 02 2015 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.1-3
fb565e
- Enable installing of whole collection
fb565e
fb565e
* Thu Jul 02 2015 Tomas Hrcka <thrcka@redhat.com> - 2.1-2
fb565e
- RHSCL 2.1 release
fb565e
- disable installing of whole collection this will be enabled after devel period
fb565e
fb565e
* Thu May 14 2015 Tomas Hrcka <thrcka@redhat.com> - 2.0-3
fb565e
- Red Hat Software collections 2.0
fb565e
- Own python modules directory
fb565e
fb565e
* Wed Oct 08 2014 Tomas Hrcka <thrcka@redhat.com> - 1.2-29
1b7847
- Require scriptlet scl_devel from root_bindir not scl_bindir
fb565e
fb565e
* Mon Oct 06 2014 Tomas Hrcka <thrcka@redhat.com> - 1.2-28
fb565e
- bump scl version
fb565e
fb565e
* Mon Oct 06 2014 Tomas Hrcka <thrcka@redhat.com> - 1.2-27
fb565e
- Require scriptlet scl_devel instead of specific scl-utils version
fb565e
fb565e
* Mon Sep 08 2014 Tomas Hrcka <thrcka@redhat.com> - 1.2-26
fb565e
- Fix version of scl-utils required by this package
fb565e
- Bump version
fb565e
fb565e
* Mon Mar 31 2014 Honza Horak <hhorak@redhat.com> - 1.1-25
fb565e
- Fix path typo in README
fb565e
  Related: #1061452
fb565e
fb565e
* Mon Feb 17 2014 Tomas Hrcka <thrcka@redhat.com> - 1.1-24
1b7847
- Require version of scl-utils
fb565e
fb565e
* Wed Feb 12 2014 Tomas Hrcka <thrcka@redhat.com> - 1.1-23
1b7847
- Define scl_name_base and scl_name_version macros
fb565e
fb565e
* Wed Feb 12 2014 Honza Horak <hhorak@redhat.com> - 1.1-22
fb565e
- Some more grammar fixes in README
fb565e
  Related: #1061452
fb565e
fb565e
* Tue Jan 21 2014 Tomas Hrcka <thrcka@redhat.com> - 1-21
fb565e
- Rebuilt for rhbz#1054252
fb565e
fb565e
* Thu Dec 05 2013 Tomas Hrcka <thrcka@redhat.com> - 1-20
fb565e
- install collection packages as dependencies
fb565e
fb565e
* Wed Nov 27 2013 Tomas Hrcka <thrcka@redhat.com> - 1-19
fb565e
- rebuilt
fb565e
- fiw v8314 dependency
fb565e
fb565e
* Wed Nov 20 2013 Tomas Hrcka <thrcka@redhat.com> - 1-18
fb565e
- added dependency on v8314 scl
fb565e
fb565e
* Thu Aug 15 2013 thrcka@redhat.com - 1-17
fb565e
- clean up after previous fix
fb565e
fb565e
* Fri Aug 09 2013 thrcka@redhat.com - 1-16
1b7847
- RHBZ#993425 - nodejs010.req fails when !noarch
fb565e
fb565e
* Mon Jun 03 2013 thrcka@redhat.com - 1-15
fb565e
- Changed licence to MIT
fb565e
fb565e
* Thu May 23 2013 Tomas Hrcka <thrcka@redhat.com> - 1-14.1
fb565e
- fixed typo in MANPATH
fb565e
fb565e
* Thu May 23 2013 Tomas Hrcka <thrcka@redhat.com> - 1-14
fb565e
- Changed MAN_PATH so it does not ignore man pages from host system
fb565e
fb565e
* Thu May  9 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-13
fb565e
- Remove colons forgotten in scriplets
fb565e
fb565e
* Tue May 07 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-12
fb565e
- Add runtime dependency on scl-runtime
fb565e
fb565e
* Mon May 06 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-11
fb565e
- Add pkgconfig file ownership
fb565e
fb565e
* Mon May 06 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-10
fb565e
- Workaround scl-utils not generating all directory ownerships (#956213)
fb565e
fb565e
* Mon May 06 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-9
fb565e
- Fix enable scriptlet evironment expansion (#956788)
fb565e
fb565e
* Wed Apr 17 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-8
fb565e
- Extend MANPATH env variable
fb565e
- Add npm to meta package requires
fb565e
fb565e
* Mon Apr 15 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-7
fb565e
- Update macros and requires/provides generator to latest
fb565e
fb565e
* Wed Apr 10 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-6
fb565e
- Fix rpm requires/provides generator paths
fb565e
- Add requires to main meta package
fb565e
fb565e
* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-5
fb565e
- Make package architecture specific for libdir usage
fb565e
fb565e
* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-4
fb565e
- Add rpm macros and tooling
fb565e
fb565e
* Mon Apr 08 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3
fb565e
- Add proper scl-utils-build requires
fb565e
fb565e
* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-2
fb565e
- Add PYTHONPATH to configuration
fb565e
fb565e
* Tue Mar 26 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-1
fb565e
- Initial version of the Node.js Software Collection