Blame SPECS/rh-postgresql94.spec

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