Blame SPECS/rh-nodejs8.spec

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