Blame SPECS/rh-postgresql10.spec

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