Blame SPECS/rh-passenger40.spec

64d6a9
%global scl_name_prefix  rh-
64d6a9
%global scl_name_base    passenger
64d6a9
%global scl_name_version 40
64d6a9
%global scl              %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
64d6a9
%scl_package %scl
64d6a9
64d6a9
# Turn on new layout -- prefix for packages and location
64d6a9
# for config and variable files
64d6a9
# This must be before calling %%scl_package
64d6a9
%{!?nfsmountable: %global nfsmountable 1}
64d6a9
64d6a9
# do not produce empty debuginfo package
64d6a9
%global debug_package %{nil}
64d6a9
64d6a9
Summary:       Package that installs %scl
64d6a9
Name:          %scl_name
64d6a9
Version:       2.0
64d6a9
Release:       8%{?dist}
64d6a9
License:       GPLv2+
64d6a9
Group: Applications/File
64d6a9
Source0: README
64d6a9
Source1: LICENSE
64d6a9
64d6a9
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
64d6a9
BuildRequires: scl-utils-build
64d6a9
# Temporary work-around
64d6a9
BuildRequires: iso-codes
64d6a9
BuildRequires: help2man
64d6a9
BuildRequires: ruby193-scldevel
64d6a9
BuildRequires: ruby193-rubygems-devel
64d6a9
64d6a9
Requires: %{scl_prefix}passenger
64d6a9
Requires: %{scl_prefix}mod_passenger
64d6a9
64d6a9
%description
64d6a9
This is the main package for %scl Software Collection.
64d6a9
64d6a9
%package runtime
64d6a9
Summary:   Package that handles %scl Software Collection.
64d6a9
Requires:  scl-utils
64d6a9
Requires(post): policycoreutils-python
64d6a9
64d6a9
%description runtime
64d6a9
Package shipping essential scripts to work with %scl Software Collection.
64d6a9
64d6a9
%package build
64d6a9
Summary:   Package shipping basic build configuration
64d6a9
Requires:  scl-utils-build
64d6a9
64d6a9
%description build
64d6a9
Package shipping essential configuration macros to build %scl Software Collection.
64d6a9
64d6a9
%package scldevel
64d6a9
Summary:   Package shipping development files for %scl
64d6a9
Group:     Development/Languages
64d6a9
64d6a9
%description scldevel
64d6a9
Package shipping development files, especially usefull for development of
64d6a9
packages depending on %scl Software Collection.
64d6a9
64d6a9
%prep
64d6a9
%setup -c -T
64d6a9
# This section generates README file from a template and creates man page
64d6a9
# from that file, expanding RPM macros in the template file.
64d6a9
cat >README <<'EOF'
64d6a9
%{expand:%(cat %{SOURCE0})}
64d6a9
EOF
64d6a9
64d6a9
# copy the license file so %%files section sees it
64d6a9
cp %{SOURCE1} .
64d6a9
64d6a9
cat <
64d6a9
export PATH=%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}
64d6a9
export MANPATH=%{_mandir}:\${MANPATH}
64d6a9
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
64d6a9
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
64d6a9
EOF
64d6a9
64d6a9
# generate rpm macros file for depended collections
64d6a9
cat << EOF | tee scldev
64d6a9
%%scl_%{scl_name_base}         %{scl}
64d6a9
%%scl_prefix_%{scl_name_base}  %{scl_prefix}
64d6a9
EOF
64d6a9
64d6a9
%build
64d6a9
# generate a helper script that will be used by help2man
64d6a9
cat >h2m_helper <<'EOF'
64d6a9
#!/bin/bash
64d6a9
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
64d6a9
EOF
64d6a9
chmod a+x h2m_helper
64d6a9
64d6a9
# generate the man page
64d6a9
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
64d6a9
64d6a9
%install
64d6a9
mkdir -p %{buildroot}%{_scl_scripts}/root
64d6a9
install -m 644 enable  %{buildroot}%{_scl_scripts}/enable
64d6a9
install -D -m 644 scldev %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
64d6a9
64d6a9
# install generated man page
64d6a9
mkdir -p %{buildroot}%{_mandir}/man1/
64d6a9
mkdir -p %{buildroot}%{_mandir}/man3/
64d6a9
mkdir -p %{buildroot}%{_mandir}/man7/
64d6a9
mkdir -p %{buildroot}%{_mandir}/man8/
64d6a9
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
64d6a9
mkdir -p %{buildroot}%{_datadir}/aclocal/
64d6a9
mkdir -p %{buildroot}%{_datadir}/gems/cache
64d6a9
mkdir -p %{buildroot}%{_datadir}/gems/doc
64d6a9
mkdir -p %{buildroot}%{_datadir}/gems/gems
64d6a9
mkdir -p %{buildroot}%{_datadir}/gems/specifications
64d6a9
mkdir -p %{buildroot}%{_libdir}/gems/exts
64d6a9
64d6a9
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
64d6a9
64d6a9
%scl_install
64d6a9
64d6a9
cat >> %{buildroot}%{_scl_scripts}/service-environment << EOF
64d6a9
# Services are started in a fresh environment without any influence of user's
64d6a9
# environment (like environment variable values). As a consequence,
64d6a9
# information of all enabled collections will be lost during service start up.
64d6a9
# If user needs to run Passenger with any software collection enabled, this
64d6a9
# collection has to be written into particular variable in
64d6a9
# /opt/rh/sclname/service-environment file.
64d6a9
RH_PASSENGER40_RUBY193_SCLS_ENABLED="%{scl} ruby193"
64d6a9
RH_PASSENGER40_RUBY200_SCLS_ENABLED="%{scl} ruby200 ror40"
64d6a9
RH_PASSENGER40_RUBY22_SCLS_ENABLED="%{scl} rh-ruby22 rh-ror41"
64d6a9
EOF
64d6a9
64d6a9
# create directory for SCL register scripts
64d6a9
mkdir -p %{buildroot}%{?_scl_scripts}/register.content
64d6a9
mkdir -p %{buildroot}%{?_scl_scripts}/register.d
64d6a9
cat <
64d6a9
#!/bin/sh
64d6a9
ls %{?_scl_scripts}/register.d/* | while read file ; do
64d6a9
    [ -x \$f ] && source \$(readlink -f \$file)
64d6a9
done
64d6a9
EOF
64d6a9
# and deregister as well
64d6a9
mkdir -p %{buildroot}%{?_scl_scripts}/deregister.d
64d6a9
cat <
64d6a9
#!/bin/sh
64d6a9
ls %{?_scl_scripts}/deregister.d/* | while read file ; do
64d6a9
    [ -x \$f ] && source \$(readlink -f \$file)
64d6a9
done
64d6a9
EOF
64d6a9
64d6a9
%post runtime
64d6a9
# Simple copy of context from system root to DSC root.
64d6a9
# In case new version needs some additional rules or context definition,
64d6a9
# it needs to be solved.
64d6a9
# Unfortunately, semanage does not have -e option in RHEL-5, so we have to
64d6a9
# have its own policy for collection
64d6a9
semanage fcontext -a -e / %{_scl_root} >/dev/null 2>&1 || :
64d6a9
restorecon -R %{_scl_root} >/dev/null 2>&1 || :
64d6a9
selinuxenabled && load_policy || :
64d6a9
64d6a9
%files
64d6a9
64d6a9
%files runtime
64d6a9
%defattr(-,root,root)
64d6a9
%doc README LICENSE
64d6a9
%scl_files
64d6a9
%dir %{_mandir}/man1
64d6a9
%dir %{_mandir}/man3
64d6a9
%dir %{_mandir}/man7
64d6a9
%dir %{_mandir}/man8
64d6a9
%dir %{_libdir}/pkgconfig
64d6a9
%dir %{_datadir}/aclocal
64d6a9
%{_datadir}/gems
64d6a9
%{_libdir}/gems
64d6a9
%{_mandir}/man7/%{scl_name}.*
64d6a9
%config(noreplace) %{_scl_scripts}/service-environment
64d6a9
%attr(0755,root,root) %{?_scl_scripts}/register
64d6a9
%attr(0755,root,root) %{?_scl_scripts}/deregister
64d6a9
%{?_scl_scripts}/register.content
64d6a9
%dir %{?_scl_scripts}/register.d
64d6a9
%dir %{?_scl_scripts}/deregister.d
64d6a9
64d6a9
%files build
64d6a9
%defattr(-,root,root)
64d6a9
%{_root_sysconfdir}/rpm/macros.%{scl}-config
64d6a9
64d6a9
%files scldevel
64d6a9
%defattr(-,root,root)
64d6a9
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
64d6a9
64d6a9
%changelog
64d6a9
* Thu Mar 17 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-8
64d6a9
- add missing README (#1200708)
64d6a9
64d6a9
* Thu Mar 12 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-7
64d6a9
- add unowned directories (#1201233)
64d6a9
64d6a9
* Tue Mar 10 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-6
64d6a9
- rebuild to remove scls directory (#1200053)
64d6a9
64d6a9
* Tue Feb 17 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-5
64d6a9
- fix -scldevel macros (#1193390)
64d6a9
64d6a9
* Mon Jan 26 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-4
64d6a9
- add support for NFS
64d6a9
64d6a9
* Mon Jan 19 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-3
64d6a9
- add support for rh-ruby22 SCL
64d6a9
64d6a9
* Thu Jan 08 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-2
64d6a9
- add service-environment config file
64d6a9
64d6a9
* Tue Jan 06 2015 Jan Kaluza <jkaluza@redhat.com> - 2.0-1
64d6a9
- initial packaging