Blame SPECS/rh-redis6.spec

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