Blame SPECS/rh-redis32.spec

805319
%{!?scl_vendor: %global scl_vendor rh}
805319
%global scl_name_base    redis
805319
%global scl_name_version 32
805319
%global scl              %{scl_vendor}-%{scl_name_base}%{scl_name_version}
805319
%global macrosdir        %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_root_sysconfdir}/rpm; echo $d)
805319
%global install_scl      1
805319
%global nfsmountable     1
805319
805319
%scl_package %scl
805319
805319
# do not produce empty debuginfo package
805319
%global debug_package %{nil}
805319
805319
Summary:       Package that installs Redis 3.2
805319
Name:          %scl_name
805319
Version:       2.3
805319
Release:       1%{?dist}
805319
Group:         Development/Languages
805319
License:       GPLv2+
805319
805319
Source0:       macros-build
805319
Source1:       README
805319
Source2:       LICENSE
805319
Source3:       register
805319
Source4:       deregister
805319
Source5:       50-copy-files
805319
Source6:       50-clean-files
805319
805319
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
805319
BuildRequires: scl-utils-build
805319
BuildRequires: help2man
805319
# Temporary work-around
805319
BuildRequires: iso-codes
805319
805319
Requires:      %{?scl_prefix}redis%{?_isa}
805319
Requires:      %{?scl_name}-runtime%{?_isa} = %{version}-%{release}
805319
805319
%description
805319
This is the main package for %scl Software Collection,
805319
that install Redis and Sentinel servers.
805319
805319
805319
%package runtime
805319
Summary:   Package that handles %scl Software Collection.
805319
Group:     Development/Languages
805319
Requires:  scl-utils
805319
Requires(post): policycoreutils-python libselinux-utils
805319
805319
%description runtime
805319
Package shipping essential scripts to work with %scl Software Collection.
805319
805319
805319
%package build
805319
Summary:   Package shipping basic build configuration
805319
Group:     Development/Languages
805319
Requires:  scl-utils-build
805319
Requires:  %{?scl_name}-runtime%{?_isa} = %{version}-%{release}
805319
805319
%description build
805319
Package shipping essential configuration macros
805319
to build %scl Software Collection.
805319
805319
805319
%package scldevel
805319
Summary:   Package shipping development files for %scl
805319
Group:     Development/Languages
805319
Requires:  %{?scl_name}-runtime%{?_isa} = %{version}-%{release}
805319
805319
%description scldevel
805319
Package shipping development files, especially usefull for development of
805319
packages depending on %scl Software Collection.
805319
805319
805319
%prep
805319
%setup -c -T
805319
805319
cat <
805319
export PATH=%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}
805319
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
805319
export MANPATH=%{_mandir}:\${MANPATH}
805319
EOF
805319
805319
# generate rpm macros file for depended collections
805319
cat << EOF | tee scldev
805319
%%scl_%{scl_name_base}         %{scl}
805319
%%scl_prefix_%{scl_name_base}  %{scl_prefix}
805319
EOF
805319
805319
# This section generates README file from a template and creates man page
805319
# from that file, expanding RPM macros in the template file.
805319
cat >README <<'EOF'
805319
%{expand:%(cat %{SOURCE1})}
805319
EOF
805319
805319
# copy additional files
805319
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} .
805319
805319
805319
%build
805319
# generate a helper script that will be used by help2man
805319
cat >h2m_helper <<'EOF'
805319
#!/bin/bash
805319
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
805319
EOF
805319
chmod a+x h2m_helper
805319
805319
# generate the man page
805319
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
805319
# Fix single quotes in man page. See RHBZ#1219527
805319
#
805319
# http://lists.gnu.org/archive/html/groff/2008-06/msg00001.html suggests that
805319
# using "'" for quotes is correct, but the current implementation of man in 6
805319
# mangles it when rendering.
805319
sed -i "s/'/\\\\(aq/g" %{scl_name}.7
805319
 
805319
805319
%install
805319
install -D -m 644 enable         %{buildroot}%{_scl_scripts}/enable
805319
install -D -m 644 register       %{buildroot}%{_scl_scripts}/register
805319
install -d -m 755                %{buildroot}%{_scl_scripts}/register.content
805319
install -D -m 644 50-copy-files  %{buildroot}%{_scl_scripts}/register.d/50-copy-files
805319
install -D -m 644 deregister     %{buildroot}%{_scl_scripts}/deregister
805319
install -D -m 644 50-clean-files %{buildroot}%{_scl_scripts}/deregister.d/50-clean-files
805319
sed -e 's:@SCLDIR@:%{_scl_scripts}:' \
805319
    -i %{buildroot}%{_scl_scripts}/*gister
805319
805319
install -D -m 644 scldev %{buildroot}%{macrosdir}/macros.%{scl_name_base}-scldevel
805319
install -D -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
805319
805319
install -d -m 755 %{buildroot}%{_datadir}/licenses
805319
805319
%scl_install
805319
805319
# Add the scl_package_override macro
805319
sed -e 's/@SCL@/%{scl_name_base}%{scl_name_version}/g' \
805319
    -e 's/@VENDOR@/%{scl_vendor}/' \
805319
    %{SOURCE0} \
805319
  | tee -a %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
805319
805319
# Move in correct location, if needed
805319
if [ "%{_root_sysconfdir}/rpm" != "%{macrosdir}" ]; then
805319
  mv  %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config \
805319
      %{buildroot}%{macrosdir}/macros.%{scl}-config
805319
fi
805319
805319
805319
%post runtime
805319
# Simple copy of context from system root to SCL root.
805319
semanage fcontext -a -e /                      %{?_scl_root}     &>/dev/null || :
805319
semanage fcontext -a -e %{_root_sysconfdir}    %{_sysconfdir}    &>/dev/null || :
805319
semanage fcontext -a -e %{_root_localstatedir} %{_localstatedir} &>/dev/null || :
805319
selinuxenabled && load_policy || :
805319
restorecon -R %{?_scl_root}     &>/dev/null || :
805319
restorecon -R %{_sysconfdir}    &>/dev/null || :
805319
restorecon -R %{_localstatedir} &>/dev/null || :
805319
805319
805319
%files
805319
805319
805319
%{!?_licensedir:%global license %%doc}
805319
805319
%if 0%{?fedora} < 19 && 0%{?rhel} < 7
805319
%files runtime
805319
%else
805319
%files runtime -f filesystem
805319
%endif
805319
%defattr(-,root,root)
805319
%license LICENSE
805319
%doc README
805319
%scl_files
805319
%{_scl_scripts}/register
805319
%{_scl_scripts}/register.d/
805319
%{_scl_scripts}/register.content/
805319
%{_scl_scripts}/deregister
805319
%{_scl_scripts}/deregister.d/
805319
%{?_licensedir:%{_datadir}/licenses}
805319
805319
805319
%files build
805319
%defattr(-,root,root)
805319
%{macrosdir}/macros.%{scl}-config
805319
805319
805319
%files scldevel
805319
%defattr(-,root,root)
805319
%{macrosdir}/macros.%{scl_name_base}-scldevel
805319
805319
805319
%changelog
805319
* Wed Jul 27 2016 Remi Collet <rcollet@redhat.com> 2.3-1
805319
- initial package for rh-redis32 in RHSCL-2.3
805319