Blame SPECS/rh-postgresql13.spec

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