rebuilt with systemd support [release 13.1-2mamba;Sun Jan 31 2021]

This commit is contained in:
Silvan Calarco 2024-01-06 10:27:02 +01:00
parent 243f9497d3
commit 054aec2bdd
5 changed files with 110 additions and 87 deletions

View File

@ -2,7 +2,6 @@
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
PostgreSQL is an open-source descendant of this original Berkeley code. PostgreSQL is an open-source descendant of this original Berkeley code.
It provides SQL92/SQL99 language support and other modern features. It provides SQL92/SQL99 language support and other modern features.

View File

@ -0,0 +1,12 @@
diff -upr postgresql-13.1.orig/src/include/pg_config_manual.h postgresql-13.1/src/include/pg_config_manual.h
--- postgresql-13.1.orig/src/include/pg_config_manual.h 2020-11-10 00:24:30.000000000 +0200
+++ postgresql-13.1/src/include/pg_config_manual.h 2020-12-10 01:55:35.999605194 +0200
@@ -201,7 +201,7 @@
* support them yet.
*/
#ifndef WIN32
-#define DEFAULT_PGSOCKET_DIR "/tmp"
+#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
#else
#define DEFAULT_PGSOCKET_DIR ""
#endif

42
postgresql.service Normal file
View File

@ -0,0 +1,42 @@
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=notify
TimeoutSec=120
User=postgres
Group=postgres
Environment=PGROOT=/var/lib/pgsql
SyslogIdentifier=postgres
PIDFile=/var/lib/pgsql/data/postmaster.pid
RuntimeDirectory=postgresql
RuntimeDirectoryMode=755
ExecStart=/usr/bin/postgres -D ${PGROOT}/data
ExecReload=/bin/kill -HUP ${MAINPID}
KillMode=mixed
KillSignal=SIGINT
# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
# killing Postgres, so adjust it downward
OOMScoreAdjust=-200
# Additional security-related features
PrivateTmp=true
ProtectHome=true
ProtectSystem=full
NoNewPrivileges=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
PrivateDevices=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target

View File

@ -4,7 +4,7 @@
Name: postgresql Name: postgresql
Version: 13.1 Version: 13.1
Release: 1mamba Release: 2mamba
Summary: An object-relational database management system (ORDBMS) Summary: An object-relational database management system (ORDBMS)
Group: Applications/Databases Group: Applications/Databases
Vendor: openmamba Vendor: openmamba
@ -13,33 +13,34 @@ Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.postgresql.org URL: http://www.postgresql.org
Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
Source1: postgresql-initscript Source1: postgresql-initscript
#Source2: http://www.postgresql.org/files/documentation/pdf/%{majver}/postgresql-%{majver}-US.pdf Source2: postgresql.service
Source3: postgresql.tmpfiles
Patch0: postgresql-13.1-run-socket.patch
License: BSD License: BSD
BuildRequires: flex
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libe2fs-devel BuildRequires: ldconfig
BuildRequires: libkrb5-devel BuildRequires: libkrb5-devel
BuildRequires: libncurses-devel
BuildRequires: libopenldap-devel BuildRequires: libopenldap-devel
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: libpython-devel BuildRequires: libpam-devel
BuildRequires: libperl
BuildRequires: libpython3-devel
BuildRequires: libreadline-devel BuildRequires: libreadline-devel
BuildRequires: libsystemd-devel
BuildRequires: libtcl-devel BuildRequires: libtcl-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: libz-devel BuildRequires: libz-devel
BuildRequires: pam-devel
BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires(pre): /usr/sbin/groupadd, /usr/sbin/useradd, /sbin/chkconfig BuildRequires: flex
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
%systemd_requires
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: lib%{name} == %{version}
%description %description
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
PostgreSQL is an open-source descendant of this original Berkeley code. PostgreSQL is an open-source descendant of this original Berkeley code.
It provides SQL92/SQL99 language support and other modern features. It provides SQL92/SQL99 language support and other modern features.
@ -50,94 +51,79 @@ Group: System/Libraries
%description -n lib%{name} %description -n lib%{name}
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
This package contains the libraries used by postgresql. This package contains the libraries used by postgresql.
%package -n lib%{name}-devel %package -n lib%{name}-devel
Summary: Devel files for PostgreSQL Summary: Devel files for PostgreSQL
Group: Development/Libraries Group: Development/Libraries
Requires: lib%{name} = %{version} Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: %{name}-devel = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: %{name}-devel Obsoletes: %{name}-devel
Provides: %{name}-devel == %{version}
%description -n lib%{name}-devel %description -n lib%{name}-devel
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
This package contains static libraries and header files needed for development.
This package contains static libraries and header files need for development.
%package server %package server
Summary: PostgreSQL DBMS server Summary: PostgreSQL DBMS server
Group: System/Database Group: System/Database
Requires: %{name} = %{version} Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description server %description server
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
PostgreSQL is an open-source descendant of this original Berkeley code. PostgreSQL is an open-source descendant of this original Berkeley code.
It provides SQL92/SQL99 language support and other modern features. It provides SQL92/SQL99 language support and other modern features.
This package provides the DBMS server.
This is the DBMS server.
%package tcltk %package tcltk
Summary: PostgreSQL Tcl/Tk interface Summary: PostgreSQL Tcl/Tk interface
Group: Graphical Desktop/Applications/Databases Group: Graphical Desktop/Applications/Databases
Requires: %{name} = %{version} Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description tcltk %description tcltk
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
This package contains the Tcl/Tk interface. This package contains the Tcl/Tk interface.
%package contrib %package contrib
Summary: Contributed source and binaries distributed with PostgreSQL Summary: Contributed source and binaries distributed with PostgreSQL
Group: Applications/Databases Group: Applications/Databases
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description contrib %description contrib
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
The postgresql-contrib package contains contributed packages that are included in the PostgreSQL distribution.
The postgresql-contrib package contains contributed packages that are
included in the PostgreSQL distribution.
%package test %package test
Summary: The test suite distributed with PostgreSQL Summary: The test suite distributed with PostgreSQL
Group: Applications/Databases Group: Applications/Databases
Requires: %{name}-server = %{version}-%{release} Requires: %{name}-server = %{?epoch:%epoch:}%{version}-%{release}
%description test %description test
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
The postgresql-test package includes the sources and pre-built binaries of various tests for the PostgreSQL database management system, including regression tests and benchmarks.
The postgresql-test package includes the sources and pre-built
binaries of various tests for the PostgreSQL database management
system, including regression tests and benchmarks.
%package docs %package docs
Summary: Extra documentation for PostgreSQL Summary: Extra documentation for PostgreSQL
Group: Documentation Group: Documentation
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description docs %description docs
PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.
The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc. The POSTGRES project, led by Professor Michael Stonebraker, was sponsored by the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc.
The postgresql-docs package includes some additional documentation for PostgreSQL. Currently, this includes the main documentation in PDF format, the FAQ, and source files for the PostgreSQL tutorial.
The postgresql-docs package includes some additional documentation for
PostgreSQL. Currently, this includes the main documentation in PDF format,
the FAQ, and source files for the PostgreSQL tutorial.
%debug_package %debug_package
%prep %prep
%setup -q %setup -q
#cp -p %{SOURCE2} . %patch0 -p1
%build %build
CFLAGS="%{optflags} -ltermcap"; export CFLAGS
PYTHON=%{__python} \
%configure \ %configure \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
@ -151,7 +137,10 @@ PYTHON=%{__python} \
--with-perl \ --with-perl \
--with-ldap \ --with-ldap \
--with-krb5 \ --with-krb5 \
--with-gssapi --with-gssapi \
--with-systemd \
PYTHON=%{__python3}
# --with-bonjour # --with-bonjour
%make %make
@ -187,25 +176,12 @@ strip *.so
install -d -m 755 %{buildroot}%{_libdir}/postgresql/tutorial install -d -m 755 %{buildroot}%{_libdir}/postgresql/tutorial
cp src/tutorial/* %{buildroot}%{_libdir}/postgresql/tutorial cp src/tutorial/* %{buildroot}%{_libdir}/postgresql/tutorial
# Fix some more documentation install -d %{buildroot}/var/lib/pgsql/data
#mv %{buildroot}%{_docdir}/pgsql/html doc install -D -m0755 %{SOURCE2} %{buildroot}%{_unitdir}/postgresql.service
#rm -rf %{buildroot}%{_docdir}/pgsql install -D -m0755 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/postgresql.conf
install -d %{buildroot}/var/pgsql/data
install -D -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/postgresql
#mv %{buildroot}%{_includedir}/postgresql/informix/esql/sqltypes.h \
# %{buildroot}%{_includedir}/postgresql/informix/esql/sqltypes-postgres.h
%find_lang %{name} --with-qt --with-man --all-name || touch %{name}.lang %find_lang %{name} --with-qt --with-man --all-name || touch %{name}.lang
#%define lang_files pg_basebackup pg_ctl psql plperl postgres plpgsql plpython pltcl pgscripts ecpg initdb pg_dump pg_config pg_controldata pg_resetxlog libpq5 ecpglib6 pg_rewind
#
#> %{name}-all.lang
#for lang_file in %{lang_files}
# do %find_lang ${lang_file}-%{majver}
# cat ${lang_file}-%{majver}.lang >> %{name}-all.lang
#done
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -213,31 +189,28 @@ install -D -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/postgresql
if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
/usr/sbin/groupadd postgres -g %{groupid} 2>/dev/null /usr/sbin/groupadd postgres -g %{groupid} 2>/dev/null
/usr/sbin/useradd -u %{userid} -g postgres \ /usr/sbin/useradd -u %{userid} -g postgres \
-d /var/pgsql/data -c 'PostgreSQL Server' \ -d /var/lib/pgsql/data -c 'PostgreSQL Server' \
-s /bin/false postgres 2>/dev/null -s /bin/false postgres 2>/dev/null
fi fi
: :
%post server %post server
[ -e /var/pgsql/data/PG_VERSION ] || su -s /bin/sh - postgres -c "%{_bindir}/initdb -D /var/pgsql/data >/dev/null" [ -e /var/lib/pgsql/data/PG_VERSION ] || su -s /bin/sh - postgres -c "%{_bindir}/initdb -D /var/lib/pgsql/data >/dev/null"
if [ $1 -eq 1 ]; then %tmpfiles_create named.conf
/sbin/chkconfig --add postgresql %systemd_post postgresql
service postgresql start
fi
: :
%preun server %preun server
if [ $1 -eq 0 ]; then %systemd_preun postgresql
service postgresql stop
/sbin/chkconfig --del postgresql
/usr/sbin/userdel postgres
fi
: :
%postun server %postun server
if [ $1 -eq 1 ]; then %systemd_postun_with_restart postgresql
service postgresql restart :
fi
%posttrans
# clean broken old sysv links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
: :
%files -f %{name}.lang %files -f %{name}.lang
@ -255,14 +228,16 @@ fi
%dir %{_datadir}/doc/postgresql %dir %{_datadir}/doc/postgresql
%{_datadir}/doc/postgresql/* %{_datadir}/doc/postgresql/*
#%{_mandir}/man1/* #%{_mandir}/man1/*
%doc COPYRIGHT HISTORY INSTALL README %doc COPYRIGHT
%files server %files server
%defattr(-,root,root) %defattr(-,root,root)
%attr(755,root,root) %{_initrddir}/postgresql
%{_bindir}/postmaster %{_bindir}/postmaster
%{_bindir}/postgres %{_bindir}/postgres
%attr(700,postgres,root) %dir %{_localstatedir}/pgsql/data %{_unitdir}/postgresql.service
%{_tmpfilesdir}/postgresql.conf
%dir %dir %{_localstatedir}/lib/pgsql
%attr(700,postgres,root) %dir %{_localstatedir}/lib/pgsql/data
%files -n lib%{name} %files -n lib%{name}
%defattr(-,root,root) %defattr(-,root,root)
@ -296,10 +271,6 @@ fi
%exclude %{_libdir}/postgresql/seg.so %exclude %{_libdir}/postgresql/seg.so
%exclude %{_libdir}/postgresql/sslinfo.so %exclude %{_libdir}/postgresql/sslinfo.so
%exclude %{_libdir}/postgresql/tablefunc.so %exclude %{_libdir}/postgresql/tablefunc.so
#%exclude %{_libdir}/postgresql/test_parser.so
#%exclude %{_libdir}/postgresql/timetravel.so
#%exclude %{_libdir}/postgresql/tsearch2.so
#%exclude %{_libdir}/postgresql/pgxml.so
%{_datadir}/postgresql/* %{_datadir}/postgresql/*
%files -n lib%{name}-devel %files -n lib%{name}-devel
@ -319,6 +290,7 @@ fi
%{_libdir}/pkgconfig/libecpg_compat.pc %{_libdir}/pkgconfig/libecpg_compat.pc
%{_libdir}/pkgconfig/libpgtypes.pc %{_libdir}/pkgconfig/libpgtypes.pc
%{_libdir}/pkgconfig/libpq.pc %{_libdir}/pkgconfig/libpq.pc
%doc HISTORY INSTALL README
#%files tcltk #%files tcltk
#%defattr(-,root,root) #%defattr(-,root,root)
@ -356,13 +328,7 @@ fi
%{_libdir}/postgresql/seg.so %{_libdir}/postgresql/seg.so
%{_libdir}/postgresql/sslinfo.so %{_libdir}/postgresql/sslinfo.so
%{_libdir}/postgresql/tablefunc.so %{_libdir}/postgresql/tablefunc.so
#%{_libdir}/postgresql/test_parser.so
#%{_libdir}/postgresql/timetravel.so
#%{_libdir}/postgresql/tsearch2.so
#%{_libdir}/postgresql/pgxml.so
#%{_datadir}/pgsql/contrib/
%{_bindir}/oid2name %{_bindir}/oid2name
#%{_bindir}/pg_standby
%{_bindir}/pgbench %{_bindir}/pgbench
%{_bindir}/vacuumlo %{_bindir}/vacuumlo
@ -379,6 +345,9 @@ fi
%{_libdir}/postgresql/tutorial/* %{_libdir}/postgresql/tutorial/*
%changelog %changelog
* Sun Jan 31 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 13.1-2mamba
- rebuilt with systemd support
* Fri Nov 13 2020 Automatic Build System <autodist@mambasoft.it> 13.1-1mamba * Fri Nov 13 2020 Automatic Build System <autodist@mambasoft.it> 13.1-1mamba
- automatic version update by autodist - automatic version update by autodist

1
postgresql.tmpfiles Normal file
View File

@ -0,0 +1 @@
d /run/postgresql 700 postgres postgres