Blame SPECS/rh-postgresql12.spec

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