Blame SPECS/rh-git227.spec

3b325f
# Define SCL name
3b325f
%{!?scl_name_prefix: %global scl_name_prefix rh-}
3b325f
%{!?scl_name_base: %global scl_name_base git}
3b325f
%{!?version_major: %global version_major 2}
3b325f
%{!?version_minor: %global version_minor 27}
3b325f
%{!?scl_name_version: %global scl_name_version %{version_major}%{version_minor}}
3b325f
%{!?scl: %global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}}
3b325f
3b325f
# Turn on new layout -- prefix for packages and location
3b325f
# for config and variable files
3b325f
# This must be before calling %%scl_package
3b325f
%{!?nfsmountable: %global nfsmountable 1}
3b325f
3b325f
# Define SCL macros
3b325f
%{?scl_package:%scl_package %scl}
3b325f
3b325f
# do not produce empty debuginfo package (https://bugzilla.redhat.com/show_bug.cgi?id=1061439#c2)
3b325f
%global debug_package %{nil}
3b325f
3b325f
Summary: Package that installs %{scl}
3b325f
Name: %{scl_name}
3b325f
Version: 3.6
3b325f
Release: 1%{?dist}
3b325f
Group: Applications/File
3b325f
Source0: README
3b325f
Source1: LICENSE
3b325f
License: GPLv2+
3b325f
Requires: scl-utils
3b325f
Requires: %{?scl_prefix}git
3b325f
BuildRequires: scl-utils-build, help2man
3b325f
3b325f
%description
3b325f
This is the main package for %{scl} Software Collection, which install
3b325f
the necessary packages to use git-%{version_major}.%{version_minor}. Software collections allow
3b325f
to install more versions of the same package by using an alternative
3b325f
directory structure.
3b325f
Install this package if you want to use git-%{version_major}.%{version_minor} on your system.
3b325f
3b325f
%package runtime
3b325f
Summary: Package that handles %scl Software Collection.
3b325f
Group: Applications/File
3b325f
Requires: scl-utils
3b325f
# e.g. scl-utils 20120927-8.el6_5
3b325f
Requires: /usr/bin/scl_source
3b325f
Requires(post): policycoreutils-python, libselinux-utils
3b325f
3b325f
%description runtime
3b325f
Package shipping essential scripts to work with %{scl} Software Collection.
3b325f
3b325f
%package build
3b325f
Summary: Package shipping basic build configuration
3b325f
#FIXME: is it required?
3b325f
Requires: %{name}-runtime = %{version}
3b325f
Requires: scl-utils-build
3b325f
Requires: httpd24-scldevel
3b325f
Group: Applications/File
3b325f
3b325f
%description build
3b325f
Package shipping essential configuration macros to build
3b325f
%{scl} Software Collection.
3b325f
3b325f
%package scldevel
3b325f
Summary: Package shipping development files for %{scl}.
3b325f
Group: Applications/File
3b325f
3b325f
%description scldevel
3b325f
Development files for %{scl} (useful e.g. for hierarchical collection
3b325f
building with transitive dependencies).
3b325f
3b325f
%prep
3b325f
%setup -c -T
3b325f
3b325f
cat > README <<\EOF
3b325f
%{expand:%(cat %{SOURCE0})}
3b325f
EOF
3b325f
# copy the license file so %%files section sees it
3b325f
cp %{SOURCE1} .
3b325f
3b325f
%build
3b325f
# temporary helper script used by help2man
3b325f
cat > h2m_helper <<\EOF
3b325f
#!/bin/sh
3b325f
if [ "$1" = "--version" ]; then
3b325f
  printf '%%s' "%{scl_name} %{version} Software Collection"
3b325f
else
3b325f
  cat README
3b325f
fi
3b325f
EOF
3b325f
chmod a+x h2m_helper
3b325f
# generate the man page
3b325f
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
3b325f
3b325f
%install
3b325f
rm -rf %{buildroot}
3b325f
mkdir -p %{buildroot}%{_scl_scripts}/root
3b325f
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
3b325f
export PATH=%{_bindir}\${PATH:+:\${PATH}}
3b325f
export MANPATH=%{_mandir}:\${MANPATH}
3b325f
export PERL5LIB=%{_scl_root}%{perl_vendorlib}\${PERL5LIB:+:\${PERL5LIB}}
3b325f
export LD_LIBRARY_PATH=/opt/rh/httpd24/root%{_root_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
3b325f
EOF
3b325f
3b325f
# install generated man page
3b325f
install -d -m 755               %{buildroot}%{_mandir}/man7
3b325f
install -p -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/
3b325f
3b325f
%scl_install
3b325f
3b325f
# scldevel garbage
3b325f
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
3b325f
%%scl_%{scl_name_base} %{scl}
3b325f
%%scl_prefix_%{scl_name_base} %{scl_prefix}
3b325f
EOF
3b325f
3b325f
%post runtime
3b325f
# Simple copy of context from system root to DSC root.
3b325f
# In case new version needs some additional rules or context definition,
3b325f
# it needs to be solved.
3b325f
semanage fcontext -a -e / %{_scl_root} >/dev/null 2>&1 || :
3b325f
semanage fcontext -a -e %{_root_localstatedir}/git %{_localstatedir}/git >/dev/null 2>&1 || :
3b325f
semanage fcontext -a -e %{_root_sysconfdir}/git %{_sysconfdir}/git >/dev/null 2>&1 || :
3b325f
selinuxenabled && load_policy >/dev/null 2>&1 || :
3b325f
restorecon -R %{_scl_root} >/dev/null 2>&1 || :
3b325f
restorecon -R %{_localstatedir} >/dev/null 2>&1 || :
3b325f
restorecon -R %{_sysconfdir} >/dev/null 2>&1 || :
3b325f
3b325f
%files
3b325f
# not files here
3b325f
3b325f
%files runtime
3b325f
%doc README LICENSE
3b325f
%{_mandir}/man7/%{scl_name}.*
3b325f
%scl_files
3b325f
3b325f
%files build
3b325f
%{_root_sysconfdir}/rpm/macros.%{scl}-config
3b325f
3b325f
%files scldevel
3b325f
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
3b325f
3b325f
%changelog
3b325f
* Wed Jul 15 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 3.6-1
3b325f
- Initial commit for rh-git227.
3b325f
  Resolves: rhbz#1853404