Blame SPECS/git19.spec

f7ed20
%{!?scl_name_base:%global scl_name_base git}
f7ed20
%{!?scl_name_version:%global scl_name_version 19}
f7ed20
# particularly useful for mock
f7ed20
%{!?scl:%global scl %{scl_name_base}%{scl_name_version}}
f7ed20
%scl_package %scl
f7ed20
# do not produce empty debuginfo package (https://bugzilla.redhat.com/show_bug.cgi?id=1061439#c2)
f7ed20
%global debug_package %{nil}
f7ed20
f7ed20
f7ed20
Summary: Package that installs %scl
f7ed20
Name: %scl_name
f7ed20
# should match the RHSCL version
f7ed20
Version: 1.2
f7ed20
Release: 4%{?dist}
f7ed20
Group: Applications/File
f7ed20
Source0: README
f7ed20
Source1: LICENSE
f7ed20
License: GPLv2+
f7ed20
Requires: scl-utils
f7ed20
Requires: %{scl_prefix}git
f7ed20
BuildRequires: scl-utils-build, help2man
f7ed20
f7ed20
%description
f7ed20
This is the main package for %scl Software Collection, which install
f7ed20
the necessary packages to use git-1.9.4. Software collections allow
f7ed20
to install more versions of the same package by using an alternative
f7ed20
directory structure.
f7ed20
Install this package if you want to use git-1.9.4 on your system.
f7ed20
f7ed20
%package runtime
f7ed20
Summary: Package that handles %scl Software Collection.
f7ed20
Group: Applications/File
f7ed20
Requires: scl-utils
f7ed20
# e.g. scl-utils 20120927-8.el6_5
f7ed20
Requires: /usr/bin/scl_source
f7ed20
Requires(post): policycoreutils-python, libselinux-utils
f7ed20
f7ed20
%description runtime
f7ed20
Package shipping essential scripts to work with %scl Software Collection.
f7ed20
f7ed20
%package build
f7ed20
Summary: Package shipping basic build configuration
f7ed20
Requires: %{name}-runtime = %{version}
f7ed20
Requires: scl-utils-build
f7ed20
Group: Applications/File
f7ed20
f7ed20
%description build
f7ed20
Package shipping essential configuration macros to build
f7ed20
%scl Software Collection.
f7ed20
f7ed20
%package scldevel
f7ed20
Summary: Package shipping development files for %scl.
f7ed20
Group: Applications/File
f7ed20
f7ed20
%description scldevel
f7ed20
Development files for %scl (useful e.g. for hierarchical collection
f7ed20
building with transitive dependencies).
f7ed20
f7ed20
%prep
f7ed20
%setup -c -T
f7ed20
f7ed20
cat > README <<\EOF
f7ed20
%{expand:%(cat %{SOURCE0})}
f7ed20
EOF
f7ed20
# copy the license file so %%files section sees it
f7ed20
cp %{SOURCE1} .
f7ed20
f7ed20
%build
f7ed20
# temporary helper script used by help2man
f7ed20
cat > h2m_helper <<\EOF
f7ed20
#!/bin/sh
f7ed20
if [ "$1" = "--version" ]; then
f7ed20
  printf '%%s' "%{scl_name} %{version} Software Collection"
f7ed20
else
f7ed20
  cat README
f7ed20
fi
f7ed20
EOF
f7ed20
chmod a+x h2m_helper
f7ed20
# generate the man page
f7ed20
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
f7ed20
f7ed20
%install
f7ed20
rm -rf %{buildroot}
f7ed20
mkdir -p %{buildroot}%{_scl_scripts}/root
f7ed20
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
f7ed20
export PATH=%{_bindir}\${PATH:+:\${PATH}}
f7ed20
export MANPATH=%{_mandir}:\${MANPATH}
f7ed20
EOF
f7ed20
f7ed20
# install generated man page
f7ed20
install -d -m 755               %{buildroot}%{_mandir}/man7
f7ed20
install -p -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/
f7ed20
f7ed20
%scl_install
f7ed20
f7ed20
# scldevel garbage
f7ed20
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
f7ed20
%%scl_%{scl_name_base} %{scl}
f7ed20
%%scl_prefix_%{scl_name_base} %{scl_prefix}
f7ed20
EOF
f7ed20
f7ed20
%post runtime
f7ed20
# Simple copy of context from system root to DSC root.
f7ed20
# In case new version needs some additional rules or context definition,
f7ed20
# it needs to be solved.
f7ed20
semanage fcontext -a -e /var/log/mongodb /var/log/%{scl_prefix}mongodb >/dev/null 2>&1 || :
f7ed20
semanage fcontext -a -e /usr/libexec/git-core/git-daemon /usr/libexec/git-core/%{scl_prefix}git-daemon >/dev/null 2>&1 || :
f7ed20
semanage fcontext -a -e / %{_scl_root} >/dev/null 2>&1 || :
f7ed20
selinuxenabled && load_policy >/dev/null 2>&1 || :
f7ed20
restorecon -R %{_scl_root} >/dev/null 2>&1 || :
f7ed20
f7ed20
%files
f7ed20
f7ed20
%files runtime
f7ed20
%doc README LICENSE
f7ed20
%{_mandir}/man7/%{scl_name}.*
f7ed20
%scl_files
f7ed20
f7ed20
%files build
f7ed20
%{_root_sysconfdir}/rpm/macros.%{scl}-config
f7ed20
f7ed20
%files scldevel
f7ed20
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
f7ed20
f7ed20
%changelog
f7ed20
* Tue Aug 12 2014 Ondrej Oprala <ooprala@redhat.com> 1.2-4
f7ed20
- Resolves: #1130241 - safely set PATH
f7ed20
f7ed20
* Tue Aug 12 2014 Ondrej Oprala <ooprala@redhat.com> 1.2-3
f7ed20
- Resolves: #1128115 - set MANPATH
f7ed20
f7ed20
* Wed Jun 11 2014 Ondrej Oprala <ooprala@redhat.com> 1-2
f7ed20
- Bump the git version mentioned in description
f7ed20
f7ed20
* Tue May 20 2014 Ondrej Oprala <ooprala@redhat.com> 1-1
f7ed20
- Initial commit