Blame SPECS/httpd24.spec

0ccbfb
%global scl_name_base    httpd
0ccbfb
%global scl_name_version 24
0ccbfb
%global scl              %{scl_name_base}%{scl_name_version}
0ccbfb
%scl_package %scl
0ccbfb
0ccbfb
# do not produce empty debuginfo package
0ccbfb
%global debug_package %{nil}
0ccbfb
0ccbfb
%define use_system_apr 1
0ccbfb
0ccbfb
Summary:       Package that installs %scl
0ccbfb
Name:          %scl_name
0ccbfb
Version:       1.1
31c51a
Release:       9%{?dist}
0ccbfb
License:       GPLv2+
0ccbfb
Group: Applications/File
0ccbfb
Source0: README
0ccbfb
Source1: LICENSE
0ccbfb
0ccbfb
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
0ccbfb
BuildRequires: scl-utils-build
0ccbfb
# Temporary work-around
0ccbfb
BuildRequires: iso-codes
0ccbfb
BuildRequires: help2man
0ccbfb
0ccbfb
%if ! %{use_system_apr}
0ccbfb
Requires: %{scl_prefix}apr
0ccbfb
Requires: %{scl_prefix}apr-util
0ccbfb
%endif
0ccbfb
Requires: %{scl_prefix}httpd
0ccbfb
0ccbfb
%description
0ccbfb
This is the main package for %scl Software Collection.
0ccbfb
0ccbfb
%package runtime
0ccbfb
Summary:   Package that handles %scl Software Collection.
0ccbfb
Requires:  scl-utils
0ccbfb
Requires(post): policycoreutils-python
31c51a
# Remove httpd24-apr and httpd24-apr-util from system.
31c51a
# https://bugzilla.redhat.com/show_bug.cgi?id=1088194
31c51a
Obsoletes: %{scl_prefix}apr <= 1.5.1-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-devel <= 1.5.1-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-devel <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-pgsql <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-mysql <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-sqlite <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-odbc <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-ldap <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-openssl <= 1.5.4-1%{?dist}
31c51a
Obsoletes: %{scl_prefix}apr-util-nss <= 1.5.4-1%{?dist}
0ccbfb
0ccbfb
%description runtime
0ccbfb
Package shipping essential scripts to work with %scl Software Collection.
0ccbfb
0ccbfb
%package build
0ccbfb
Summary:   Package shipping basic build configuration
0ccbfb
Requires:  scl-utils-build
0ccbfb
0ccbfb
%description build
0ccbfb
Package shipping essential configuration macros to build %scl Software Collection.
0ccbfb
0ccbfb
%package scldevel
0ccbfb
Summary:   Package shipping development files for %scl
0ccbfb
Group:     Development/Languages
0ccbfb
0ccbfb
%description scldevel
0ccbfb
Package shipping development files, especially usefull for development of
0ccbfb
packages depending on %scl Software Collection.
0ccbfb
0ccbfb
%prep
0ccbfb
%setup -c -T
0ccbfb
0ccbfb
# This section generates README file from a template and creates man page
0ccbfb
# from that file, expanding RPM macros in the template file.
0ccbfb
cat >README <<'EOF'
0ccbfb
%{expand:%(cat %{SOURCE0})}
0ccbfb
EOF
0ccbfb
0ccbfb
# copy the license file so %%files section sees it
0ccbfb
cp %{SOURCE1} .
0ccbfb
0ccbfb
# Not required for now
0ccbfb
#export LIBRARY_PATH=%{_libdir}\${LIBRARY_PATH:+:\${LIBRARY_PATH}}
0ccbfb
#export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
0ccbfb
0ccbfb
cat <
0ccbfb
export PATH=%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}
0ccbfb
export MANPATH=%{_mandir}:\${MANPATH}
0ccbfb
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
0ccbfb
EOF
0ccbfb
0ccbfb
# generate rpm macros file for depended collections
0ccbfb
cat << EOF | tee scldev
0ccbfb
%%scl_%{scl_name_base}         %{scl}
0ccbfb
%%scl_prefix_%{scl_name_base}  %{scl_prefix}
0ccbfb
EOF
0ccbfb
0ccbfb
%build
0ccbfb
# generate a helper script that will be used by help2man
0ccbfb
cat >h2m_helper <<'EOF'
0ccbfb
#!/bin/bash
0ccbfb
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
0ccbfb
EOF
0ccbfb
chmod a+x h2m_helper
0ccbfb
0ccbfb
# generate the man page
0ccbfb
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
0ccbfb
0ccbfb
0ccbfb
%install
0ccbfb
mkdir -p %{buildroot}%{_scl_scripts}/root
0ccbfb
install -m 644 enable  %{buildroot}%{_scl_scripts}/enable
0ccbfb
install -D -m 644 scldev %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
0ccbfb
0ccbfb
# install generated man page
0ccbfb
mkdir -p %{buildroot}%{_mandir}/man1/
0ccbfb
mkdir -p %{buildroot}%{_mandir}/man7/
0ccbfb
mkdir -p %{buildroot}%{_mandir}/man8/
0ccbfb
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
0ccbfb
mkdir -p %{buildroot}%{_datadir}/aclocal/
0ccbfb
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
0ccbfb
0ccbfb
%scl_install
0ccbfb
0ccbfb
cat >> %{buildroot}%{_scl_scripts}/service-environment << EOF
0ccbfb
# Services are started in a fresh environment without any influence of user's
0ccbfb
# environment (like environment variable values). As a consequence,
0ccbfb
# information of all enabled collections will be lost during service start up.
0ccbfb
# If user needs to run a service under any software collection enabled, this
0ccbfb
# collection has to be written into HTTPD24_HTTPD_SCLS_ENABLED variable in
0ccbfb
# /opt/rh/sclname/service-environment.
0ccbfb
HTTPD24_HTTPD_SCLS_ENABLED="%{scl}"
0ccbfb
EOF
0ccbfb
0ccbfb
%post runtime
0ccbfb
# Simple copy of context from system root to DSC root.
0ccbfb
# In case new version needs some additional rules or context definition,
0ccbfb
# it needs to be solved.
0ccbfb
# Unfortunately, semanage does not have -e option in RHEL-5, so we have to
0ccbfb
# have its own policy for collection
0ccbfb
semanage fcontext -a -e / %{_scl_root} >/dev/null 2>&1 || :
0ccbfb
restorecon -R %{_scl_root} >/dev/null 2>&1 || :
0ccbfb
selinuxenabled && load_policy || :
0ccbfb
0ccbfb
%files
0ccbfb
0ccbfb
%files runtime
0ccbfb
%defattr(-,root,root)
0ccbfb
%doc README LICENSE
0ccbfb
%scl_files
0ccbfb
%dir %{_mandir}/man1
0ccbfb
%dir %{_mandir}/man7
0ccbfb
%dir %{_mandir}/man8
0ccbfb
%dir %{_libdir}/pkgconfig
0ccbfb
%dir %{_datadir}/aclocal
0ccbfb
%{_mandir}/man7/%{scl_name}.*
0ccbfb
0ccbfb
%config(noreplace) %{_scl_scripts}/service-environment
0ccbfb
0ccbfb
%files build
0ccbfb
%defattr(-,root,root)
0ccbfb
%{_root_sysconfdir}/rpm/macros.%{scl}-config
0ccbfb
0ccbfb
%files scldevel
0ccbfb
%defattr(-,root,root)
0ccbfb
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
0ccbfb
0ccbfb
%changelog
31c51a
* Tue Feb 03 2015 Jan Kaluza <jkaluza@redhat.com> - 1.1.9
31c51a
- use httpd24-apr and httpd24-apr-util from system on RHEL7 (#1187646)
31c51a
31c51a
* Mon Feb 02 2015 Jan Kaluza <jkaluza@redhat.com> - 1.1.8
31c51a
- use httpd24-apr and httpd24-apr-util even on RHEL7 (#1187646)
31c51a
31c51a
* Mon Jan 05 2015 Jan Kaluza <jkaluza@redhat.com> - 1.1-7
31c51a
- obsolete httpd24-apr and http24-apr-util (#1088194)
31c51a
0ccbfb
* Mon Mar 31 2014 Honza Horak <hhorak@redhat.com> - 1.1-4
0ccbfb
- Fix path typo in README
0ccbfb
  Related: #1061446
0ccbfb
0ccbfb
* Tue Mar 25 2014 Jan Kaluza <jkaluza@redhat.com> - 1.1-3
0ccbfb
- own all directories needed by httpd24 SCL (#1079912)
0ccbfb
0ccbfb
* Tue Feb 25 2014 Jan Kaluza <jkaluza@redhat.com> - 1.1-2
0ccbfb
- add scldevel subpackage (#1067434)
0ccbfb
0ccbfb
* Wed Feb 12 2014 Jan Kaluza <jkaluza@redhat.com> - 1.1-1
0ccbfb
- add README and LICENSE (#1061446)
0ccbfb
0ccbfb
* Mon Jan 20 2014 Jan Kaluza <jkaluza@redhat.com> - 1.10
0ccbfb
- rebuild because of missing uucp user (#1054719)
0ccbfb
0ccbfb
* Wed Jan 15 2014 Jan Kaluza <jkaluza@redhat.com> - 1.9
0ccbfb
- execute load_policy to load newly created SELinux policy (#1052935)
0ccbfb
0ccbfb
* Tue Nov 12 2013 Jan Kaluza <jkaluza@redhat.com> - 1.8
0ccbfb
- add service-environment config file
0ccbfb
0ccbfb
* Wed Sep 25 2013 Jan Kaluza <jkaluza@redhat.com> - 1.7
0ccbfb
- use system APR/APR-util
0ccbfb
0ccbfb
* Fri Sep 20 2013 Jan Kaluza <jkaluza@redhat.com> - 1.6
0ccbfb
- add prep section and cleanup spec file
0ccbfb
0ccbfb
* Fri Jul 26 2013 Jan Kaluza <jkaluza@redhat.com> - 1-5
0ccbfb
- do not build httpd24 as noarch, fix export PATH
0ccbfb
0ccbfb
* Fri Jul 26 2013 Jan Kaluza <jkaluza@redhat.com> - 1-4
0ccbfb
- add PKG_CONFIG_PATH to "enable" script
0ccbfb
0ccbfb
* Fri Apr 19 2013 Jan Kaluza <jkaluza@redhat.com> - 1-3
0ccbfb
- handle selinux and manpath
0ccbfb
- build with apr and apr-util from collection
0ccbfb
0ccbfb
* Tue Oct 02 2012 Jan Kaluza <jkaluza@redhat.com> - 1-2
0ccbfb
- updated specfile according to latest guidelines
0ccbfb
- require iso-codes
0ccbfb
0ccbfb
* Wed May 16 2012 Jan Kaluza <jkaluza@redhat.com> - 1-1
0ccbfb
- initial packaging