Blame SPECS/nginx16.spec

3aa0d2
%global scl_name_base    nginx
3aa0d2
%global scl_name_version 16
3aa0d2
%global scl              %{scl_name_base}%{scl_name_version}
3aa0d2
%scl_package %scl
3aa0d2
3aa0d2
# do not produce empty debuginfo package
3aa0d2
%global debug_package %{nil}
3aa0d2
3aa0d2
Summary:       Package that installs %scl
3aa0d2
Name:          %scl_name
3aa0d2
Version:       1.2
98a9ab
Release:       2%{?dist}
3aa0d2
License:       GPLv2+
3aa0d2
Group: Applications/File
3aa0d2
Source0: README
3aa0d2
Source1: LICENSE
3aa0d2
3aa0d2
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3aa0d2
BuildRequires: scl-utils-build
3aa0d2
# Temporary work-around
3aa0d2
BuildRequires: iso-codes
3aa0d2
BuildRequires: help2man
3aa0d2
3aa0d2
Requires: %{scl_prefix}nginx
3aa0d2
3aa0d2
%description
3aa0d2
This is the main package for %scl Software Collection.
3aa0d2
3aa0d2
%package runtime
3aa0d2
Summary:   Package that handles %scl Software Collection.
3aa0d2
Requires:  scl-utils
3aa0d2
Requires(post): policycoreutils-python libselinux-utils
3aa0d2
3aa0d2
%description runtime
3aa0d2
Package shipping essential scripts to work with %scl Software Collection.
3aa0d2
3aa0d2
%package build
3aa0d2
Summary:   Package shipping basic build configuration
3aa0d2
Requires:  scl-utils-build
3aa0d2
3aa0d2
%description build
3aa0d2
Package shipping essential configuration macros to build %scl Software Collection.
3aa0d2
3aa0d2
%package scldevel
3aa0d2
Summary:   Package shipping development files for %scl
3aa0d2
Group:     Development/Languages
3aa0d2
3aa0d2
%description scldevel
3aa0d2
Package shipping development files, especially usefull for development of
3aa0d2
packages depending on %scl Software Collection.
3aa0d2
3aa0d2
%prep
3aa0d2
%setup -c -T
3aa0d2
# This section generates README file from a template and creates man page
3aa0d2
# from that file, expanding RPM macros in the template file.
3aa0d2
cat >README <<'EOF'
3aa0d2
%{expand:%(cat %{SOURCE0})}
3aa0d2
EOF
3aa0d2
3aa0d2
# copy the license file so %%files section sees it
3aa0d2
cp %{SOURCE1} .
3aa0d2
3aa0d2
# Not required for now
3aa0d2
#export LIBRARY_PATH=%{_libdir}\${LIBRARY_PATH:+:\${LIBRARY_PATH}}
3aa0d2
#export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
3aa0d2
3aa0d2
cat <
3aa0d2
export PATH=%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}
3aa0d2
export MANPATH=%{_mandir}:\${MANPATH}
3aa0d2
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
3aa0d2
EOF
3aa0d2
3aa0d2
# generate rpm macros file for depended collections
3aa0d2
cat << EOF | tee scldev
3aa0d2
%%scl_%{scl_name_base}         %{scl}
3aa0d2
%%scl_prefix_%{scl_name_base}  %{scl_prefix}
3aa0d2
EOF
3aa0d2
3aa0d2
%build
3aa0d2
# generate a helper script that will be used by help2man
3aa0d2
cat >h2m_helper <<'EOF'
3aa0d2
#!/bin/bash
3aa0d2
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
3aa0d2
EOF
3aa0d2
chmod a+x h2m_helper
3aa0d2
3aa0d2
# generate the man page
3aa0d2
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
3aa0d2
3aa0d2
%install
3aa0d2
mkdir -p %{buildroot}%{_scl_scripts}/root
3aa0d2
install -m 644 enable  %{buildroot}%{_scl_scripts}/enable
3aa0d2
install -D -m 644 scldev %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
3aa0d2
3aa0d2
mkdir -p %{buildroot}%{_localstatedir}/run/
3aa0d2
3aa0d2
# install generated man page
3aa0d2
mkdir -p %{buildroot}%{_mandir}/man7/
3aa0d2
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
3aa0d2
3aa0d2
%scl_install
3aa0d2
3aa0d2
%post runtime
3aa0d2
# Simple copy of context from system root to DSC root.
3aa0d2
# In case new version needs some additional rules or context definition,
3aa0d2
# it needs to be solved.
3aa0d2
# Unfortunately, semanage does not have -e option in RHEL-5, so we have to
3aa0d2
# have its own policy for collection
3aa0d2
semanage fcontext -a -e / %{_scl_root} >/dev/null 2>&1 || :
3aa0d2
restorecon -R %{_scl_root} >/dev/null 2>&1 || :
3aa0d2
selinuxenabled && load_policy || :
3aa0d2
3aa0d2
%files
3aa0d2
3aa0d2
%files runtime
3aa0d2
%defattr(-,root,root)
3aa0d2
%doc README LICENSE
3aa0d2
%scl_files
98a9ab
%dir %{_mandir}/man7
98a9ab
%dir %{_mandir}/man8
3aa0d2
%{_mandir}/man7/%{scl_name}.*
3aa0d2
3aa0d2
%dir %{_localstatedir}/run
3aa0d2
3aa0d2
%files build
3aa0d2
%defattr(-,root,root)
3aa0d2
%{_root_sysconfdir}/rpm/macros.%{scl}-config
3aa0d2
3aa0d2
%files scldevel
3aa0d2
%defattr(-,root,root)
3aa0d2
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
3aa0d2
3aa0d2
%changelog
98a9ab
* Tue Jan 06 2015 Jan Kaluza <jkaluza@redhat.com> - 1.2-2
98a9ab
- fix incorrectly defined rhel macro in README (#1152494)
98a9ab
- own the man7 and ma8 directories to remove them weh uninstalling (#1040470)
98a9ab
3aa0d2
* Tue Jun 24 2014 Jan Kaluza <jkaluza@redhat.com> - 1.2-1
3aa0d2
- rename to nginx16
3aa0d2
3aa0d2
* Mon Mar 31 2014 Honza Horak <hhorak@redhat.com> - 1.1-3
3aa0d2
- Fix path typo in README
3aa0d2
  Related: #1061451
3aa0d2
3aa0d2
* Tue Feb 25 2014 Jan Kaluza <jkaluza@redhat.com> - 1.1-2
3aa0d2
- add scldevel subpackage (#1067444)
3aa0d2
3aa0d2
* Thu Feb 13 2014 Jan Kaluza <jkaluza@redhat.com> - 1.1-1
3aa0d2
- add README and LICENSE (#1061451)
3aa0d2
3aa0d2
* Fri Jan 17 2014 Jan Kaluza <jkaluza@redhat.com> - 1.4
3aa0d2
- rebuild because of missing uucp user (#1054725)
3aa0d2
3aa0d2
* Wed Jan 15 2014 Jan Kaluza <jkaluza@redhat.com> - 1.3
3aa0d2
- execute load_policy to load newly created SELinux policy (#1052935)
3aa0d2
3aa0d2
* Mon Nov 18 2013 Jan Kaluza <jkaluza@redhat.com> - 1.2
3aa0d2
- create /var/run directory
3aa0d2
3aa0d2
* Mon Nov 18 2013 Jan Kaluza <jkaluza@redhat.com> - 1.1
3aa0d2
- initial packaging