diff --git a/postgresql16.spec b/postgresql16.spec index 3fcc01a8a270667b7dd3dd38485994686b2ae1a0..e826635d7c6d58e95bde9ba972e071acf021af3d 100644 --- a/postgresql16.spec +++ b/postgresql16.spec @@ -1,1246 +1,1253 @@ -# This spec file and ancillary files are licensed in accordance with -# The PostgreSQL license. - -# In this file you can find the default build package list macros. -# These can be overridden by defining on the rpm command line: -# rpm --define 'packagename 1' .... to force the package to build. -# rpm --define 'packagename 0' .... to force the package NOT to build. -# The base package, the libs package, the devel package, and the server package -# always get built. - -%{!?test:%global test 1} -# enable llvmjit, due to citus-llvmjit -%{!?llvmjit:%global llvmjit 1} -%{!?external_libpq:%global external_libpq 0} -%{!?upgrade:%global upgrade 1} -%{!?plpython3:%global plpython3 1} -%{!?pltcl:%global pltcl 1} -%{!?plperl:%global plperl 1} -%{!?ssl:%global ssl 1} -%{!?icu:%global icu 1} -%{!?kerberos:%global kerberos 1} -%{!?ldap:%global ldap 1} -%{!?nls:%global nls 1} -%{!?uuid:%global uuid 1} -%{!?xml:%global xml 1} -%{!?pam:%global pam 1} -%{!?sdt:%global sdt 1} -%{!?selinux:%global selinux 1} -%{!?runselftest:%global runselftest 1} -%{!?postgresql_default:%global postgresql_default 0} - -%global majorname postgresql -%global majorversion 16 - -%global _default_patch_flags --no-backup-if-mismatch -%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) -%global __provides_exclude_from %{_libdir}/(pgsql|pkgconfig) -%undefine _package_note_file - -%global prevmajorversion 15 -%global prevversion %{prevmajorversion}.5 -%global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion} -%global precise_version %version-%release -%global setup_version 8.9 - -%global service_name postgresql.service - - -Summary: PostgreSQL client programs -Name: %{majorname}%{majorversion} -Version: 16.10 -Release: 2%{?dist} -License: PostgreSQL -Url: http://www.postgresql.org/ -Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 -Source1: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2 -Source2: https://github.com/devexp-db/postgresql-setup/releases/download/v%{setup_version}/postgresql-setup-%{setup_version}.tar.gz -Source3: Makefile.regress -Source4: postgresql.tmpfiles.d -Source5: postgresql.pam -Source6: postgresql-bashprofile - -Patch3001: rpm-pgsql.patch -Patch3002: postgresql-logging.patch -Patch3003: postgresql-var-run-socket.patch -Patch3004: postgresql-server-pg_config.patch -Patch3005: postgresql-pgcrypto-openssl3-tests.patch -Patch3031: postgresql-external-libpq.patch -Patch3032: postgresql-no-libecpg.patch -Patch3040: 0001-modify-CodeMode-on-loongarch64.patch - -%define majorversion %(echo %{version} | cut -d. -f1) - -# This macro is used for package names in the files section -%if %?postgresql_default -%global pkgname %{majorname} -%package -n %{pkgname} -Summary: PostgreSQL client programs -%else -%global pkgname %{majorname}%{majorversion} -%endif - -BuildRequires: make gcc bison flex m4 gawk glibc-devel elinks -BuildRequires: perl(ExtUtils::MakeMaker) perl(ExtUtils::Embed) perl(Opcode) -BuildRequires: perl-generators perl-devel -BuildRequires: readline-devel zlib-devel lz4-devel -BuildRequires: systemd systemd-devel util-linux -BuildRequires: docbook-style-xsl docbook-utils help2man -%if %external_libpq -BuildRequires: libpq-devel >= %version -%endif - -%if %plpython3 -BuildRequires: python3-devel -%endif - -%if %pltcl -BuildRequires: tcl-devel -%endif - -%if %ssl -BuildRequires: openssl-devel -%endif - -%if %kerberos -BuildRequires: krb5-devel -%endif - -%if %ldap -BuildRequires: openldap-devel -%endif - -%if %nls -BuildRequires: gettext >= 0.10.35 -%endif - -%if %uuid -BuildRequires: uuid-devel -%endif - -%if %xml -BuildRequires: libxml2-devel libxslt-devel -%endif - -%if %pam -BuildRequires: pam-devel -%endif - -%if %sdt -BuildRequires: systemtap-sdt-devel -%endif - -%if %selinux -BuildRequires: libselinux-devel -%endif - -%if %icu -BuildRequires: libicu-devel -%endif - -%if %?postgresql_default -%define postgresqlXX_if_default() %{expand:\ -Provides: postgresql%{majorversion}%{?1:-%{1}} = %precise_version\ -Provides: postgresql%{majorversion}%{?1:-%{1}}%{?_isa} = %precise_version\ -} -%else -%define postgresqlXX_if_default() %{nil} -%endif - -%if %?postgresql_default -%define conflict_with_other_streams() %{expand:\ -Provides: %{majorname}%{?1:-%{1}}-any\ -Conflicts: %{majorname}%{?1:-%{1}}-any\ -} -%else -%define conflict_with_other_streams() %{expand:\ -Provides: %{majorname}%{?1:-%{1}}-any\ -Conflicts: %{majorname}%{?1:-%{1}}-any\ -Conflicts: %{majorname}%{?1:-%{1}}\ -} -%endif - -%define virtual_conflicts_and_provides() %{expand:\ -%conflict_with_other_streams %{**}\ -%postgresqlXX_if_default %{**}\ -} - -Provides: %{pkgname} = %precise_version - -%virtual_conflicts_and_provides - -%description -%description -n %{pkgname} -PostgreSQL is an advanced Object-Relational database management system (DBMS). -The base postgresql package contains the client programs that you'll need to -access a PostgreSQL DBMS server, as well as HTML documentation for the whole -system. These client programs can be located on the same machine as the -PostgreSQL server, or on a remote machine that accesses a PostgreSQL server -over a network connection. The PostgreSQL server can be found in the -postgresql-server sub-package. - - -%if ! %external_libpq -%package -n %{pkgname}-private-libs -Summary: The shared libraries required only for this build of PostgreSQL server -Requires(post): glibc -Requires(postun): glibc -Provides: %{pkgname}-private-libs = %precise_version - -%virtual_conflicts_and_provides private-libs - -%description -n %{pkgname}-private-libs -The postgresql-private-libs package provides the shared libraries for this -build of PostgreSQL server and plugins build with this version of server. -For shared libraries used by client packages that need to connect to a -PostgreSQL server, install libpq package instead. - - -%package -n %{pkgname}-private-devel -Summary: PostgreSQL development header files for this build of PostgreSQL server -Requires: %{pkgname}-private-libs = %precise_version -Conflicts: libpq-devel -Provides: %{pkgname}-devel = %precise_version - -%virtual_conflicts_and_provides private-devel - -%description -n %{pkgname}-private-devel -The postgresql-private-devel package contains the header files and libraries -needed to compile C or C++ applications which will directly interact -with a PostgreSQL database management server. -You need to install this package if you want to develop applications which -will interact with a PostgreSQL server. -%endif - - -%package -n %{pkgname}-server -Summary: The programs needed to create and run a PostgreSQL server -BuildRequires: util-linux -Requires: %{pkgname} = %precise_version -Requires(pre): /usr/sbin/useradd -Requires: util-linux -Requires: systemd -%{?systemd_requires} -Provides: %{pkgname}-server(:MODULE_COMPAT_%{majorversion}) -Provides: bundled(postgresql-setup) = %setup_version -Provides: %{pkgname}-server = %precise_version - -%virtual_conflicts_and_provides server - -%description -n %{pkgname}-server -PostgreSQL is an advanced Object-Relational database management system (DBMS). -The postgresql-server package contains the programs needed to create -and run a PostgreSQL server, which will in turn allow you to create -and maintain PostgreSQL databases. - - -%package -n %{pkgname}-docs -Summary: Extra documentation for PostgreSQL -Requires: %{pkgname} = %precise_version -Provides: %{pkgname}-doc = %precise_version - -%virtual_conflicts_and_provides docs - -%description -n %{pkgname}-docs -The postgresql-docs package contains some additional documentation for -PostgreSQL. Currently, this includes the main documentation in PDF format -and source files for the PostgreSQL tutorial. - - -%package -n %{pkgname}-contrib -Summary: Extension modules distributed with PostgreSQL -Requires: %{pkgname} = %precise_version -Provides: %{pkgname}-contrib = %precise_version - -%virtual_conflicts_and_provides contrib - -%description -n %{pkgname}-contrib -The postgresql-contrib package contains various extension modules that are -included in the PostgreSQL distribution. - - -%package -n %{pkgname}-server-devel -Summary: PostgreSQL development header files and libraries -%if %icu -Requires: libicu-devel -%endif -%if %kerberos -Requires: krb5-devel -%endif -%if %llvmjit -Requires: clang-devel llvm-devel -%endif -%if %external_libpq -# Some extensions require libpq -# Do not make them care about whether server uses private or system-wide -# libpq, simply let the server pull the correct one -Requires: libpq-devel -%else -Requires: %{pkgname}-private-devel -%endif -Provides: %{pkgname}-server-devel = %precise_version - -%virtual_conflicts_and_provides server-devel - -%description -n %{pkgname}-server-devel -The postgresql-server-devel package contains the header files and configuration -needed to compile PostgreSQL server extension. - - -%package -n %{pkgname}-test-rpm-macros -Summary: Convenience RPM macros for build-time testing against PostgreSQL server -Requires: %{pkgname}-server = %precise_version -BuildArch: noarch -Provides: %{pkgname}-test-rpm-macros = %precise_version - -%conflict_with_other_streams test-rpm-macros - -%description -n %{pkgname}-test-rpm-macros -This package is meant to be added as BuildRequires: dependency of other packages -that want to run build-time testsuite against running PostgreSQL server. - - -%package -n %{pkgname}-static -Summary: Statically linked PostgreSQL libraries -Requires: %{pkgname}-server-devel = %precise_version -Provides: %{pkgname}-static = %precise_version - -%virtual_conflicts_and_provides static - -%description -n %{pkgname}-static -Statically linked PostgreSQL libraries that do not have dynamically linked -counterparts. - - -%if %upgrade -%package -n %{pkgname}-upgrade -Summary: Support for upgrading from the previous major release of PostgreSQL -Requires: %{pkgname}-server = %precise_version -Provides: bundled(postgresql-server) = %prevversion -Provides: %{pkgname}-upgrade = %precise_version - -%virtual_conflicts_and_provides upgrade - -%description -n %{pkgname}-upgrade -The postgresql-upgrade package contains the pg_upgrade utility and supporting -files needed for upgrading a PostgreSQL database from the previous major -version of PostgreSQL. - - -%package -n %{pkgname}-upgrade-devel -Summary: Support for build of extensions required for upgrade process -Requires: %{pkgname}-upgrade = %precise_version -Provides: %{pkgname}-upgrade-devel = %precise_version - -%virtual_conflicts_and_provides upgrade-devel - -%description -n %{pkgname}-upgrade-devel -The postgresql-devel package contains the header files and libraries -needed to compile C or C++ applications which are necessary in upgrade -process. -%endif - - -%if %plperl -%package -n %{pkgname}-plperl -Summary: The Perl procedural language for PostgreSQL -Requires: %{pkgname}-server = %precise_version -%if %runselftest -BuildRequires: perl(Opcode) perl(Data::Dumper) -%endif -Provides: %{pkgname}-plperl = %precise_version - -%virtual_conflicts_and_provides plperl - -%description -n %{pkgname}-plperl -The postgresql-plperl package contains the PL/Perl procedural language, -which is an extension to the PostgreSQL database server. -Install this if you want to write database functions in Perl. -%endif - - -%if %plpython3 -%package -n %{pkgname}-plpython3 -Summary: The Python3 procedural language for PostgreSQL -Requires: %{pkgname}-server = %precise_version -Provides: %{pkgname}-plpython3 = %precise_version - -%virtual_conflicts_and_provides python3 - -%description -n %{pkgname}-plpython3 -The postgresql-plpython3 package contains the PL/Python3 procedural language, -which is an extension to the PostgreSQL database server. -Install this if you want to write database functions in Python 3. -%endif - - -%if %pltcl -%package -n %{pkgname}-pltcl -Summary: The Tcl procedural language for PostgreSQL -Requires: %{pkgname}-server = %precise_version -Provides: %{pkgname}-pltcl = %precise_version - -%virtual_conflicts_and_provides plctl - -%description -n %{pkgname}-pltcl -The postgresql-pltcl package contains the PL/Tcl procedural language, -which is an extension to the PostgreSQL database server. -Install this if you want to write database functions in Tcl. -%endif - - -%if %test -%package -n %{pkgname}-test -Summary: The test suite distributed with PostgreSQL -Requires: %{pkgname}-server = %precise_version -Requires: %{pkgname}-server-devel = %precise_version -Requires: %{pkgname}-contrib = %precise_version -Provides: %{pkgname}-test = %precise_version - -%virtual_conflicts_and_provides test - -%description -n %{pkgname}-test -The postgresql-test package contains files needed for various tests for the -PostgreSQL database management system, including regression tests and -benchmarks. -%endif - -%if %llvmjit -%package -n %{pkgname}-llvmjit -Summary: Just-in-time compilation support for PostgreSQL -Requires: %{pkgname}-server = %{version}-%{release} -Requires: llvm => 5.0 -Provides: postgresql-llvmjit >= %{version}-%{release} -Provides: %{pkgname}-llvmjit = %precise_version - -BuildRequires: llvm-devel >= 5.0 clang-devel >= 5.0 - -%virtual_conflicts_and_provides llvmjit - -%description -n %{pkgname}-llvmjit -The postgresql-llvmjit package contains support for -just-in-time compiling parts of PostgreSQL queries. Using LLVM it -compiles e.g. expressions and tuple deforming into native code, with the -goal of accelerating analytics queries. -%endif - - -%prep -%setup -q -a 2 -n postgresql-%{version} -%autopatch -p1 -M 3030 -%if %external_libpq -%patch -P 3031 -p1 -%else -%patch -P 3032 -p1 -%endif -%patch -P 3040 -p1 - - -%if ! %external_libpq -%global private_soname private%{majorversion} -find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \; -%endif - -%if %upgrade -tar xfj %{SOURCE1} - -%if ! %external_libpq -find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \; -%endif - -%endif - -find . -type f -name .gitignore | xargs rm - - -%build -%if %runselftest - if [ x"`id -u`" = x0 ]; then - echo "postgresql's regression tests fail if run as root." - echo "If you really need to build the RPM as root, use" - echo "--define='runselftest 0' to skip the regression tests." - exit 1 - fi -%endif - -cd postgresql-setup-%{setup_version} -export pgsetup_cv_os_family=redhat -%configure \ - pgdocdir=%{_pkgdocdir} \ - PGVERSION=%{version} \ - PGMAJORVERSION=%{majorversion} \ - NAME_DEFAULT_PREV_SERVICE=postgresql - -%make_build -unset pgsetup_cv_os_family -cd .. - - -CFLAGS="${CFLAGS:-%optflags}" -CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100` -export CFLAGS - -common_configure_options=' - --disable-rpath -%if %plperl - --with-perl -%endif -%if %pltcl - --with-tcl - --with-tclconfig=%_libdir -%endif -%if %ldap - --with-ldap -%endif -%if %ssl - --with-openssl -%endif -%if %pam - --with-pam -%endif -%if %kerberos - --with-gssapi -%endif -%if %uuid - --with-ossp-uuid -%endif -%if %xml - --with-libxml - --with-libxslt -%endif -%if %nls - --enable-nls -%endif -%if %sdt - --enable-dtrace -%endif -%if %selinux - --with-selinux -%endif - --with-system-tzdata=%_datadir/zoneinfo - --datadir=%_datadir/pgsql - --with-systemd - --with-lz4 -%if %icu - --with-icu -%endif -%if %llvmjit - --with-llvm -%endif -%if %plpython3 - --with-python -%endif -' - -export PYTHON=/usr/bin/python3 - -%configure $common_configure_options -%make_build world - -sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile -make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all -rm -f src/tutorial/GNUmakefile - -rm -f src/tutorial/*.o - -run_testsuite() -{ - make -k -C "$1" MAX_CONNECTIONS=5 check && return 0 || test_failure=1 - ( - set +x - echo "=== trying to find all regression.diffs files in build directory ===" - find "$1" -name 'regression.diffs' | \ - while read line; do - echo "=== make failure: $line ===" - cat "$line" - done - ) -} -test_failure=0 -%if %runselftest - run_testsuite "src/test/regress" - make clean -C "src/test/regress" - run_testsuite "src/pl" - run_testsuite "contrib" -%endif -test "$test_failure" -eq 0 - -%if %test - make all -C src/test/regress -%endif - -%if %upgrade - pushd postgresql-%{prevversion} - -upgrade_configure () -{ - CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations" ./configure \ - --build=%{_build} \ - --host=%{_host} \ - --prefix=%prev_prefix \ - --disable-rpath \ - --with-lz4 \ -%if %icu - --with-icu \ -%endif -%if %plperl - --with-perl \ -%endif -%if %pltcl - --with-tcl \ -%endif -%if %ldap - --with-ldap \ -%endif -%if %pam - --with-pam \ -%endif -%if %kerberos - --with-gssapi \ -%endif -%if %uuid - --with-ossp-uuid \ -%endif -%if %xml - --with-libxml \ - --with-libxslt \ -%endif -%if %nls - --enable-nls \ -%endif -%if %sdt - --enable-dtrace \ -%endif -%if %selinux - --with-selinux \ -%endif -%if %plpython3 - --with-python \ -%endif - --with-tclconfig=%_libdir \ - --with-system-tzdata=/usr/share/zoneinfo \ - "$@" -} - - upgrade_configure \ - - make %{?_smp_mflags} all - make -C contrib %{?_smp_mflags} all - popd -%endif - - -%install -cd postgresql-setup-%{setup_version} -make install DESTDIR=$RPM_BUILD_ROOT -cd .. - -mv $RPM_BUILD_ROOT/%{_pkgdocdir}/README.rpm-dist ./ - -cat > $RPM_BUILD_ROOT%{_sysconfdir}/postgresql-setup/upgrade/postgresql.conf < $RPM_BUILD_ROOT%macrosdir/macros.postgresql-upgrade -%%postgresql_upgrade_prefix %prev_prefix -EOF -%endif - -cat <> $RPM_BUILD_ROOT%macrosdir/macros.postgresql -%%postgresql_server_llvmjit %llvmjit -EOF - -%if %test - mkdir -p $RPM_BUILD_ROOT%{_libdir}/pgsql/test - cp -a src/test/regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test - rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress - rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/refint.so - rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/autoinc.so - ln -sf ../../pgxs/src/test/regress/pg_regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress - ln -sf ../../autoinc.so $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/autoinc.so - ln -sf ../../refint.so $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/refint.so - pushd $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress - rm -f GNUmakefile Makefile *.o - chmod 0755 pg_regress regress.so - popd - sed 's|@bindir@|%{_bindir}|g' \ - < %{SOURCE3} \ - > $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile - chmod 0644 $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile -%endif - -rm -rf doc/html -mv $RPM_BUILD_ROOT%{_docdir}/pgsql/html doc -rm -rf $RPM_BUILD_ROOT%{_docdir}/pgsql - -rm $RPM_BUILD_ROOT%{_libdir}/libpgfeutils.a - -%if !%plperl -rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plperl.so -%endif - -rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpythonu* -rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpython2u* - -%if %nls -find_lang_bins () -{ - lstfile=$1 ; shift - cp /dev/null "$lstfile" - for binary; do - %find_lang "$binary"-%{majorversion} - cat "$binary"-%{majorversion}.lang >>"$lstfile" - done -} -find_lang_bins devel.lst pg_server_config -find_lang_bins server.lst \ - initdb pg_basebackup pg_controldata pg_ctl pg_resetwal pg_rewind plpgsql \ - postgres pg_checksums pg_verifybackup -find_lang_bins contrib.lst \ - pg_amcheck pg_archivecleanup pg_test_fsync pg_test_timing pg_waldump -find_lang_bins main.lst \ - pg_dump pg_upgrade pgscripts psql \ -%if ! %external_libpq -libpq%{private_soname}-5 -%endif - -%if %plperl -find_lang_bins plperl.lst plperl -%endif -%if %plpython3 -find_lang_bins plpython3.lst plpython -%endif -%if %pltcl -find_lang_bins pltcl.lst pltcl -%endif -%endif - -%pre -n %{pkgname}-server -/usr/sbin/groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : -/usr/sbin/useradd -M -N -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ - -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || : - -%post -n %{pkgname}-server -%systemd_post %service_name - - -%preun -n %{pkgname}-server -%systemd_preun %service_name - - -%postun -n %{pkgname}-server -%systemd_postun_with_restart %service_name - - -%check -%if %runselftest -make -C postgresql-setup-%{setup_version} check -%endif - -%files -f main.lst -n %{pkgname} -%license COPYRIGHT -%doc doc/KNOWN_BUGS doc/MISSING_FEATURES doc/TODO -%doc README HISTORY README.rpm-dist -%{_bindir}/clusterdb -%{_bindir}/createdb -%{_bindir}/createuser -%{_bindir}/dropdb -%{_bindir}/dropuser -%{_bindir}/pg_dump -%{_bindir}/pg_dumpall -%{_bindir}/pg_isready -%{_bindir}/pg_restore -%{_bindir}/pg_upgrade -%{_bindir}/psql -%{_bindir}/reindexdb -%{_bindir}/vacuumdb -%{_mandir}/man1/clusterdb.* -%{_mandir}/man1/createdb.* -%{_mandir}/man1/createuser.* -%{_mandir}/man1/dropdb.* -%{_mandir}/man1/dropuser.* -%{_mandir}/man1/pg_dump.* -%{_mandir}/man1/pg_dumpall.* -%{_mandir}/man1/pg_isready.* -%{_mandir}/man1/pg_restore.* -%{_mandir}/man1/pg_upgrade.* -%{_mandir}/man1/psql.* -%{_mandir}/man1/reindexdb.* -%{_mandir}/man1/vacuumdb.* -%{_mandir}/man7/* -%if %llvmjit -%dir %{_libdir}/pgsql/bitcode -%endif - - -%if ! %external_libpq -%files -n %{pkgname}-private-libs -%{_libdir}/libpq.so.* -%endif - - -%files -n %{pkgname}-docs -%doc doc/html -%{_libdir}/pgsql/tutorial/ - - -%files -n %{pkgname}-contrib -f contrib.lst -%doc contrib/spi/*.example -%{_bindir}/oid2name -%{_bindir}/pg_amcheck -%{_bindir}/pg_archivecleanup -%{_bindir}/pg_test_fsync -%{_bindir}/pg_test_timing -%{_bindir}/pg_waldump -%{_bindir}/pgbench -%{_bindir}/vacuumlo -%{_datadir}/pgsql/extension/adminpack* -%{_datadir}/pgsql/extension/amcheck* -%{_datadir}/pgsql/extension/autoinc* -%{_datadir}/pgsql/extension/bloom* -%{_datadir}/pgsql/extension/btree_gin* -%{_datadir}/pgsql/extension/btree_gist* -%{_datadir}/pgsql/extension/citext* -%{_datadir}/pgsql/extension/cube* -%{_datadir}/pgsql/extension/dblink* -%{_datadir}/pgsql/extension/dict_int* -%{_datadir}/pgsql/extension/dict_xsyn* -%{_datadir}/pgsql/extension/earthdistance* -%{_datadir}/pgsql/extension/file_fdw* -%{_datadir}/pgsql/extension/fuzzystrmatch* -%{_datadir}/pgsql/extension/hstore* -%{_datadir}/pgsql/extension/insert_username* -%{_datadir}/pgsql/extension/intagg* -%{_datadir}/pgsql/extension/intarray* -%{_datadir}/pgsql/extension/isn* -%if %{plperl} -%{_datadir}/pgsql/extension/jsonb_plperl* -%endif -%if %{plpython3} -%{_datadir}/pgsql/extension/jsonb_plpython3u* -%endif -%{_datadir}/pgsql/extension/lo* -%{_datadir}/pgsql/extension/ltree* -%{_datadir}/pgsql/extension/moddatetime* -%{_datadir}/pgsql/extension/old_snapshot* -%{_datadir}/pgsql/extension/pageinspect* -%{_datadir}/pgsql/extension/pg_buffercache* -%{_datadir}/pgsql/extension/pg_freespacemap* -%{_datadir}/pgsql/extension/pg_prewarm* -%{_datadir}/pgsql/extension/pg_stat_statements* -%{_datadir}/pgsql/extension/pg_surgery* -%{_datadir}/pgsql/extension/pg_trgm* -%{_datadir}/pgsql/extension/pg_visibility* -%{_datadir}/pgsql/extension/pg_walinspect* -%{_datadir}/pgsql/extension/pgcrypto* -%{_datadir}/pgsql/extension/pgrowlocks* -%{_datadir}/pgsql/extension/pgstattuple* -%{_datadir}/pgsql/extension/postgres_fdw* -%{_datadir}/pgsql/extension/refint* -%{_datadir}/pgsql/extension/seg* -%{_datadir}/pgsql/extension/tablefunc* -%{_datadir}/pgsql/extension/tcn* -%{_datadir}/pgsql/extension/tsm_system_rows* -%{_datadir}/pgsql/extension/tsm_system_time* -%{_datadir}/pgsql/extension/unaccent* -%{_libdir}/pgsql/_int.so -%{_libdir}/pgsql/adminpack.so -%{_libdir}/pgsql/amcheck.so -%{_libdir}/pgsql/auth_delay.so -%{_libdir}/pgsql/auto_explain.so -%{_libdir}/pgsql/autoinc.so -%{_libdir}/pgsql/bloom.so -%{_libdir}/pgsql/btree_gin.so -%{_libdir}/pgsql/btree_gist.so -%{_libdir}/pgsql/citext.so -%{_libdir}/pgsql/cube.so -%{_libdir}/pgsql/dblink.so -%{_libdir}/pgsql/dict_int.so -%{_libdir}/pgsql/dict_xsyn.so -%{_libdir}/pgsql/earthdistance.so -%{_libdir}/pgsql/file_fdw.so -%{_libdir}/pgsql/fuzzystrmatch.so -%{_libdir}/pgsql/hstore.so -%if %plperl -%{_libdir}/pgsql/hstore_plperl.so -%endif -%if %plpython3 -%{_libdir}/pgsql/hstore_plpython3.so -%endif -%{_libdir}/pgsql/insert_username.so -%{_libdir}/pgsql/isn.so -%if %plperl -%{_libdir}/pgsql/jsonb_plperl.so -%endif -%if %plpython3 -%{_libdir}/pgsql/jsonb_plpython3.so -%endif -%{_libdir}/pgsql/lo.so -%{_libdir}/pgsql/ltree.so -%if %plpython3 -%{_libdir}/pgsql/ltree_plpython3.so -%endif -%{_libdir}/pgsql/moddatetime.so -%{_libdir}/pgsql/old_snapshot.so -%{_libdir}/pgsql/pageinspect.so -%{_libdir}/pgsql/passwordcheck.so -%{_libdir}/pgsql/pg_buffercache.so -%{_libdir}/pgsql/pg_freespacemap.so -%{_libdir}/pgsql/pg_stat_statements.so -%{_libdir}/pgsql/pg_surgery.so -%{_libdir}/pgsql/pg_trgm.so -%{_libdir}/pgsql/pg_visibility.so -%{_libdir}/pgsql/basebackup_to_shell.so -%{_libdir}/pgsql/basic_archive.so -%{_libdir}/pgsql/pg_walinspect.so -%{_libdir}/pgsql/pgcrypto.so -%{_libdir}/pgsql/pgrowlocks.so -%{_libdir}/pgsql/pgstattuple.so -%{_libdir}/pgsql/postgres_fdw.so -%{_libdir}/pgsql/refint.so -%{_libdir}/pgsql/seg.so -%{_libdir}/pgsql/tablefunc.so -%{_libdir}/pgsql/tcn.so -%{_libdir}/pgsql/test_decoding.so -%{_libdir}/pgsql/tsm_system_rows.so -%{_libdir}/pgsql/tsm_system_time.so -%{_libdir}/pgsql/unaccent.so -%{_mandir}/man1/oid2name.* -%{_mandir}/man1/pg_amcheck.* -%{_mandir}/man1/pg_archivecleanup.* -%{_mandir}/man1/pg_recvlogical.* -%{_mandir}/man1/pg_test_fsync.* -%{_mandir}/man1/pg_test_timing.* -%{_mandir}/man1/pg_waldump.* -%{_mandir}/man1/pgbench.* -%{_mandir}/man1/vacuumlo.* -%{_mandir}/man3/dblink* -%if %selinux -%{_datadir}/pgsql/contrib/sepgsql.sql -%{_libdir}/pgsql/sepgsql.so -%endif -%if %ssl -%{_datadir}/pgsql/extension/sslinfo* -%{_libdir}/pgsql/sslinfo.so -%endif -%if %uuid -%{_datadir}/pgsql/extension/uuid-ossp* -%{_libdir}/pgsql/uuid-ossp.so -%endif -%if %xml -%{_datadir}/pgsql/extension/xml2* -%{_libdir}/pgsql/pgxml.so -%endif - -%files -n %{pkgname}-server -f server.lst -%{_bindir}/initdb -%{_bindir}/pg_basebackup -%{_bindir}/pg_controldata -%{_bindir}/pg_ctl -%{_bindir}/pg_receivewal -%{_bindir}/pg_recvlogical -%{_bindir}/pg_resetwal -%{_bindir}/pg_rewind -%{_bindir}/pg_checksums -%{_bindir}/pg_verifybackup -%{_bindir}/postgres -%{_bindir}/postgresql-setup -%{_bindir}/postgresql-upgrade -%dir %{_datadir}/pgsql -%{_datadir}/pgsql/*.sample -%dir %{_datadir}/pgsql/contrib -%dir %{_datadir}/pgsql/extension -%{_datadir}/pgsql/extension/plpgsql* -%{_datadir}/pgsql/information_schema.sql -%{_datadir}/pgsql/postgres.bki -%{_datadir}/pgsql/snowball_create.sql -%{_datadir}/pgsql/sql_features.txt -%{_datadir}/pgsql/system_constraints.sql -%{_datadir}/pgsql/system_functions.sql -%{_datadir}/pgsql/system_views.sql -%{_datadir}/pgsql/fix-CVE-2024-4317.sql -%{_datadir}/pgsql/timezonesets/ -%{_datadir}/pgsql/tsearch_data/ -%dir %{_datadir}/postgresql-setup -%{_datadir}/postgresql-setup/library.sh -%dir %{_libdir}/pgsql -%{_libdir}/pgsql/*_and_*.so -%{_libdir}/pgsql/dict_snowball.so -%{_libdir}/pgsql/euc2004_sjis2004.so -%{_libdir}/pgsql/libpqwalreceiver.so -%{_libdir}/pgsql/pg_prewarm.so -%{_libdir}/pgsql/pgoutput.so -%{_libdir}/pgsql/plpgsql.so -%dir %{_libexecdir}/initscripts/legacy-actions/postgresql -%{_libexecdir}/initscripts/legacy-actions/postgresql/* -%{_libexecdir}/postgresql-check-db-dir -%dir %{_sysconfdir}/postgresql-setup -%dir %{_sysconfdir}/postgresql-setup/upgrade -%config %{_sysconfdir}/postgresql-setup/upgrade/*.conf -%{_mandir}/man1/initdb.* -%{_mandir}/man1/pg_basebackup.* -%{_mandir}/man1/pg_controldata.* -%{_mandir}/man1/pg_ctl.* -%{_mandir}/man1/pg_receivewal.* -%{_mandir}/man1/pg_resetwal.* -%{_mandir}/man1/pg_rewind.* -%{_mandir}/man1/pg_checksums.* -%{_mandir}/man1/pg_verifybackup.* -%{_mandir}/man1/postgres.* -%{_mandir}/man1/postgresql-new-systemd-unit.* -%{_mandir}/man1/postgresql-setup.* -%{_mandir}/man1/postgresql-upgrade.* -%{_sbindir}/postgresql-new-systemd-unit -%{_tmpfilesdir}/postgresql.conf -%{_unitdir}/*postgresql*.service -%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql -%attr(644,postgres,postgres) %config(noreplace) %{?_localstatedir}/lib/pgsql/.bash_profile -%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/backups -%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/data -%ghost %attr(755,postgres,postgres) %dir %{_rundir}/postgresql -%if %pam -%config(noreplace) /etc/pam.d/postgresql -%endif - - -%files -n %{pkgname}-server-devel -f devel.lst -%{_bindir}/pg_server_config -%dir %{_datadir}/pgsql -%{_datadir}/pgsql/errcodes.txt -%dir %{_includedir}/pgsql -%{_includedir}/pgsql/server -%{_libdir}/pgsql/pgxs/ -%{_mandir}/man1/pg_server_config.* -%{_mandir}/man3/SPI_* -%{macrosdir}/macros.postgresql - - -%if ! %external_libpq -%files -n %{pkgname}-private-devel -%{_bindir}/pg_config -%{_includedir}/libpq-events.h -%{_includedir}/libpq-fe.h -%{_includedir}/postgres_ext.h -%{_includedir}/pgsql/internal/*.h -%{_includedir}/pgsql/internal/libpq/pqcomm.h -%{_includedir}/libpq/*.h -%{_libdir}/pkgconfig/*.pc -%{_libdir}/libpq.so -%{_includedir}/pg_config*.h -%endif - - -%files -n %{pkgname}-test-rpm-macros -%{_datadir}/postgresql-setup/postgresql_pkg_tests.sh -%{macrosdir}/macros.postgresql-test - - -%files -n %{pkgname}-static -%{_libdir}/libpgcommon.a -%{_libdir}/libpgport.a -%{_libdir}/libpgcommon_shlib.a -%{_libdir}/libpgport_shlib.a - - -%if %upgrade -%files -n %{pkgname}-upgrade -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin -%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib -%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs -%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/share - - -%files -n %{pkgname}-upgrade-devel -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/include -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig -%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs -%{macrosdir}/macros.postgresql-upgrade -%endif - -%if %llvmjit -%files -n %{pkgname}-llvmjit -%defattr(-,root,root) -%{_libdir}/pgsql/bitcode/* -%{_libdir}/pgsql/llvmjit.so -%{_libdir}/pgsql/llvmjit_types.bc -%endif - -%if %plperl -%files -n %{pkgname}-plperl -f plperl.lst -%{_datadir}/pgsql/extension/bool_plperl* -%{_datadir}/pgsql/extension/plperl* -%{_libdir}/pgsql/bool_plperl.so -%{_libdir}/pgsql/plperl.so -%endif - - -%if %pltcl -%files -n %{pkgname}-pltcl -f pltcl.lst -%{_datadir}/pgsql/extension/pltcl* -%{_libdir}/pgsql/pltcl.so -%endif - - -%if %plpython3 -%files -n %{pkgname}-plpython3 -f plpython3.lst -%{_datadir}/pgsql/extension/plpython3* -%{_libdir}/pgsql/plpython3.so -%endif - - -%if %test -%files -n %{pkgname}-test -%attr(-,postgres,postgres) %{_libdir}/pgsql/test -%endif - - -%changelog -* Fri Aug 22 2025 Huang Yang - 16.10-2 +# This spec file and ancillary files are licensed in accordance with +# The PostgreSQL license. + +# In this file you can find the default build package list macros. +# These can be overridden by defining on the rpm command line: +# rpm --define 'packagename 1' .... to force the package to build. +# rpm --define 'packagename 0' .... to force the package NOT to build. +# The base package, the libs package, the devel package, and the server package +# always get built. + +%{!?test:%global test 1} +# enable llvmjit, due to citus-llvmjit +%{!?llvmjit:%global llvmjit 1} +%{!?external_libpq:%global external_libpq 0} +%{!?upgrade:%global upgrade 1} +%{!?plpython3:%global plpython3 1} +%{!?pltcl:%global pltcl 1} +%{!?plperl:%global plperl 1} +%{!?ssl:%global ssl 1} +%{!?icu:%global icu 1} +%{!?kerberos:%global kerberos 1} +%{!?ldap:%global ldap 1} +%{!?nls:%global nls 1} +%{!?uuid:%global uuid 1} +%{!?xml:%global xml 1} +%{!?pam:%global pam 1} +%{!?sdt:%global sdt 1} +%{!?selinux:%global selinux 1} +%{!?runselftest:%global runselftest 1} +%{!?postgresql_default:%global postgresql_default 0} + +%global majorname postgresql +%global majorversion 16 + +%global _default_patch_flags --no-backup-if-mismatch +%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) +%global __provides_exclude_from %{_libdir}/(pgsql|pkgconfig) +%undefine _package_note_file + +%global prevmajorversion 15 +%global prevversion %{prevmajorversion}.5 +%global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion} +%global precise_version %version-%release +%global setup_version 8.9 + +%global service_name postgresql.service + + +Summary: PostgreSQL client programs +Name: %{majorname}%{majorversion} +Version: 16.10 +Release: 3%{?dist} +License: PostgreSQL +Url: http://www.postgresql.org/ +Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 +Source1: https://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2 +Source2: https://github.com/devexp-db/postgresql-setup/releases/download/v%{setup_version}/postgresql-setup-%{setup_version}.tar.gz +Source3: Makefile.regress +Source4: postgresql.tmpfiles.d +Source5: postgresql.pam +Source6: postgresql-bashprofile + +Patch3001: rpm-pgsql.patch +Patch3002: postgresql-logging.patch +Patch3003: postgresql-var-run-socket.patch +Patch3004: postgresql-server-pg_config.patch +Patch3005: postgresql-pgcrypto-openssl3-tests.patch +Patch3031: postgresql-external-libpq.patch +Patch3032: postgresql-no-libecpg.patch +Patch3040: 0001-modify-CodeMode-on-loongarch64.patch + +%define majorversion %(echo %{version} | cut -d. -f1) + +# This macro is used for package names in the files section +%if %?postgresql_default +%global pkgname %{majorname} +%package -n %{pkgname} +Summary: PostgreSQL client programs +%else +%global pkgname %{majorname}%{majorversion} +%endif + +BuildRequires: make gcc bison flex m4 gawk glibc-devel elinks +BuildRequires: perl(ExtUtils::MakeMaker) perl(ExtUtils::Embed) perl(Opcode) +BuildRequires: perl-generators perl-devel +BuildRequires: readline-devel zlib-devel lz4-devel +BuildRequires: systemd systemd-devel util-linux +BuildRequires: docbook-style-xsl docbook-utils help2man +%if %external_libpq +BuildRequires: libpq-devel >= %version +%endif + +%if %plpython3 +BuildRequires: python3-devel +%endif + +%if %pltcl +BuildRequires: tcl-devel +%endif + +%if %ssl +BuildRequires: openssl-devel +%endif + +%if %kerberos +BuildRequires: krb5-devel +%endif + +%if %ldap +BuildRequires: openldap-devel +%endif + +%if %nls +BuildRequires: gettext >= 0.10.35 +%endif + +%if %uuid +BuildRequires: uuid-devel +%endif + +%if %xml +BuildRequires: libxml2-devel libxslt-devel +%endif + +%if %pam +BuildRequires: pam-devel +%endif + +%if %sdt +BuildRequires: systemtap-sdt-devel +%endif + +%if %selinux +BuildRequires: libselinux-devel +%endif + +%if %icu +BuildRequires: libicu-devel +%endif + +%if %?postgresql_default +%define postgresqlXX_if_default() %{expand:\ +Provides: postgresql%{majorversion}%{?1:-%{1}} = %precise_version\ +Provides: postgresql%{majorversion}%{?1:-%{1}}%{?_isa} = %precise_version\ +} +%else +%define postgresqlXX_if_default() %{nil} +%endif + +%if %?postgresql_default +%define conflict_with_other_streams() %{expand:\ +Provides: %{majorname}%{?1:-%{1}}-any\ +Conflicts: %{majorname}%{?1:-%{1}}-any\ +} +%else +%define conflict_with_other_streams() %{expand:\ +Provides: %{majorname}%{?1:-%{1}}-any\ +Conflicts: %{majorname}%{?1:-%{1}}-any\ +Conflicts: %{majorname}%{?1:-%{1}}\ +} +%endif + +%define virtual_conflicts_and_provides() %{expand:\ +%conflict_with_other_streams %{**}\ +%postgresqlXX_if_default %{**}\ +} + +Provides: %{pkgname} = %precise_version + +%virtual_conflicts_and_provides + +%description +%description -n %{pkgname} +PostgreSQL is an advanced Object-Relational database management system (DBMS). +The base postgresql package contains the client programs that you'll need to +access a PostgreSQL DBMS server, as well as HTML documentation for the whole +system. These client programs can be located on the same machine as the +PostgreSQL server, or on a remote machine that accesses a PostgreSQL server +over a network connection. The PostgreSQL server can be found in the +postgresql-server sub-package. + + +%if ! %external_libpq +%package -n %{pkgname}-private-libs +Summary: The shared libraries required only for this build of PostgreSQL server +Requires(post): glibc +Requires(postun): glibc +Provides: %{pkgname}-private-libs = %precise_version + +%virtual_conflicts_and_provides private-libs + +%description -n %{pkgname}-private-libs +The postgresql-private-libs package provides the shared libraries for this +build of PostgreSQL server and plugins build with this version of server. +For shared libraries used by client packages that need to connect to a +PostgreSQL server, install libpq package instead. + + +%package -n %{pkgname}-private-devel +Summary: PostgreSQL development header files for this build of PostgreSQL server +Requires: %{pkgname}-private-libs = %precise_version +Conflicts: libpq-devel +Provides: %{pkgname}-devel = %precise_version + +%virtual_conflicts_and_provides private-devel + +%description -n %{pkgname}-private-devel +The postgresql-private-devel package contains the header files and libraries +needed to compile C or C++ applications which will directly interact +with a PostgreSQL database management server. +You need to install this package if you want to develop applications which +will interact with a PostgreSQL server. +%endif + + +%package -n %{pkgname}-server +Summary: The programs needed to create and run a PostgreSQL server +BuildRequires: util-linux +Requires: %{pkgname} = %precise_version +Requires(pre): /usr/sbin/useradd +Requires: util-linux +Requires: systemd +%{?systemd_requires} +Provides: %{pkgname}-server(:MODULE_COMPAT_%{majorversion}) +Provides: bundled(postgresql-setup) = %setup_version +Provides: %{pkgname}-server = %precise_version + +%virtual_conflicts_and_provides server + +%description -n %{pkgname}-server +PostgreSQL is an advanced Object-Relational database management system (DBMS). +The postgresql-server package contains the programs needed to create +and run a PostgreSQL server, which will in turn allow you to create +and maintain PostgreSQL databases. + + +%package -n %{pkgname}-docs +Summary: Extra documentation for PostgreSQL +Requires: %{pkgname} = %precise_version +Provides: %{pkgname}-doc = %precise_version + +%virtual_conflicts_and_provides docs + +%description -n %{pkgname}-docs +The postgresql-docs package contains some additional documentation for +PostgreSQL. Currently, this includes the main documentation in PDF format +and source files for the PostgreSQL tutorial. + + +%package -n %{pkgname}-contrib +Summary: Extension modules distributed with PostgreSQL +Requires: %{pkgname} = %precise_version +Provides: %{pkgname}-contrib = %precise_version + +%virtual_conflicts_and_provides contrib + +%description -n %{pkgname}-contrib +The postgresql-contrib package contains various extension modules that are +included in the PostgreSQL distribution. + + +%package -n %{pkgname}-server-devel +Summary: PostgreSQL development header files and libraries +%if %icu +Requires: libicu-devel +%endif +%if %kerberos +Requires: krb5-devel +%endif +%if %llvmjit +Requires: clang-devel llvm-devel +%endif +%if %external_libpq +# Some extensions require libpq +# Do not make them care about whether server uses private or system-wide +# libpq, simply let the server pull the correct one +Requires: libpq-devel +%else +Requires: %{pkgname}-private-devel +%endif +Provides: %{pkgname}-server-devel = %precise_version + +%virtual_conflicts_and_provides server-devel + +%description -n %{pkgname}-server-devel +The postgresql-server-devel package contains the header files and configuration +needed to compile PostgreSQL server extension. + + +%package -n %{pkgname}-test-rpm-macros +Summary: Convenience RPM macros for build-time testing against PostgreSQL server +Requires: %{pkgname}-server = %precise_version +BuildArch: noarch +Provides: %{pkgname}-test-rpm-macros = %precise_version + +%conflict_with_other_streams test-rpm-macros + +%description -n %{pkgname}-test-rpm-macros +This package is meant to be added as BuildRequires: dependency of other packages +that want to run build-time testsuite against running PostgreSQL server. + + +%package -n %{pkgname}-static +Summary: Statically linked PostgreSQL libraries +Requires: %{pkgname}-server-devel = %precise_version +Provides: %{pkgname}-static = %precise_version + +%virtual_conflicts_and_provides static + +%description -n %{pkgname}-static +Statically linked PostgreSQL libraries that do not have dynamically linked +counterparts. + + +%if %upgrade +%package -n %{pkgname}-upgrade +Summary: Support for upgrading from the previous major release of PostgreSQL +Requires: %{pkgname}-server = %precise_version +Provides: bundled(postgresql-server) = %prevversion +Provides: %{pkgname}-upgrade = %precise_version + +%virtual_conflicts_and_provides upgrade + +%description -n %{pkgname}-upgrade +The postgresql-upgrade package contains the pg_upgrade utility and supporting +files needed for upgrading a PostgreSQL database from the previous major +version of PostgreSQL. + + +%package -n %{pkgname}-upgrade-devel +Summary: Support for build of extensions required for upgrade process +Requires: %{pkgname}-upgrade = %precise_version +Provides: %{pkgname}-upgrade-devel = %precise_version + +%virtual_conflicts_and_provides upgrade-devel + +%description -n %{pkgname}-upgrade-devel +The postgresql-devel package contains the header files and libraries +needed to compile C or C++ applications which are necessary in upgrade +process. +%endif + + +%if %plperl +%package -n %{pkgname}-plperl +Summary: The Perl procedural language for PostgreSQL +Requires: %{pkgname}-server = %precise_version +%if %runselftest +BuildRequires: perl(Opcode) perl(Data::Dumper) +%endif +Provides: %{pkgname}-plperl = %precise_version + +%virtual_conflicts_and_provides plperl + +%description -n %{pkgname}-plperl +The postgresql-plperl package contains the PL/Perl procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Perl. +%endif + + +%if %plpython3 +%package -n %{pkgname}-plpython3 +Summary: The Python3 procedural language for PostgreSQL +Requires: %{pkgname}-server = %precise_version +Provides: %{pkgname}-plpython3 = %precise_version + +%virtual_conflicts_and_provides python3 + +%description -n %{pkgname}-plpython3 +The postgresql-plpython3 package contains the PL/Python3 procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Python 3. +%endif + + +%if %pltcl +%package -n %{pkgname}-pltcl +Summary: The Tcl procedural language for PostgreSQL +Requires: %{pkgname}-server = %precise_version +Provides: %{pkgname}-pltcl = %precise_version + +%virtual_conflicts_and_provides plctl + +%description -n %{pkgname}-pltcl +The postgresql-pltcl package contains the PL/Tcl procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Tcl. +%endif + + +%if %test +%package -n %{pkgname}-test +Summary: The test suite distributed with PostgreSQL +Requires: %{pkgname}-server = %precise_version +Requires: %{pkgname}-server-devel = %precise_version +Requires: %{pkgname}-contrib = %precise_version +Provides: %{pkgname}-test = %precise_version + +%virtual_conflicts_and_provides test + +%description -n %{pkgname}-test +The postgresql-test package contains files needed for various tests for the +PostgreSQL database management system, including regression tests and +benchmarks. +%endif + +%if %llvmjit +%package -n %{pkgname}-llvmjit +Summary: Just-in-time compilation support for PostgreSQL +Requires: %{pkgname}-server = %{version}-%{release} +Requires: llvm => 5.0 +Provides: postgresql-llvmjit >= %{version}-%{release} +Provides: %{pkgname}-llvmjit = %precise_version + +BuildRequires: llvm-devel >= 5.0 clang-devel >= 5.0 + +%virtual_conflicts_and_provides llvmjit + +%description -n %{pkgname}-llvmjit +The postgresql-llvmjit package contains support for +just-in-time compiling parts of PostgreSQL queries. Using LLVM it +compiles e.g. expressions and tuple deforming into native code, with the +goal of accelerating analytics queries. +%endif + + +%prep +%setup -q -a 2 -n postgresql-%{version} +%autopatch -p1 -M 3030 +%if %external_libpq +%patch -P 3031 -p1 +%else +%patch -P 3032 -p1 +%endif +%patch -P 3040 -p1 + + +%if ! %external_libpq +%global private_soname private%{majorversion} +find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \; +%endif + +%if %upgrade +tar xfj %{SOURCE1} + +%if ! %external_libpq +find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \; +%endif + +%endif + +find . -type f -name .gitignore | xargs rm + + +%build +%if %runselftest + if [ x"`id -u`" = x0 ]; then + echo "postgresql's regression tests fail if run as root." + echo "If you really need to build the RPM as root, use" + echo "--define='runselftest 0' to skip the regression tests." + exit 1 + fi +%endif + +cd postgresql-setup-%{setup_version} +export pgsetup_cv_os_family=redhat +%configure \ + pgdocdir=%{_pkgdocdir} \ + PGVERSION=%{version} \ + PGMAJORVERSION=%{majorversion} \ + NAME_DEFAULT_PREV_SERVICE=postgresql + +%make_build +unset pgsetup_cv_os_family +cd .. + + +CFLAGS="${CFLAGS:-%optflags}" +CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100` +export CFLAGS + +common_configure_options=' + --disable-rpath +%if %plperl + --with-perl +%endif +%if %pltcl + --with-tcl + --with-tclconfig=%_libdir +%endif +%if %ldap + --with-ldap +%endif +%if %ssl + --with-openssl +%endif +%if %pam + --with-pam +%endif +%if %kerberos + --with-gssapi +%endif +%if %uuid + --with-ossp-uuid +%endif +%if %xml + --with-libxml + --with-libxslt +%endif +%if %nls + --enable-nls +%endif +%if %sdt + --enable-dtrace +%endif +%if %selinux + --with-selinux +%endif + --with-system-tzdata=%_datadir/zoneinfo + --datadir=%_datadir/pgsql + --with-systemd + --with-lz4 +%if %icu + --with-icu +%endif +%ifarch riscv64 + %global llvmjit 0 +%endif +%if %llvmjit + --with-llvm +%endif +%if %plpython3 + --with-python +%endif +' + +export PYTHON=/usr/bin/python3 + +%configure $common_configure_options +%make_build world + +sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile +make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all +rm -f src/tutorial/GNUmakefile + +rm -f src/tutorial/*.o + +run_testsuite() +{ + make -k -C "$1" MAX_CONNECTIONS=5 check && return 0 || test_failure=1 + ( + set +x + echo "=== trying to find all regression.diffs files in build directory ===" + find "$1" -name 'regression.diffs' | \ + while read line; do + echo "=== make failure: $line ===" + cat "$line" + done + ) +} +test_failure=0 +%if %runselftest + run_testsuite "src/test/regress" + make clean -C "src/test/regress" + run_testsuite "src/pl" + run_testsuite "contrib" +%endif +test "$test_failure" -eq 0 + +%if %test + make all -C src/test/regress +%endif + +%if %upgrade + pushd postgresql-%{prevversion} + +upgrade_configure () +{ + CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations" ./configure \ + --build=%{_build} \ + --host=%{_host} \ + --prefix=%prev_prefix \ + --disable-rpath \ + --with-lz4 \ +%if %icu + --with-icu \ +%endif +%if %plperl + --with-perl \ +%endif +%if %pltcl + --with-tcl \ +%endif +%if %ldap + --with-ldap \ +%endif +%if %pam + --with-pam \ +%endif +%if %kerberos + --with-gssapi \ +%endif +%if %uuid + --with-ossp-uuid \ +%endif +%if %xml + --with-libxml \ + --with-libxslt \ +%endif +%if %nls + --enable-nls \ +%endif +%if %sdt + --enable-dtrace \ +%endif +%if %selinux + --with-selinux \ +%endif +%if %plpython3 + --with-python \ +%endif + --with-tclconfig=%_libdir \ + --with-system-tzdata=/usr/share/zoneinfo \ + "$@" +} + + upgrade_configure \ + + make %{?_smp_mflags} all + make -C contrib %{?_smp_mflags} all + popd +%endif + + +%install +cd postgresql-setup-%{setup_version} +make install DESTDIR=$RPM_BUILD_ROOT +cd .. + +mv $RPM_BUILD_ROOT/%{_pkgdocdir}/README.rpm-dist ./ + +cat > $RPM_BUILD_ROOT%{_sysconfdir}/postgresql-setup/upgrade/postgresql.conf < $RPM_BUILD_ROOT%macrosdir/macros.postgresql-upgrade +%%postgresql_upgrade_prefix %prev_prefix +EOF +%endif + +cat <> $RPM_BUILD_ROOT%macrosdir/macros.postgresql +%%postgresql_server_llvmjit %llvmjit +EOF + +%if %test + mkdir -p $RPM_BUILD_ROOT%{_libdir}/pgsql/test + cp -a src/test/regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test + rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress + rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/refint.so + rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/autoinc.so + ln -sf ../../pgxs/src/test/regress/pg_regress $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/pg_regress + ln -sf ../../autoinc.so $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/autoinc.so + ln -sf ../../refint.so $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/refint.so + pushd $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress + rm -f GNUmakefile Makefile *.o + chmod 0755 pg_regress regress.so + popd + sed 's|@bindir@|%{_bindir}|g' \ + < %{SOURCE3} \ + > $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile + chmod 0644 $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile +%endif + +rm -rf doc/html +mv $RPM_BUILD_ROOT%{_docdir}/pgsql/html doc +rm -rf $RPM_BUILD_ROOT%{_docdir}/pgsql + +rm $RPM_BUILD_ROOT%{_libdir}/libpgfeutils.a + +%if !%plperl +rm -f $RPM_BUILD_ROOT%{_bindir}/pgsql/hstore_plperl.so +%endif + +rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpythonu* +rm -f $RPM_BUILD_ROOT%{_datadir}/pgsql/extension/*_plpython2u* + +%if %nls +find_lang_bins () +{ + lstfile=$1 ; shift + cp /dev/null "$lstfile" + for binary; do + %find_lang "$binary"-%{majorversion} + cat "$binary"-%{majorversion}.lang >>"$lstfile" + done +} +find_lang_bins devel.lst pg_server_config +find_lang_bins server.lst \ + initdb pg_basebackup pg_controldata pg_ctl pg_resetwal pg_rewind plpgsql \ + postgres pg_checksums pg_verifybackup +find_lang_bins contrib.lst \ + pg_amcheck pg_archivecleanup pg_test_fsync pg_test_timing pg_waldump +find_lang_bins main.lst \ + pg_dump pg_upgrade pgscripts psql \ +%if ! %external_libpq +libpq%{private_soname}-5 +%endif + +%if %plperl +find_lang_bins plperl.lst plperl +%endif +%if %plpython3 +find_lang_bins plpython3.lst plpython +%endif +%if %pltcl +find_lang_bins pltcl.lst pltcl +%endif +%endif + +%pre -n %{pkgname}-server +/usr/sbin/groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : +/usr/sbin/useradd -M -N -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ + -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || : + +%post -n %{pkgname}-server +%systemd_post %service_name + + +%preun -n %{pkgname}-server +%systemd_preun %service_name + + +%postun -n %{pkgname}-server +%systemd_postun_with_restart %service_name + + +%check +%if %runselftest +make -C postgresql-setup-%{setup_version} check +%endif + +%files -f main.lst -n %{pkgname} +%license COPYRIGHT +%doc doc/KNOWN_BUGS doc/MISSING_FEATURES doc/TODO +%doc README HISTORY README.rpm-dist +%{_bindir}/clusterdb +%{_bindir}/createdb +%{_bindir}/createuser +%{_bindir}/dropdb +%{_bindir}/dropuser +%{_bindir}/pg_dump +%{_bindir}/pg_dumpall +%{_bindir}/pg_isready +%{_bindir}/pg_restore +%{_bindir}/pg_upgrade +%{_bindir}/psql +%{_bindir}/reindexdb +%{_bindir}/vacuumdb +%{_mandir}/man1/clusterdb.* +%{_mandir}/man1/createdb.* +%{_mandir}/man1/createuser.* +%{_mandir}/man1/dropdb.* +%{_mandir}/man1/dropuser.* +%{_mandir}/man1/pg_dump.* +%{_mandir}/man1/pg_dumpall.* +%{_mandir}/man1/pg_isready.* +%{_mandir}/man1/pg_restore.* +%{_mandir}/man1/pg_upgrade.* +%{_mandir}/man1/psql.* +%{_mandir}/man1/reindexdb.* +%{_mandir}/man1/vacuumdb.* +%{_mandir}/man7/* +%if %llvmjit +%dir %{_libdir}/pgsql/bitcode +%endif + + +%if ! %external_libpq +%files -n %{pkgname}-private-libs +%{_libdir}/libpq.so.* +%endif + + +%files -n %{pkgname}-docs +%doc doc/html +%{_libdir}/pgsql/tutorial/ + + +%files -n %{pkgname}-contrib -f contrib.lst +%doc contrib/spi/*.example +%{_bindir}/oid2name +%{_bindir}/pg_amcheck +%{_bindir}/pg_archivecleanup +%{_bindir}/pg_test_fsync +%{_bindir}/pg_test_timing +%{_bindir}/pg_waldump +%{_bindir}/pgbench +%{_bindir}/vacuumlo +%{_datadir}/pgsql/extension/adminpack* +%{_datadir}/pgsql/extension/amcheck* +%{_datadir}/pgsql/extension/autoinc* +%{_datadir}/pgsql/extension/bloom* +%{_datadir}/pgsql/extension/btree_gin* +%{_datadir}/pgsql/extension/btree_gist* +%{_datadir}/pgsql/extension/citext* +%{_datadir}/pgsql/extension/cube* +%{_datadir}/pgsql/extension/dblink* +%{_datadir}/pgsql/extension/dict_int* +%{_datadir}/pgsql/extension/dict_xsyn* +%{_datadir}/pgsql/extension/earthdistance* +%{_datadir}/pgsql/extension/file_fdw* +%{_datadir}/pgsql/extension/fuzzystrmatch* +%{_datadir}/pgsql/extension/hstore* +%{_datadir}/pgsql/extension/insert_username* +%{_datadir}/pgsql/extension/intagg* +%{_datadir}/pgsql/extension/intarray* +%{_datadir}/pgsql/extension/isn* +%if %{plperl} +%{_datadir}/pgsql/extension/jsonb_plperl* +%endif +%if %{plpython3} +%{_datadir}/pgsql/extension/jsonb_plpython3u* +%endif +%{_datadir}/pgsql/extension/lo* +%{_datadir}/pgsql/extension/ltree* +%{_datadir}/pgsql/extension/moddatetime* +%{_datadir}/pgsql/extension/old_snapshot* +%{_datadir}/pgsql/extension/pageinspect* +%{_datadir}/pgsql/extension/pg_buffercache* +%{_datadir}/pgsql/extension/pg_freespacemap* +%{_datadir}/pgsql/extension/pg_prewarm* +%{_datadir}/pgsql/extension/pg_stat_statements* +%{_datadir}/pgsql/extension/pg_surgery* +%{_datadir}/pgsql/extension/pg_trgm* +%{_datadir}/pgsql/extension/pg_visibility* +%{_datadir}/pgsql/extension/pg_walinspect* +%{_datadir}/pgsql/extension/pgcrypto* +%{_datadir}/pgsql/extension/pgrowlocks* +%{_datadir}/pgsql/extension/pgstattuple* +%{_datadir}/pgsql/extension/postgres_fdw* +%{_datadir}/pgsql/extension/refint* +%{_datadir}/pgsql/extension/seg* +%{_datadir}/pgsql/extension/tablefunc* +%{_datadir}/pgsql/extension/tcn* +%{_datadir}/pgsql/extension/tsm_system_rows* +%{_datadir}/pgsql/extension/tsm_system_time* +%{_datadir}/pgsql/extension/unaccent* +%{_libdir}/pgsql/_int.so +%{_libdir}/pgsql/adminpack.so +%{_libdir}/pgsql/amcheck.so +%{_libdir}/pgsql/auth_delay.so +%{_libdir}/pgsql/auto_explain.so +%{_libdir}/pgsql/autoinc.so +%{_libdir}/pgsql/bloom.so +%{_libdir}/pgsql/btree_gin.so +%{_libdir}/pgsql/btree_gist.so +%{_libdir}/pgsql/citext.so +%{_libdir}/pgsql/cube.so +%{_libdir}/pgsql/dblink.so +%{_libdir}/pgsql/dict_int.so +%{_libdir}/pgsql/dict_xsyn.so +%{_libdir}/pgsql/earthdistance.so +%{_libdir}/pgsql/file_fdw.so +%{_libdir}/pgsql/fuzzystrmatch.so +%{_libdir}/pgsql/hstore.so +%if %plperl +%{_libdir}/pgsql/hstore_plperl.so +%endif +%if %plpython3 +%{_libdir}/pgsql/hstore_plpython3.so +%endif +%{_libdir}/pgsql/insert_username.so +%{_libdir}/pgsql/isn.so +%if %plperl +%{_libdir}/pgsql/jsonb_plperl.so +%endif +%if %plpython3 +%{_libdir}/pgsql/jsonb_plpython3.so +%endif +%{_libdir}/pgsql/lo.so +%{_libdir}/pgsql/ltree.so +%if %plpython3 +%{_libdir}/pgsql/ltree_plpython3.so +%endif +%{_libdir}/pgsql/moddatetime.so +%{_libdir}/pgsql/old_snapshot.so +%{_libdir}/pgsql/pageinspect.so +%{_libdir}/pgsql/passwordcheck.so +%{_libdir}/pgsql/pg_buffercache.so +%{_libdir}/pgsql/pg_freespacemap.so +%{_libdir}/pgsql/pg_stat_statements.so +%{_libdir}/pgsql/pg_surgery.so +%{_libdir}/pgsql/pg_trgm.so +%{_libdir}/pgsql/pg_visibility.so +%{_libdir}/pgsql/basebackup_to_shell.so +%{_libdir}/pgsql/basic_archive.so +%{_libdir}/pgsql/pg_walinspect.so +%{_libdir}/pgsql/pgcrypto.so +%{_libdir}/pgsql/pgrowlocks.so +%{_libdir}/pgsql/pgstattuple.so +%{_libdir}/pgsql/postgres_fdw.so +%{_libdir}/pgsql/refint.so +%{_libdir}/pgsql/seg.so +%{_libdir}/pgsql/tablefunc.so +%{_libdir}/pgsql/tcn.so +%{_libdir}/pgsql/test_decoding.so +%{_libdir}/pgsql/tsm_system_rows.so +%{_libdir}/pgsql/tsm_system_time.so +%{_libdir}/pgsql/unaccent.so +%{_mandir}/man1/oid2name.* +%{_mandir}/man1/pg_amcheck.* +%{_mandir}/man1/pg_archivecleanup.* +%{_mandir}/man1/pg_recvlogical.* +%{_mandir}/man1/pg_test_fsync.* +%{_mandir}/man1/pg_test_timing.* +%{_mandir}/man1/pg_waldump.* +%{_mandir}/man1/pgbench.* +%{_mandir}/man1/vacuumlo.* +%{_mandir}/man3/dblink* +%if %selinux +%{_datadir}/pgsql/contrib/sepgsql.sql +%{_libdir}/pgsql/sepgsql.so +%endif +%if %ssl +%{_datadir}/pgsql/extension/sslinfo* +%{_libdir}/pgsql/sslinfo.so +%endif +%if %uuid +%{_datadir}/pgsql/extension/uuid-ossp* +%{_libdir}/pgsql/uuid-ossp.so +%endif +%if %xml +%{_datadir}/pgsql/extension/xml2* +%{_libdir}/pgsql/pgxml.so +%endif + +%files -n %{pkgname}-server -f server.lst +%{_bindir}/initdb +%{_bindir}/pg_basebackup +%{_bindir}/pg_controldata +%{_bindir}/pg_ctl +%{_bindir}/pg_receivewal +%{_bindir}/pg_recvlogical +%{_bindir}/pg_resetwal +%{_bindir}/pg_rewind +%{_bindir}/pg_checksums +%{_bindir}/pg_verifybackup +%{_bindir}/postgres +%{_bindir}/postgresql-setup +%{_bindir}/postgresql-upgrade +%dir %{_datadir}/pgsql +%{_datadir}/pgsql/*.sample +%dir %{_datadir}/pgsql/contrib +%dir %{_datadir}/pgsql/extension +%{_datadir}/pgsql/extension/plpgsql* +%{_datadir}/pgsql/information_schema.sql +%{_datadir}/pgsql/postgres.bki +%{_datadir}/pgsql/snowball_create.sql +%{_datadir}/pgsql/sql_features.txt +%{_datadir}/pgsql/system_constraints.sql +%{_datadir}/pgsql/system_functions.sql +%{_datadir}/pgsql/system_views.sql +%{_datadir}/pgsql/fix-CVE-2024-4317.sql +%{_datadir}/pgsql/timezonesets/ +%{_datadir}/pgsql/tsearch_data/ +%dir %{_datadir}/postgresql-setup +%{_datadir}/postgresql-setup/library.sh +%dir %{_libdir}/pgsql +%{_libdir}/pgsql/*_and_*.so +%{_libdir}/pgsql/dict_snowball.so +%{_libdir}/pgsql/euc2004_sjis2004.so +%{_libdir}/pgsql/libpqwalreceiver.so +%{_libdir}/pgsql/pg_prewarm.so +%{_libdir}/pgsql/pgoutput.so +%{_libdir}/pgsql/plpgsql.so +%dir %{_libexecdir}/initscripts/legacy-actions/postgresql +%{_libexecdir}/initscripts/legacy-actions/postgresql/* +%{_libexecdir}/postgresql-check-db-dir +%dir %{_sysconfdir}/postgresql-setup +%dir %{_sysconfdir}/postgresql-setup/upgrade +%config %{_sysconfdir}/postgresql-setup/upgrade/*.conf +%{_mandir}/man1/initdb.* +%{_mandir}/man1/pg_basebackup.* +%{_mandir}/man1/pg_controldata.* +%{_mandir}/man1/pg_ctl.* +%{_mandir}/man1/pg_receivewal.* +%{_mandir}/man1/pg_resetwal.* +%{_mandir}/man1/pg_rewind.* +%{_mandir}/man1/pg_checksums.* +%{_mandir}/man1/pg_verifybackup.* +%{_mandir}/man1/postgres.* +%{_mandir}/man1/postgresql-new-systemd-unit.* +%{_mandir}/man1/postgresql-setup.* +%{_mandir}/man1/postgresql-upgrade.* +%{_sbindir}/postgresql-new-systemd-unit +%{_tmpfilesdir}/postgresql.conf +%{_unitdir}/*postgresql*.service +%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql +%attr(644,postgres,postgres) %config(noreplace) %{?_localstatedir}/lib/pgsql/.bash_profile +%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/backups +%attr(700,postgres,postgres) %dir %{?_localstatedir}/lib/pgsql/data +%ghost %attr(755,postgres,postgres) %dir %{_rundir}/postgresql +%if %pam +%config(noreplace) /etc/pam.d/postgresql +%endif + + +%files -n %{pkgname}-server-devel -f devel.lst +%{_bindir}/pg_server_config +%dir %{_datadir}/pgsql +%{_datadir}/pgsql/errcodes.txt +%dir %{_includedir}/pgsql +%{_includedir}/pgsql/server +%{_libdir}/pgsql/pgxs/ +%{_mandir}/man1/pg_server_config.* +%{_mandir}/man3/SPI_* +%{macrosdir}/macros.postgresql + + +%if ! %external_libpq +%files -n %{pkgname}-private-devel +%{_bindir}/pg_config +%{_includedir}/libpq-events.h +%{_includedir}/libpq-fe.h +%{_includedir}/postgres_ext.h +%{_includedir}/pgsql/internal/*.h +%{_includedir}/pgsql/internal/libpq/pqcomm.h +%{_includedir}/libpq/*.h +%{_libdir}/pkgconfig/*.pc +%{_libdir}/libpq.so +%{_includedir}/pg_config*.h +%endif + + +%files -n %{pkgname}-test-rpm-macros +%{_datadir}/postgresql-setup/postgresql_pkg_tests.sh +%{macrosdir}/macros.postgresql-test + + +%files -n %{pkgname}-static +%{_libdir}/libpgcommon.a +%{_libdir}/libpgport.a +%{_libdir}/libpgcommon_shlib.a +%{_libdir}/libpgport_shlib.a + + +%if %upgrade +%files -n %{pkgname}-upgrade +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin +%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib +%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs +%exclude %{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/share + + +%files -n %{pkgname}-upgrade-devel +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin/pg_config +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/include +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pkgconfig +%{_libdir}/pgsql/postgresql-%{prevmajorversion}/lib/pgxs +%{macrosdir}/macros.postgresql-upgrade +%endif + +%if %llvmjit +%files -n %{pkgname}-llvmjit +%defattr(-,root,root) +%{_libdir}/pgsql/bitcode/* +%{_libdir}/pgsql/llvmjit.so +%{_libdir}/pgsql/llvmjit_types.bc +%endif + +%if %plperl +%files -n %{pkgname}-plperl -f plperl.lst +%{_datadir}/pgsql/extension/bool_plperl* +%{_datadir}/pgsql/extension/plperl* +%{_libdir}/pgsql/bool_plperl.so +%{_libdir}/pgsql/plperl.so +%endif + + +%if %pltcl +%files -n %{pkgname}-pltcl -f pltcl.lst +%{_datadir}/pgsql/extension/pltcl* +%{_libdir}/pgsql/pltcl.so +%endif + + +%if %plpython3 +%files -n %{pkgname}-plpython3 -f plpython3.lst +%{_datadir}/pgsql/extension/plpython3* +%{_libdir}/pgsql/plpython3.so +%endif + + +%if %test +%files -n %{pkgname}-test +%attr(-,postgres,postgres) %{_libdir}/pgsql/test +%endif + + +%changelog +* Sat Sep 20 2025 victory <269047440@qq.com> - 16.10-3 - [Type] bugfix -- [DESC] enable llvm on loongarch64 - -* Mon Aug 18 2025 Wang Guodong - 16.10-1 -- Upgrade to version 16.10, fix CVE-2025-8713, CVE-2025-8714, CVE-2025-8715 - -* Wed Jun 11 2025 bbrucezhang - 16.9-2 -- Rebuilt for loongarch64 - -* Tue May 20 2025 Wang Guodong - 16.9-1 -- Upgrade to version 16.9, fix CVE-2025-4207 - -* Mon Feb 24 2025 Wang Guodong - 16.8-1 -- Upgrade to version 16.8, fix CVE-2025-1094 - -* Thu Jan 09 2025 bbrucezhang - 16.5-2 -- Rebuild for icu-74.2 - -* Fri Nov 15 2024 Wang Guodong - 16.5-1 -- Upgrade to version 16.5 -- CVEs fixed: CVE-2024-10976, CVE-2024-10977, CVE-2024-10978, CVE-2024-10979 - -* Fri Aug 30 2024 Wang Guodong - 16.4-1 -- Upgrade to version 16.4 -- CVEs fixed: CVE-2024-7348, CVE-2024-4317 - -* Fri Aug 16 2024 OpenCloudOS Release Engineering - 16.1-3 -- Rebuilt for loongarch release - -* Tue Jun 11 2024 Zhai Liangliang - 16.1-2 -- [Type] other -- [DESC] Fix build error for loongarch64 - -* Sun Apr 7 2024 Wang Guodong - 16.1-1 -- Upgrade to version 16.1 -- Remove /var/run/postgresql -- Add versioned provide to the default version - -* Tue Dec 05 2023 Upgrade Robot - 15.5-1 -- Upgrade to version 15.5 -- CVEs fixed: CVE-2023-5868 CVE-2023-5869 CVE-2023-5870 - -* Tue Sep 19 2023 OpenCloudOS Release Engineering - 15.4-3 -- Rebuilt for python 3.11 - -* Fri Sep 08 2023 OpenCloudOS Release Engineering - 15.4-2 -- Rebuilt for OpenCloudOS Stream 23.09 - -* Tue Aug 29 2023 Wang Guodong - 15.4-1 -- Upgrade to version 15.4 -- Use sysusers configuration to setup user & group -- CVEs fixed: CVE-2023-39417 CVE-2023-39418 - -* Wed Aug 23 2023 rockerzhu - 15.3-3 -- Rebuilt for icu 73.2 - -* Thu Aug 03 2023 cunshunxia - 15.3-2 -- Rebuilt for tcl 8.6.13 - -* Tue Jul 18 2023 kianli - 15.3-1 -- Upgrade to 15.3 - -* Fri Apr 28 2023 OpenCloudOS Release Engineering - 14.3-3 -- Rebuilt for OpenCloudOS Stream 23.05 - -* Fri Mar 31 2023 OpenCloudOS Release Engineering - 14.3-2 -- Rebuilt for OpenCloudOS Stream 23 - -* Mon Dec 12 2022 rockerzhu - 14.3-1 -- Initial build +- [DESC] built without llvmjit for riscv64 + +* Fri Aug 22 2025 Huang Yang - 16.10-2 +- [Type] bugfix +- [DESC] enable llvm on loongarch64 + +* Mon Aug 18 2025 Wang Guodong - 16.10-1 +- Upgrade to version 16.10, fix CVE-2025-8713, CVE-2025-8714, CVE-2025-8715 + +* Wed Jun 11 2025 bbrucezhang - 16.9-2 +- Rebuilt for loongarch64 + +* Tue May 20 2025 Wang Guodong - 16.9-1 +- Upgrade to version 16.9, fix CVE-2025-4207 + +* Mon Feb 24 2025 Wang Guodong - 16.8-1 +- Upgrade to version 16.8, fix CVE-2025-1094 + +* Thu Jan 09 2025 bbrucezhang - 16.5-2 +- Rebuild for icu-74.2 + +* Fri Nov 15 2024 Wang Guodong - 16.5-1 +- Upgrade to version 16.5 +- CVEs fixed: CVE-2024-10976, CVE-2024-10977, CVE-2024-10978, CVE-2024-10979 + +* Fri Aug 30 2024 Wang Guodong - 16.4-1 +- Upgrade to version 16.4 +- CVEs fixed: CVE-2024-7348, CVE-2024-4317 + +* Fri Aug 16 2024 OpenCloudOS Release Engineering - 16.1-3 +- Rebuilt for loongarch release + +* Tue Jun 11 2024 Zhai Liangliang - 16.1-2 +- [Type] other +- [DESC] Fix build error for loongarch64 + +* Sun Apr 7 2024 Wang Guodong - 16.1-1 +- Upgrade to version 16.1 +- Remove /var/run/postgresql +- Add versioned provide to the default version + +* Tue Dec 05 2023 Upgrade Robot - 15.5-1 +- Upgrade to version 15.5 +- CVEs fixed: CVE-2023-5868 CVE-2023-5869 CVE-2023-5870 + +* Tue Sep 19 2023 OpenCloudOS Release Engineering - 15.4-3 +- Rebuilt for python 3.11 + +* Fri Sep 08 2023 OpenCloudOS Release Engineering - 15.4-2 +- Rebuilt for OpenCloudOS Stream 23.09 + +* Tue Aug 29 2023 Wang Guodong - 15.4-1 +- Upgrade to version 15.4 +- Use sysusers configuration to setup user & group +- CVEs fixed: CVE-2023-39417 CVE-2023-39418 + +* Wed Aug 23 2023 rockerzhu - 15.3-3 +- Rebuilt for icu 73.2 + +* Thu Aug 03 2023 cunshunxia - 15.3-2 +- Rebuilt for tcl 8.6.13 + +* Tue Jul 18 2023 kianli - 15.3-1 +- Upgrade to 15.3 + +* Fri Apr 28 2023 OpenCloudOS Release Engineering - 14.3-3 +- Rebuilt for OpenCloudOS Stream 23.05 + +* Fri Mar 31 2023 OpenCloudOS Release Engineering - 14.3-2 +- Rebuilt for OpenCloudOS Stream 23 + +* Mon Dec 12 2022 rockerzhu - 14.3-1 +- Initial build \ No newline at end of file