Blame SPECS/rh-postgresql96.spec

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