Blame SPECS/rh-postgresql95.spec

36d550
# Define SCL name
36d550
%{!?scl_name_prefix: %global scl_name_prefix rh-}
36d550
%{!?scl_name_base: %global scl_name_base postgresql}
36d550
%{!?version_major: %global version_major 9}
36d550
%{!?version_minor: %global version_minor 5}
36d550
%{!?scl_name_version: %global scl_name_version %{version_major}%{version_minor}}
36d550
%{!?scl: %global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}}
36d550
36d550
# Turn on new layout -- prefix for packages and location
36d550
# for config and variable files
36d550
# This must be before calling %%scl_package
36d550
%{!?nfsmountable: %global nfsmountable 1}
36d550
36d550
# Define SCL macros
36d550
%{?scl_package:%scl_package %{scl}}
36d550
36d550
# do not produce empty debuginfo package
36d550
%global debug_package %{nil}
36d550
36d550
Summary: Package that installs %{scl}
36d550
Name: %{scl}
36d550
Version: 2.2
36d550
Release: 2%{?dist}
36d550
License: GPLv2+
36d550
Group: Applications/File
36d550
Source0: README
36d550
Source1: LICENSE
36d550
Requires: scl-utils
36d550
Requires: %{scl_prefix}postgresql-server
36d550
BuildRequires: scl-utils-build help2man
36d550
36d550
%description
36d550
This is the main package for %{scl} Software Collection, which installs
36d550
necessary packages to use PostgreSQL %{version_major}.%{version_minor} server.
36d550
Software Collections allow to install more versions of the same
36d550
package by using alternative directory structure.
36d550
Install this package if you want to use PostgreSQL %{version_major}.%{version_minor}
36d550
server on your system.
36d550
36d550
%package runtime
36d550
Summary: Package that handles %{scl} Software Collection.
36d550
Group: Applications/File
36d550
Requires: scl-utils
36d550
Requires(post): policycoreutils-python libselinux-utils
36d550
36d550
%description runtime
36d550
Package shipping essential scripts to work with %{scl} Software Collection.
36d550
36d550
%package build
36d550
Summary: Package shipping basic build configuration
36d550
Group: Applications/File
36d550
Requires: scl-utils-build
36d550
36d550
%description build
36d550
Package shipping essential configuration macros to build %{scl} Software
36d550
Collection or packages depending on %{scl} Software Collection.
36d550
36d550
%package scldevel
36d550
Summary: Package shipping development files for %{scl}
36d550
36d550
%description scldevel
36d550
Package shipping development files, especially usefull for development of
36d550
packages depending on %{scl} Software Collection.
36d550
36d550
%prep
36d550
%setup -c -T
36d550
36d550
# This section generates README file from a template and creates man page
36d550
# from that file, expanding RPM macros in the template file.
36d550
cat <<'EOF' | tee README
36d550
%{expand:%(cat %{SOURCE0})}
36d550
EOF
36d550
36d550
# copy the license file so %%files section sees it
36d550
cp %{SOURCE1} .
36d550
36d550
%build
36d550
# generate a helper script that will be used by help2man
36d550
cat <<'EOF' | tee h2m_helper
36d550
#!/bin/bash
36d550
[ "$1" == "--version" ] && echo "%{?scl_name} %{version} Software Collection" || cat README
36d550
EOF
36d550
chmod a+x h2m_helper
36d550
36d550
# generate the man page
36d550
help2man -N --section 7 ./h2m_helper -o %{?scl_name}.7
36d550
36d550
%install
36d550
%{?scl_install}
36d550
36d550
# create and own dirs not covered by %%scl_install and %%scl_files
36d550
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 15
36d550
mkdir -p %{buildroot}%{_mandir}/man{1,7,8}
36d550
%else
36d550
mkdir -p %{buildroot}%{_datadir}/aclocal
36d550
%endif
36d550
36d550
# create enable scriptlet that sets correct environment for collection
36d550
cat << EOF | tee -a %{buildroot}%{?_scl_scripts}/enable
36d550
# For binaries
36d550
export PATH="%{_bindir}\${PATH:+:\${PATH}}"
36d550
# For header files
36d550
export CPATH="%{_includedir}\${CPATH:+:\${CPATH}}"
36d550
# For libraries during build
36d550
export LIBRARY_PATH="%{_libdir}\${LIBRARY_PATH:+:\${LIBRARY_PATH}}"
36d550
# For libraries during linking
36d550
export LD_LIBRARY_PATH="%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}"
36d550
# For man pages; empty field makes man to consider also standard path
36d550
export MANPATH="%{_mandir}:\${MANPATH}"
36d550
# For Java Packages Tools to locate java.conf
36d550
export JAVACONFDIRS="%{_sysconfdir}/java:\${JAVACONFDIRS:-/etc/java}"
36d550
# For XMvn to locate its configuration file(s)
36d550
export XDG_CONFIG_DIRS="%{_sysconfdir}/xdg:\${XDG_CONFIG_DIRS:-/etc/xdg}"
36d550
# For systemtap
36d550
export XDG_DATA_DIRS="%{_datadir}\${XDG_DATA_DIRS:+:\${XDG_DATA_DIRS}}"
36d550
# For pkg-config
36d550
export PKG_CONFIG_PATH="%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
36d550
EOF
36d550
36d550
# generate rpm macros file for depended collections
36d550
cat << EOF | tee -a %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
36d550
%%scl_%{scl_name_base} %{scl}
36d550
%%scl_prefix_%{scl_name_base} %{?scl_prefix}
36d550
EOF
36d550
36d550
# install generated man page
36d550
mkdir -p %{buildroot}%{_mandir}/man7/
36d550
install -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/%{?scl_name}.7
36d550
36d550
%post runtime
36d550
# Simple copy of context from system root to SCL root.
36d550
# In case new version needs some additional rules or context definition,
36d550
# it needs to be solved in base system.
36d550
# semanage does not have -e option in RHEL-5, so we would
36d550
# have to have its own policy for collection.
36d550
semanage fcontext -a -e / %{?_scl_root} >/dev/null 2>&1 || :
36d550
semanage fcontext -a -e %{_root_sysconfdir} %{_sysconfdir} >/dev/null 2>&1 || :
36d550
semanage fcontext -a -e %{_root_localstatedir} %{_localstatedir} >/dev/null 2>&1 || :
36d550
36d550
selinuxenabled && load_policy || :
36d550
restorecon -R %{?_scl_root} >/dev/null 2>&1 || :
36d550
restorecon -R %{_sysconfdir} >/dev/null 2>&1 || :
36d550
restorecon -R %{_localstatedir} >/dev/null 2>&1 || :
36d550
36d550
%files
36d550
36d550
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 15
36d550
%files runtime -f filesystem
36d550
%else
36d550
%files runtime
36d550
%{_datadir}/aclocal
36d550
%endif
36d550
%doc README LICENSE
36d550
%{?scl_files}
36d550
36d550
%files build
36d550
%doc LICENSE
36d550
%{_root_sysconfdir}/rpm/macros.%{scl}-config
36d550
36d550
%files scldevel
36d550
%doc LICENSE
36d550
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
36d550
36d550
%changelog
36d550
* Thu Feb 11 2016 Honza Horak <hhorak@redhat.com> - 2.2-2
36d550
- Rebuild with newer scl-utils
36d550
36d550
* Fri Jan 29 2016 Pavel Kajaba <pkajaba@redhat.com> - 2.2-1
36d550
- Release bump
36d550
36d550
* Fri Mar 20 2015 Pavel Raiskup <praiskup@redhat.com> - 2.0-9
36d550
- move the postgresql-ctl context definition to main package
36d550
36d550
* Thu Mar 19 2015 Pavel Raiskup <praiskup@redhat.com> - 2.0-8
36d550
- fix SELinux context on starting binaries once more
36d550
36d550
* Wed Mar 18 2015 Pavel Raiskup <praiskup@redhat.com> - 2.0-7
36d550
- merge rhel6 & rhel7 rh-postgresql94 branches
36d550
36d550
* Wed Mar 18 2015 Pavel Raiskup <praiskup@redhat.com> - 2.0-6
36d550
- fix SELinux context on starting binaries
36d550
- rebuild for scl-utils change (#1200057)
36d550
36d550
* Wed Feb 18 2015 Honza Horak <hhorak@redhat.com> - 2.0-5
36d550
- Remove NFS register feature for questionable usage for DBs
36d550
36d550
* Thu Jan 29 2015 Jozef Mlich <jmlich@redhat.com> - 2.0-4
36d550
- %{_unitdir} is available only in RHEL7
36d550
36d550
* Mon Jan 26 2015 Honza Horak <hhorak@redhat.com> - 2.0-3
36d550
- Do not set selinux context  scl root during scl register
36d550
36d550
* Mon Jan 26 2015 Honza Horak <hhorak@redhat.com> - 2.0-2
36d550
- Use cat for README expansion, rather than include macro
36d550
36d550
* Sat Jan 17 2015 Honza Horak <hhorak@redhat.com>
36d550
- Apply many changes for new generation
36d550
36d550
* Mon Oct 13 2014 Honza Horak <hhorak@redhat.com> - 1.1-21
36d550
- Rebuild for s390x
36d550
  Resolves: #1152432
36d550
36d550
* Mon Mar 31 2014 Honza Horak <hhorak@redhat.com> - 1.1-20
36d550
- Fix path typo in README
36d550
  Related: #1061456
36d550
36d550
* Wed Feb 19 2014 Jozef Mlich <jmlich@redhat.com> - 1.1-19
36d550
- Release bump (and cherry pick from rhscl-1.1-postgresql92-rhel-7)
36d550
  Resloves: #1061456 
36d550
36d550
* Thu Feb 13 2014 Jozef Mlich <jmlich@redhat.com> - 1.1-18
36d550
- Resolves: #1058611 (postgresql92-build needs to depend
36d550
  on scl-utils-build)
36d550
- Add LICENSE, README and postgresql92.7 man page
36d550
  Resloves: #1061456 
36d550
36d550
* Wed Feb 12 2014 Honza Horak <hhorak@redhat.com> - 1.1-17
36d550
- Add -scldevel subpackage
36d550
  Resolves: #1063359
36d550
36d550
* Wed Dec 18 2013 Jozef Mlich <jmlich@redhat.com> 1-17
36d550
- release bump 
36d550
  Resolves #1038693
36d550
36d550
* Tue Nov 26 2013 Jozef Mlich <jmlich@redhat.com> 1-16
36d550
- By default, patch(1) creates backup files when chunks apply with offsets.
36d550
  Turn that off to ensure such files don't get included in RPMs.
36d550
36d550
* Fri Nov 22 2013 Honza Horak <hhorak@redhat.com> 1-15
36d550
- Rename variable to match postgresql package
36d550
36d550
* Mon Nov 18 2013 Jozef Mlich <jmlich@redhat.com> 1-14
36d550
- release bump
36d550
36d550
* Wed Oct  9 2013 Jozef Mlich <jmlich@redhat.com> 1-13
36d550
- release bump to scl 1.1
36d550
36d550
* Wed May 22 2013 Honza Horak <hhorak@redhat.com> 1-12
36d550
- Run semanage on whole root, BZ#956981 is fixed now
36d550
- Require semanage utility to be installed for -runtime package
36d550
- Fix MANPATH definition, colon in the end is correct (it means default)
36d550
  Resolves: BZ#966382
36d550
36d550
* Fri May  3 2013 Honza Horak <hhorak@redhat.com> 1-11
36d550
- Run semanage for all directories separately, since it has
36d550
  problems with definition for whole root
36d550
36d550
* Thu May  2 2013 Honza Horak <hhorak@redhat.com> 1-10
36d550
- Handle context of the init script
36d550
- Add better descriptions for packages
36d550
36d550
* Fri Apr 26 2013 Honza Horak <hhorak@redhat.com> 1-9
36d550
- fix escaping in PATH variable definition
36d550
36d550
* Mon Apr  8 2013 Honza Horak <hhorak@redhat.com> 1-8
36d550
- Don't require policycoreutils-python in RHEL-5 or older
36d550
- Require postgresql-server from the collection as main package
36d550
- Build separately on all arches
36d550
- Fix Environment variables definition
36d550
36d550
* Wed Feb 20 2013 Honza Horak <hhorak@redhat.com> 1-7
36d550
- Use %%setup macro to create safer build environment
36d550
36d550
* Fri Nov 09 2012 Honza Horak <hhorak@redhat.com> 1-6
36d550
- rename spec file to correspond with package name
36d550
36d550
* Thu Nov 08 2012 Honza Horak <hhorak@redhat.com> 1-5
36d550
- Mark service-environment as a config file
36d550
36d550
* Thu Oct 25 2012 Honza Horak <hhorak@redhat.com> 1-5
36d550
- create service-environment file to hold information about all collections,
36d550
  that should be enabled when service is starting
36d550
- added policycoreutils-python for semanage -e
36d550
36d550
* Thu Oct 18 2012 Honza Horak <hhorak@redhat.com> 1-3
36d550
- copy SELinux context from core mysql files
36d550
36d550
* Wed Oct 03 2012 Honza Horak <hhorak@redhat.com> 1-2
36d550
- update to postgresql-9.2 and rename to postgresql92
36d550
36d550
* Mon Mar 19 2012 Honza Horak <hhorak@redhat.com> 1-1
36d550
- initial packaging
36d550