Browse Source

updated 5 packages

clamav-0.102.3-1

galera-26.4.4-1

mariadb-10.4.13-1

php74-7.4.6-1

postgresql-12.3-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@12399 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 5 years ago
parent
commit
c203521196
5 changed files with 371 additions and 87 deletions
  1. 142 27
      c/clamav/clamav-vl.spec
  2. 7 4
      g/galera/galera-vl.spec
  3. 117 21
      m/mariadb/mariadb-vl.spec
  4. 5 2
      p/php74/php74-vl.spec
  5. 100 33
      p/postgresql/postgresql-vl.spec

+ 142 - 27
c/clamav/clamav-vl.spec

@@ -1,3 +1,4 @@
+%bcond_with systemd
 %bcond_with external_llvm
 %bcond_with external_llvm
 
 
 %define dbdir %{_localstatedir}/lib/clamav
 %define dbdir %{_localstatedir}/lib/clamav
@@ -13,10 +14,14 @@
 Summary: Clam AntiVirus
 Summary: Clam AntiVirus
 Summary(ja): Clamアンチウィルススキャナ
 Summary(ja): Clamアンチウィルススキャナ
 Name: clamav
 Name: clamav
-Version: 0.102.2
+Version: 0.102.3
-Release: 1%{?_dist_release}
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
-License: GPL
 Group: Applications/System
 Group: Applications/System
+Vendor: Project Vine
+Distribution: Vine Linux
+Packager: tomop, inagaki
+
+License: GPL
 URL: https://www.clamav.net/
 URL: https://www.clamav.net/
 Source0: https://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
 Source0: https://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
 Source1: clamd.init
 Source1: clamd.init
@@ -25,6 +30,13 @@ Source3: clamav-milter.init
 Source4: clamav.logrotate
 Source4: clamav.logrotate
 Source5: clamav-milter.logrotate
 Source5: clamav-milter.logrotate
 
 
+#for clamonacc
+Source100:  clamonacc.service
+#for clamav-milter.systemd
+Source330:  clamav-milter.systemd
+#for scanner-systemd/server-systemd
+Source530:  clamd.service
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: bzip2-devel, curl-devel > 7.10.0, gmp-devel, ncurses-devel
 BuildRequires: bzip2-devel, curl-devel > 7.10.0, gmp-devel, ncurses-devel
 BuildRequires: openssl-devel, pcre-devel, libxml2-devel, zlib-devel
 BuildRequires: openssl-devel, pcre-devel, libxml2-devel, zlib-devel
@@ -37,10 +49,12 @@ BuildRequires: sendmail-devel
 %endif
 %endif
 Requires: logrotate
 Requires: logrotate
 Requires(pre): shadow-utils, grep
 Requires(pre): shadow-utils, grep
-
+%if %{with systemd}
-Vendor: Project Vine
+%{?systemd_requires}
-Distribution: Vine Linux
+%else
-Packager: tomop, inagaki
+Requires(post): chkconfig
+Requires(preun): chkconfig
+%endif
 
 
 %description
 %description
 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
@@ -59,12 +73,19 @@ AMaViS、圧縮ファイルをサポートし、OpenAntivirus.orgのウィルス
 %package milter
 %package milter
 Summary: Virus scanner for sendmail/postfix
 Summary: Virus scanner for sendmail/postfix
 Group: Applications/System
 Group: Applications/System
+%if %{with systemd}
+%{?systemd_requires}
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+%endif
 
 
 %description milter
 %description milter
 clamav-milter is a milter module to scan mails using Clam AntiVirus.
 clamav-milter is a milter module to scan mails using Clam AntiVirus.
 
 
 %endif
 %endif
 
 
+
 %package devel
 %package devel
 Group: Development/Libraries
 Group: Development/Libraries
 Summary: headers and libraries for development using Clam AntiVirus
 Summary: headers and libraries for development using Clam AntiVirus
@@ -80,19 +101,13 @@ Clam AntiVirus.
  clamav-devel パッケージは、Clam AntiVirus を用いた開発を行うための
  clamav-devel パッケージは、Clam AntiVirus を用いた開発を行うための
 ヘッダファイルやライブラリファイルを提供します。
 ヘッダファイルやライブラリファイルを提供します。
 
 
-%prep
-%setup -q
 
 
-perl -pi -e 's|^#PidFile .+$|PidFile /var/run/clamav/clamd.pid|' etc/clamd.conf.sample
+%debug_package
-perl -pi -e 's|^#LogFile .+$|LogFile /var/log/clamav/clamd.log|' etc/clamd.conf.sample
 
 
-perl -pi -e 's|^#PidFile .+$|PidFile /var/run/clamav/freshclam.pid|' etc/freshclam.conf.sample
-perl -pi -e 's|^#UpdateLogFile .+$|UpdateLogFile /var/log/clamav/freshclam.log|' etc/freshclam.conf.sample
 
 
-%if %{?milter}
+%prep
-perl -pi -e 's|^#PidFile .+$|PidFile /var/run/clamav/clamav-milter.pid|' etc/clamav-milter.conf.sample
+%setup -q
-perl -pi -e 's|^#LogFile .+$|LogFile /var/log/clamav/clamav-milter.log|' etc/clamav-milter.conf.sample
+
-%endif
 
 
 %build
 %build
 %if %{?milter}
 %if %{?milter}
@@ -102,7 +117,12 @@ export have_milter=yes
 
 
 CFLAGS="%{pcre_cflags}" \
 CFLAGS="%{pcre_cflags}" \
 %configure \
 %configure \
+	--disable-rpath \
+	--disable-silent-rules \
+	--enable-clamdtop \
 	--disable-clamav \
 	--disable-clamav \
+	--enable-id-check \
+	--enable-dns \
 %if %{with external_llvm}
 %if %{with external_llvm}
 	--enable-llvm \
 	--enable-llvm \
 %else
 %else
@@ -121,34 +141,84 @@ make %{?_smp_mflags}
 
 
 %install
 %install
 rm -rf %{buildroot}
 rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_sysconfdir}/clamd.d
 mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
 mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
 mkdir -p %{buildroot}%{_initdir}
 mkdir -p %{buildroot}%{_initdir}
 mkdir -p %{buildroot}%{_localstatedir}/run/clamav
 mkdir -p %{buildroot}%{_localstatedir}/run/clamav
 mkdir -p %{buildroot}%{_localstatedir}/log/clamav
 mkdir -p %{buildroot}%{_localstatedir}/log/clamav
 make install DESTDIR=%{buildroot} transform='s,x,x,'
 make install DESTDIR=%{buildroot} transform='s,x,x,'
+
+%if %{with systemd}
+rm -f %{buildroot}%{_unitdir}/clamav-daemon.s*
+install -Dpm 0644 %{SOURCE100} %{buildroot}%{_unitdir}/clamonacc.service
+install -Dpm 0644 %{SOURCE530} %{buildroot}%{_unitdir}/clamd.service
+mkdir -p %{buildroot}%{_tmpfilesdir}
+cat << EOF > %{buildroot}%{_tmpfilesdir}/clamav.conf
+d %{_rundir}/clamav 0710 clamav clamav
+EOF
+%else
 install -m755 %{SOURCE1} %{buildroot}%{_initdir}/clamd
 install -m755 %{SOURCE1} %{buildroot}%{_initdir}/clamd
 install -m755 %{SOURCE2} %{buildroot}%{_initdir}/freshclam
 install -m755 %{SOURCE2} %{buildroot}%{_initdir}/freshclam
-%if %{?milter}
-install -m755 %{SOURCE3} %{buildroot}%{_initdir}/clamav-milter
-install -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/clamav-milter
-mv %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample %{buildroot}%{_sysconfdir}/clamav-milter.conf
 %endif
 %endif
+
 install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
 install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
 
 
+sed -ri \
+	-e 's!^Example!#Example!' \
+	-e 's|^#UpdateLogFile .*$|UpdateLogFile /var/log/clamav/freshclam.log|' \
+	%{buildroot}%_sysconfdir/freshclam.conf.sample
+
+sed -ri \
+	-e 's!^Example!#Example!' \
+	-e 's!^#?(LogFile ).*!#\1/var/log/clamav/clamd.log!g' \
+	-e 's!^#?(LocalSocket ).*!#\1%{_rundir}/clamav/clamd.sock!g' \
+	-e 's! /usr/local/share/clamav,! %{_sharedstatedir}/clamav,!g' \
+	%{buildroot}%_sysconfdir/clamd.conf.sample
+
+%if %{with systemd}
+sed -i -e 's|^#PidFile /var/run/|PidFile %{_rundir}/clamav/|' \
+	%{buildroot}%{_sysconfdir}/clamd.conf.sample \
+	%{buildroot}%{_sysconfdir}/freshclam.conf.sample
+%else
+sed -i -e 's|^#PidFile /var/run/|PidFile %{_localstatedir}/run/clamav/|' \
+	%{buildroot}%{_sysconfdir}/clamd.conf.sample \
+	%{buildroot}%{_sysconfdir}/freshclam.conf.sample
+%endif
+
 mv %{buildroot}%{_sysconfdir}/clamd.conf.sample %{buildroot}%{_sysconfdir}/clamd.conf
 mv %{buildroot}%{_sysconfdir}/clamd.conf.sample %{buildroot}%{_sysconfdir}/clamd.conf
 mv %{buildroot}%{_sysconfdir}/freshclam.conf.sample %{buildroot}%{_sysconfdir}/freshclam.conf
 mv %{buildroot}%{_sysconfdir}/freshclam.conf.sample %{buildroot}%{_sysconfdir}/freshclam.conf
 
 
-perl -pi -e 's|^#PidFile /var/run/|PidFile %{_localstatedir}/run/clamav/|' \
+%if %{?milter}
-	%{buildroot}%{_sysconfdir}/clamd.conf \
+sed -ri \
-	%{buildroot}%{_sysconfdir}/freshclam.conf
+    -e 's!^Example!#Example!' \
+	-e 's|^#LogFile .+$|LogFile /var/log/clamav/clamav-milter.log|' \
+    %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample
+
+%if %{with systemd}
+install -Dpm 0644 %{SOURCE330} %{buildroot}%{_unitdir}/clamav-milter.service
+sed -ri \
+	-e 's|^#PidFile .+$|PidFile /run/clamav/clamav-milter.pid|' \
+    %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample
+%else
+install -m755 %{SOURCE3} %{buildroot}%{_initdir}/clamav-milter
+sed -ri \
+	-e 's|^#PidFile .+$|PidFile /var/run/clamav/clamav-milter.pid|' \
+    %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample
+%endif
+install -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/clamav-milter
+
+mv %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample %{buildroot}%{_sysconfdir}/clamav-milter.conf
+%endif
 
 
 rm -f %{buildroot}%{_libdir}/lib*a
 rm -f %{buildroot}%{_libdir}/lib*a
 
 
 mkdir -p %{buildroot}%{dbdir}
 mkdir -p %{buildroot}%{dbdir}
 
 
+
 %clean
 %clean
 rm -rf %{buildroot}
 rm -rf %{buildroot}
 
 
+
 %pre
 %pre
 if ! grep -q '^clamav:' /etc/group; then
 if ! grep -q '^clamav:' /etc/group; then
     /usr/sbin/groupadd -r clamav
     /usr/sbin/groupadd -r clamav
@@ -159,16 +229,27 @@ fi
 
 
 %post
 %post
 /sbin/ldconfig
 /sbin/ldconfig
+%if %{with systemd}
+%systemd_post clamd.service
+%systemd_post clamav-freshclam.service
+%{?with_tmpfiles:/bin/systemd-tmpfiles --create %{_tmpfilesdir}/clamav.conf || :}
+%else
 /sbin/chkconfig --add clamd
 /sbin/chkconfig --add clamd
 /sbin/chkconfig --add freshclam
 /sbin/chkconfig --add freshclam
+%endif
 
 
 %preun
 %preun
-if [ "$1" = 0 ]; then
+%if %{with systemd}
+%systemd_preun clamd.service
+%systemd_preun clamav-freshclam.service
+%else
+if [ "$1" = 0 -o -x /bin/systemctl ]; then
     [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd stop
     [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd stop
     [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam stop
     [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam stop
     /sbin/chkconfig --del clamd
     /sbin/chkconfig --del clamd
     /sbin/chkconfig --del freshclam
     /sbin/chkconfig --del freshclam
 fi
 fi
+%endif
 
 
 %postun
 %postun
 /sbin/ldconfig
 /sbin/ldconfig
@@ -180,33 +261,59 @@ if [ "$1" = 0 ]; then
         /usr/sbin/groupdel clamav
         /usr/sbin/groupdel clamav
     fi
     fi
 else
 else
+%if %{with systemd}
+%systemd_postun_with_restart clamd.service
+%systemd_postun_with_restart clamav-freshclam.service
+%else
     [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd restart
     [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd restart
     [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam restart
     [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam restart
+%endif
 fi
 fi
 
 
 %if %{?milter}
 %if %{?milter}
 %post milter
 %post milter
+%if %{with systemd}
+%systemd_post clamav-milter.service
+%else
 /sbin/chkconfig --add clamav-milter
 /sbin/chkconfig --add clamav-milter
+%endif
 
 
 %preun milter
 %preun milter
-if [ "$1" = 0 ]; then
+%if %{with systemd}
+%systemd_preun clamav-milter.service
+%else
+if [ "$1" = 0 -o -x /bin/systemctl ]; then
     [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamav-milter stop
     [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamav-milter stop
     /sbin/chkconfig --del clamav-milter
     /sbin/chkconfig --del clamav-milter
 fi
 fi
+%endif
 
 
 %postun milter
 %postun milter
+%if %{with systemd}
+%systemd_postun_with_restart clamav-milter.service
+%else
 if [ "$1" -ge 1 ]; then
 if [ "$1" -ge 1 ]; then
     [ ! -f /var/run/clamav/clamav-milter.pid ] || /etc/init.d/clamav-milter restart
     [ ! -f /var/run/clamav/clamav-milter.pid ] || /etc/init.d/clamav-milter restart
 fi
 fi
 %endif
 %endif
+%endif
+
 
 
 %files 
 %files 
 %defattr(-,root,root)
 %defattr(-,root,root)
 %license COPYING*
 %license COPYING*
 %doc NEWS* README* examples
 %doc NEWS* README* examples
 %doc docs/UserManual
 %doc docs/UserManual
+%if %{with systemd}
+%{_unitdir}/clamav-freshclam.service
+%{_unitdir}/clamd.service
+%{_unitdir}/clamonacc.service
+%{_tmpfilesdir}/clamav.conf
+%else
 %{_initdir}/clamd
 %{_initdir}/clamd
 %{_initdir}/freshclam
 %{_initdir}/freshclam
+%attr(-,clamav,clamav) %dir %{_localstatedir}/run/clamav
+%endif
 %config(noreplace) %{_sysconfdir}/clamd.conf
 %config(noreplace) %{_sysconfdir}/clamd.conf
 %config(noreplace) %{_sysconfdir}/freshclam.conf
 %config(noreplace) %{_sysconfdir}/freshclam.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/clamav
 %config(noreplace) %{_sysconfdir}/logrotate.d/clamav
@@ -215,7 +322,6 @@ fi
 %{_sbindir}/*
 %{_sbindir}/*
 %{_libdir}/lib*.so.*
 %{_libdir}/lib*.so.*
 %{_libdir}/libclamunrar_iface.so
 %{_libdir}/libclamunrar_iface.so
-%attr(-,clamav,clamav) %dir %{_localstatedir}/run/clamav
 %attr(-,clamav,clamav) %dir %{_localstatedir}/log/clamav
 %attr(-,clamav,clamav) %dir %{_localstatedir}/log/clamav
 %attr(0755,clamav,clamav) %dir %{dbdir}
 %attr(0755,clamav,clamav) %dir %{dbdir}
 #%attr(-,clamav,clamav) %config(noreplace) %{dbdir}/main.cvd
 #%attr(-,clamav,clamav) %config(noreplace) %{dbdir}/main.cvd
@@ -226,7 +332,11 @@ fi
 
 
 %files milter
 %files milter
 %defattr(-,root,root)
 %defattr(-,root,root)
+%if %{with systemd}
+%{_unitdir}/clamav-milter.service
+%else
 %{_initdir}/clamav-milter
 %{_initdir}/clamav-milter
+%endif
 %config(noreplace) %{_sysconfdir}/clamav-milter.conf
 %config(noreplace) %{_sysconfdir}/clamav-milter.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/clamav-milter
 %config(noreplace) %{_sysconfdir}/logrotate.d/clamav-milter
 %{_sbindir}/clamav-milter
 %{_sbindir}/clamav-milter
@@ -243,6 +353,11 @@ fi
 %{_includedir}/*
 %{_includedir}/*
 
 
 %changelog
 %changelog
+* Thu May 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.102.3-1
+- new upstream release.
+- added systemd support (disabled as default).
+- added debuginfo.
+
 * Thu Feb 06 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.102.2-1
 * Thu Feb 06 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.102.2-1
 - new upstream release.
 - new upstream release.
 
 

+ 7 - 4
g/galera/galera-vl.spec

@@ -2,7 +2,7 @@
 %bcond_with		python3
 %bcond_with		python3
 
 
 %define galera_api_version 26.4
 %define galera_api_version 26.4
-%define mariadb_version 10.4.12
+%define mariadb_version 10.4.13
 
 
 %if %{with python3}
 %if %{with python3}
 %global scons scons-3
 %global scons scons-3
@@ -11,8 +11,8 @@
 %endif
 %endif
 
 
 Name:           galera
 Name:           galera
-Version:        %{galera_api_version}.3
+Version:        %{galera_api_version}.4
-Release:        2%{?_dist_release}%{?with_systemd:.systemd}
+Release:        1%{?_dist_release}%{?with_systemd:.systemd}
 Summary:        Synchronous multi-master wsrep provider (replication engine)
 Summary:        Synchronous multi-master wsrep provider (replication engine)
 
 
 License:        GPLv2
 License:        GPLv2
@@ -100,7 +100,7 @@ install -D -m 644 scripts/packages/README-MySQL %{buildroot}%{_docdir}/galera/RE
 %if %{with systemd}
 %if %{with systemd}
 %systemd_preun garbd.service
 %systemd_preun garbd.service
 %else
 %else
-if [ $1 = 0 ]; then
+if [ $1 = 0 -o -x /bin/systemctl ]; then
 /sbin/service garbd stop >/dev/null 2>/dev/null ||:
 /sbin/service garbd stop >/dev/null 2>/dev/null ||:
 /sbin/chkconfig --del garbd
 /sbin/chkconfig --del garbd
 fi
 fi
@@ -134,6 +134,9 @@ fi
 
 
 
 
 %changelog
 %changelog
+* Thu May 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 26.4.4-1
+- new upstream release.
+
 * Sat Apr 25 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 26.4.3-2
 * Sat Apr 25 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 26.4.3-2
 - rebuilt with boost-1.72.0.
 - rebuilt with boost-1.72.0.
 
 

+ 117 - 21
m/mariadb/mariadb-vl.spec

@@ -1,6 +1,9 @@
+%bcond_with systemd
 %bcond_with source
 %bcond_with source
 %bcond_without onigmo
 %bcond_without onigmo
 
 
+%global daemon_name mariadb
+
 %define mysqld_user		mysql
 %define mysqld_user		mysql
 %define mysqld_group		mysql
 %define mysqld_group		mysql
 %define mysqldatadir /var/lib/mysql
 %define mysqldatadir /var/lib/mysql
@@ -11,32 +14,41 @@
 
 
 %define _unpackaged_files_terminate_build 1
 %define _unpackaged_files_terminate_build 1
 
 
+%define mariadb_version		10.4.13
 %define mariadb_base_version	10.4
 %define mariadb_base_version	10.4
-%define mariadb_version		10.4.12
+%define mroonga_version		10.02
-%define mroonga_version		9.12
+%define groonga_version		10.0.2
-%define groonga_version		9.1.2
 %define client_version		18
 %define client_version		18
 
 
 %define galera_api_version	26.4
 %define galera_api_version	26.4
 
 
-Vendor: Project Vine
+Name:		mariadb
-Distribution: Vine Linux
-Packager:	tomop
-
-Name: mariadb
 Summary:	MariaDB: a very fast and robust SQL database server
 Summary:	MariaDB: a very fast and robust SQL database server
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
-Release:	1%{_dist_release}
+Release:	1%{_dist_release}%{?with_systemd:.systemd}
-
 Group:		Applications/Databases
 Group:		Applications/Databases
+Vendor:		Project Vine
+Distribution:	Vine Linux
+Packager:	tomop
+
 License:	GPL2
 License:	GPL2
 URL:		https://mariadb.org/
 URL:		https://mariadb.org/
-
 Source:		https://downloads.mariadb.com/MariaDB/mariadb-%{version}/source/mariadb-%{version}.tar.gz
 Source:		https://downloads.mariadb.com/MariaDB/mariadb-%{version}/source/mariadb-%{version}.tar.gz
+
+# for systemd
+Source10:	mysql.tmpfiles.d.in
+Source11:	mysql.service.in
+Source12:	mysql-prepare-db-dir.sh
+Source14:	mysql-check-socket.sh
+Source15:	mysql-scripts-common.sh
+Source16:	mysql-check-upgrade.sh
+Source18:	mysql@.service.in
+
 # Don't depend on lib::mtr*
 # Don't depend on lib::mtr*
 Source998:	perl-requires.sh
 Source998:	perl-requires.sh
 Source1000:	macros.mariadb.in
 Source1000:	macros.mariadb.in
 
 
+Patch0:		mariadb-scripts.patch
 # replace mroonga to the newest version.
 # replace mroonga to the newest version.
 #patch1000: mariadb-%{mariadb_version}-mroonga-master.patch
 #patch1000: mariadb-%{mariadb_version}-mroonga-master.patch
 Patch1000: 0001-MariaDB-%{mariadb_version}-Mroonga-v%{mroonga_version}-Groonga-v%{groonga_version}.patch
 Patch1000: 0001-MariaDB-%{mariadb_version}-Mroonga-v%{mroonga_version}-Groonga-v%{groonga_version}.patch
@@ -58,6 +70,14 @@ BuildRequires:	lz4-devel
 Requires:		fileutils sh-utils
 Requires:		fileutils sh-utils
 Provides:		msqlormysql MySQL mysql
 Provides:		msqlormysql MySQL mysql
 Obsoletes:		mysql MySQL5
 Obsoletes:		mysql MySQL5
+%if %{with systemd}
+BuildRequires:	systemd
+BuildRequires:	systemd-devel
+%{?systemd_requires}
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+%endif
 
 
 # From the manual
 # From the manual
 %description
 %description
@@ -90,6 +110,7 @@ conditions of the GNU General Public License Version 2 (http://www.gnu.org/licen
 MariaDB documentation can be found at http://kb.askmonty.org/
 MariaDB documentation can be found at http://kb.askmonty.org/
 MariaDB bug reports should be submitted through https://mariadb.atlassian.net/
 MariaDB bug reports should be submitted through https://mariadb.atlassian.net/
 
 
+
 %package mroonga
 %package mroonga
 ##Version: %{mroonga_version}
 ##Version: %{mroonga_version}
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
@@ -106,6 +127,7 @@ Mroonga is a fast fulltext searchable storage plugin for MariaDB.
 It is based on groonga that is a fast fulltext search engine and
 It is based on groonga that is a fast fulltext search engine and
 column store. Groonga is good at real-time update.
 column store. Groonga is good at real-time update.
 
 
+
 %package connect
 %package connect
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
 Summary:	CONNECT storage engine for MariaDB.
 Summary:	CONNECT storage engine for MariaDB.
@@ -125,6 +147,7 @@ This storage engine supports table partitioning, MariaDB virtual
 columns and also permits defining special columns such as ROWID,
 columns and also permits defining special columns such as ROWID,
 FILEID, and SERVID.
 FILEID, and SERVID.
 
 
+
 %package galera
 %package galera
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
 Summary:	The configuration files and scripts for galera replication
 Summary:	The configuration files and scripts for galera replication
@@ -137,6 +160,7 @@ Requires:	galera(%{galera_api_version})
 %description galera
 %description galera
  This package contains the files for MariaDB Galera Cluster.
  This package contains the files for MariaDB Galera Cluster.
 
 
+
 %ifarch x86_64
 %ifarch x86_64
 %package tokudb
 %package tokudb
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
@@ -152,6 +176,7 @@ better performance.
 
 
 %endif
 %endif
 
 
+
 %package client
 %package client
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
 Summary: MariaDB - Client
 Summary: MariaDB - Client
@@ -186,6 +211,7 @@ Requires: %{name}-devel
 %description static
 %description static
 This package provides static libraries of MariaDB.
 This package provides static libraries of MariaDB.
 
 
+
 %if %{with source}
 %if %{with source}
 %package source
 %package source
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
@@ -200,6 +226,7 @@ This package contains the sources files of MariaDB.
 
 
 %endif
 %endif
 
 
+
 %package test
 %package test
 Version:	%{mariadb_version}
 Version:	%{mariadb_version}
 Requires: %{name}-client = %{version}-%{release} perl-DBI perl
 Requires: %{name}-client = %{version}-%{release} perl-DBI perl
@@ -224,13 +251,22 @@ This package contains a version of the MariaDB server that can be embedded
 into a client application instead of running as a separate process.
 into a client application instead of running as a separate process.
 
 
 
 
+%debug_package
+
+
 %prep
 %prep
 %setup -q
 %setup -q
+%if %{with systemd}
+%patch0 -p1
+%endif
 git --git-dir= apply -p1 %{PATCH1000}
 git --git-dir= apply -p1 %{PATCH1000}
-#patch1000 -p1 -b .mroonga
+cp -f \
+	%{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE14} \
+	%{SOURCE15} %{SOURCE16} %{SOURCE18} \
+	scripts/
 
 
-%build
 
 
+%build
 # Be strict about variables, bail at earliest opportunity, etc.
 # Be strict about variables, bail at earliest opportunity, etc.
 set -eu
 set -eu
 
 
@@ -292,11 +328,34 @@ install -d %{buildroot}%{_infodir}
   make DESTDIR=%{buildroot} install
   make DESTDIR=%{buildroot} install
 )
 )
 
 
+%if %{with systemd}
+install -d %{buildroot}%{_libexecdir}
+pushd release
+rm -rf %{buildroot}/usr/lib/systemd/system
+# install systemd unit files and scripts for handling server startup
+install -D -p -m 644 scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service
+install -D -p -m 644 scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}.service
+# Remove the upstream version
+rm -f %{buildroot}%{_tmpfilesdir}/tmpfiles.conf
+# Install downstream version
+install -D -p -m 0644 scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf
+# helper scripts for service starting
+install -p -m 755 scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir
+install -p -m 755 scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket
+install -p -m 755 scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade
+install -p -m 644 scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common
+popd
+%else
+# drop systemd files.
+rm -rf %{buildroot}%{_sysconfdir}/systemd
+%endif
+
 install -m 0644  Docs/mysql.info %{buildroot}%{_infodir}
 install -m 0644  Docs/mysql.info %{buildroot}%{_infodir}
 rm -rf ./doc
 rm -rf ./doc
 mv -f %{buildroot}%{_docdir} ./
 mv -f %{buildroot}%{_docdir} ./
 rm doc/README-wsrep
 rm doc/README-wsrep
 
 
+rm -rf ./groonga ./groonga-normalizer-mysql
 mv -f %{buildroot}%{_datadir}/groonga ./
 mv -f %{buildroot}%{_datadir}/groonga ./
 mv -f %{buildroot}%{_datadir}/groonga-normalizer-mysql ./
 mv -f %{buildroot}%{_datadir}/groonga-normalizer-mysql ./
 
 
@@ -322,6 +381,10 @@ rm -f %{buildroot}%{_libdir}/mysql/plugin/daemon_example.ini
 pushd release
 pushd release
 install -m644 ./storage/tokudb/tokudb.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/
 install -m644 ./storage/tokudb/tokudb.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/
 popd
 popd
+%if %{with systemd}
+mkdir -p %{buildroot}%{_unitdir}/mariadb.service.d
+mv %{buildroot}/etc/systemd/system/mariadb.service.d/tokudb.conf %{buildroot}%{_unitdir}/mariadb.service.d/tokudb.conf
+%endif
 %else
 %else
 rm -f %{buildroot}%{_mandir}/man1/tokuft*
 rm -f %{buildroot}%{_mandir}/man1/tokuft*
 %endif
 %endif
@@ -340,13 +403,12 @@ perl -pi -e 's,-lmariadb,%{_libdir}/libmariadbclient.a,' %{buildroot}%{_datadir}
 
 
 # install pam_user_map.so to /lib64/security for 64bit architectures
 # install pam_user_map.so to /lib64/security for 64bit architectures
 %ifarch x86_64
 %ifarch x86_64
-mkdir -p %{buildroot}/%{_lib}/security
+if [ ! -e %{buildroot}/%{_lib}/security/pam_user_map.so ]; then
-mv %{buildroot}/lib/security/pam_user_map.so %{buildroot}/%{_lib}/security/
+	mkdir -p %{buildroot}/%{_lib}/security
+	mv %{buildroot}/lib/security/pam_user_map.so %{buildroot}/%{_lib}/security/
+fi
 %endif
 %endif
 
 
-# drop systemd files.
-rm -rf %{buildroot}%{_sysconfdir}/systemd
-
 # drop client library
 # drop client library
 rm -f %{buildroot}%{_libdir}/libmariadb.so*
 rm -f %{buildroot}%{_libdir}/libmariadb.so*
 rm -f %{buildroot}%{_prefix}/lib/pkgconfig/libmariadb.pc
 rm -f %{buildroot}%{_prefix}/lib/pkgconfig/libmariadb.pc
@@ -364,12 +426,16 @@ useradd -M -r -d $datadir -s /bin/bash -c "MySQL server" -g mysql mysql 2> /dev/
 usermod -g mysql mysql 2> /dev/null || true
 usermod -g mysql mysql 2> /dev/null || true
 
 
 %post server
 %post server
-
 # Make MySQL start/shutdown automatically when the machine does it.
 # Make MySQL start/shutdown automatically when the machine does it.
+
 if [ $1 = 1 ] ; then
 if [ $1 = 1 ] ; then
+%if %{with systemd}
+%systemd_post %{daemon_name}.service
+%else
   if [ -x /sbin/chkconfig ] ; then
   if [ -x /sbin/chkconfig ] ; then
           /sbin/chkconfig --add mysql
           /sbin/chkconfig --add mysql
   fi
   fi
+%endif
 
 
   basedir=`/usr/bin/my_print_defaults --mysqld|sed -ne 's/^--basedir=//p'|tail -1`
   basedir=`/usr/bin/my_print_defaults --mysqld|sed -ne 's/^--basedir=//p'|tail -1`
   if [ -z "$basedir" ] ; then
   if [ -z "$basedir" ] ; then
@@ -418,6 +484,10 @@ if [ $1 = 1 ] ; then
 fi
 fi
 
 
 %preun server
 %preun server
+%if %{with systemd}
+%systemd_preun %{daemon_name}.service
+%else
+%endif
 if [ $1 = 0 ] ; then
 if [ $1 = 0 ] ; then
 	# Stop MySQL before uninstalling it
 	# Stop MySQL before uninstalling it
 	if [ -x /etc/init.d/mysql ] ; then
 	if [ -x /etc/init.d/mysql ] ; then
@@ -430,6 +500,9 @@ if [ $1 = 0 ] ; then
 fi
 fi
 
 
 %postun server
 %postun server
+%if %{with systemd}
+%systemd_postun_with_restart %{daemon_name}.service
+%else
 if [ $1 -ge 1 ]; then
 if [ $1 -ge 1 ]; then
   if [ -x /etc/init.d/mysql ] ; then
   if [ -x /etc/init.d/mysql ] ; then
     # only restart the server if it was alredy running
     # only restart the server if it was alredy running
@@ -437,6 +510,8 @@ if [ $1 -ge 1 ]; then
     /etc/init.d/mysql restart
     /etc/init.d/mysql restart
   fi
   fi
 fi
 fi
+%endif
+
 
 
 %pre mroonga
 %pre mroonga
 if [ $1 -gt 1 ]; then
 if [ $1 -gt 1 ]; then
@@ -585,12 +660,22 @@ fi
 %exclude %{_libdir}/mysql/plugin/ha_connect.so
 %exclude %{_libdir}/mysql/plugin/ha_connect.so
 %exclude %{_libdir}/mysql/plugin/ha_mroonga.so
 %exclude %{_libdir}/mysql/plugin/ha_mroonga.so
 %exclude %{_datadir}/mysql/mroonga
 %exclude %{_datadir}/mysql/mroonga
+%exclude %{_datadir}/mysql/systemd/use_galera_new_cluster.conf
 %dir %{_sysconfdir}/my.cnf.d
 %dir %{_sysconfdir}/my.cnf.d
 %config(noreplace) %{_sysconfdir}/my.cnf.d/enable_encryption.preset
 %config(noreplace) %{_sysconfdir}/my.cnf.d/enable_encryption.preset
 %config(noreplace) %{_sysconfdir}/my.cnf.d/server.cnf
 %config(noreplace) %{_sysconfdir}/my.cnf.d/server.cnf
 %config(noreplace) %{_sysconfdir}/security/user_map.conf
 %config(noreplace) %{_sysconfdir}/security/user_map.conf
 %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
 %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
+%if %{with systemd}
+%{_bindir}/mariadb-service-convert
+%{_unitdir}/*.service
+%{_tmpfilesdir}/%{name}.conf
+%dir %{_unitdir}/mariadb.service.d
+%{_libexecdir}/*
+%{_sysusersdir}/%{name}.conf
+%else
 %{_sysconfdir}/init.d/mysql
 %{_sysconfdir}/init.d/mysql
+%endif
 %{_datadir}/mysql
 %{_datadir}/mysql
 %attr(755, mysql, mysql) %dir %{mysqldatadir}
 %attr(755, mysql, mysql) %dir %{mysqldatadir}
 %ifarch x86_64
 %ifarch x86_64
@@ -621,6 +706,9 @@ fi
 %config(noreplace) %{_sysconfdir}/my.cnf.d/galera.cnf
 %config(noreplace) %{_sysconfdir}/my.cnf.d/galera.cnf
 %{_bindir}/galera_new_cluster
 %{_bindir}/galera_new_cluster
 %{_bindir}/galera_recovery
 %{_bindir}/galera_recovery
+%if %{with systemd}
+%{_datadir}/mysql/systemd/use_galera_new_cluster.conf
+%endif
 
 
 %ifarch x86_64
 %ifarch x86_64
 %files tokudb
 %files tokudb
@@ -630,6 +718,9 @@ fi
 %{_libdir}/mysql/plugin/ha_tokudb.so
 %{_libdir}/mysql/plugin/ha_tokudb.so
 %{_bindir}/tokuft*
 %{_bindir}/tokuft*
 %doc %{_mandir}/man1/tokuft*
 %doc %{_mandir}/man1/tokuft*
+%if %{with systemd}
+%{_unitdir}/mariadb.service.d/tokudb.conf
+%endif
 %endif
 %endif
 
 
 %files client
 %files client
@@ -697,7 +788,7 @@ fi
 %{_bindir}/mysql_config
 %{_bindir}/mysql_config
 %{_includedir}/mysql
 %{_includedir}/mysql
 %{_datadir}/aclocal/mysql.m4
 %{_datadir}/aclocal/mysql.m4
-%{_datadir}/pkgconfig/mariadb.pc
+%{_libdir}/pkgconfig/mariadb.pc
 %exclude %{_libdir}/pkgconfig/libmariadb.pc
 %exclude %{_libdir}/pkgconfig/libmariadb.pc
 %{_libdir}/*.so
 %{_libdir}/*.so
 %{_sysconfdir}/rpm/*
 %{_sysconfdir}/rpm/*
@@ -743,6 +834,11 @@ fi
 
 
 
 
 %changelog
 %changelog
+* Thu May 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.4.13-1
+- new upstream release.
+- replaced patch1000 to update Groonga to v10.0.2.
+- added systemd support (disabled as default).
+
 * Mon Feb 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.4.12-1
 * Mon Feb 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.4.12-1
 - new upstream release.
 - new upstream release.
 - replaced patch1000 to update Groonga to v9.1.2.
 - replaced patch1000 to update Groonga to v9.1.2.
@@ -924,7 +1020,7 @@ fi
 
 
 * Sat Sep 15 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.5.27-1
 * Sat Sep 15 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.5.27-1
 - new upstream release.
 - new upstream release.
-- added a sub-package 'MySQL-source".
+- added a sub-package "MySQL-source".
 - added some macros for rpm.
 - added some macros for rpm.
 
 
 * Thu Jun 21 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.5.25-1
 * Thu Jun 21 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.5.25-1

+ 5 - 2
p/php74/php74-vl.spec

@@ -51,8 +51,8 @@
 Name: php%{majorver}
 Name: php%{majorver}
 Summary: The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
 Summary: The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
 Summary(ja): HTML 埋め込み型スクリプト言語 PHP
 Summary(ja): HTML 埋め込み型スクリプト言語 PHP
-Version: 7.4.5
+Version: 7.4.6
-Release: 2%{_dist_release}%{?with_systemd:.systemd}
+Release: 1%{_dist_release}%{?with_systemd:.systemd}
 Conflicts: php5 < 5.6.11
 Conflicts: php5 < 5.6.11
 
 
 Vendor: Project Vine
 Vendor: Project Vine
@@ -1051,6 +1051,9 @@ rm -f files.*
 
 
 #======================================================================
 #======================================================================
 %changelog
 %changelog
+* Thu May 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.4.6-1
+- new upstream release.
+
 * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.4.5-2
 * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.4.5-2
 - rebuilt with icu67.
 - rebuilt with icu67.
 
 

+ 100 - 33
p/postgresql/postgresql-vl.spec

@@ -1,10 +1,8 @@
+%bcond_with systemd
+
 %define plperl %{?_without_perl:0}%{!?_without_perl:1}
 %define plperl %{?_without_perl:0}%{!?_without_perl:1}
 %define plpython %{?_without_python:0}%{!?_without_python:1}
 %define plpython %{?_without_python:0}%{!?_without_python:1}
 %define non6xpamdeps 0
 %define non6xpamdeps 0
-#%define rel 0
-%define beta 0
-%{?beta:%define __os_install_post /usr/lib/rpm/brp-compress}
-%define _unpackaged_files_terminate_build 1
 
 
 %define tcl 1
 %define tcl 1
 %define test 0
 %define test 0
@@ -20,8 +18,12 @@
 Summary: PostgreSQL client programs
 Summary: PostgreSQL client programs
 Summary(ja): PostgreSQL のクライアントプログラム群
 Summary(ja): PostgreSQL のクライアントプログラム群
 Name: postgresql
 Name: postgresql
-Version: 12.2
+Version: 12.3
-Release: 1%{?_dist_release}
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
+Group: Applications/Databases
+Vendor: Project Vine
+Distribution: Vine Linux
+
 %global pgver %(echo %{version} | sed -e 's/\\.[0-9]*$//')
 %global pgver %(echo %{version} | sed -e 's/\\.[0-9]*$//')
 # Conventions for PostgreSQL Global Development Group RPM releases:
 # Conventions for PostgreSQL Global Development Group RPM releases:
 #
 #
@@ -44,44 +46,45 @@ Release: 1%{?_dist_release}
 # -- only test releases or full releases should be.
 # -- only test releases or full releases should be.
 
 
 License: BSD
 License: BSD
-Group: Applications/Databases
+Url: https://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
 Source3: postgresql.init
 Source3: postgresql.init
 Source5: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256
 Source5: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256
 Source6: README.rpm-dist
 Source6: README.rpm-dist
 Source15: postgresql-bashprofile
 Source15: postgresql-bashprofile
+Source1000: postgresql.service
+Source1001: postgresql.tmpfiles.d
 Patch2: postgresql-8.3.3-nls.patch
 Patch2: postgresql-8.3.3-nls.patch
 Patch3: postgresql-7.4-ecpg-patch
 Patch3: postgresql-7.4-ecpg-patch
-Buildrequires: perl build-essential
+
-Requires: /sbin/ldconfig initscripts
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: perl build-essential
+BuildRequires: bison, flex, pam-devel
+BuildRequires: libicu-devel
 %if %plpython
 %if %plpython
-Buildrequires: python python-devel
+BuildRequires: python python-devel
 %endif
 %endif
 %if %tcl
 %if %tcl
-Buildrequires: tcl-devel
+BuildRequires: tcl-devel
 %endif
 %endif
-Buildrequires: libedit-devel
+BuildRequires: libedit-devel
-Buildrequires: zlib-devel >= 1.0.4
+BuildRequires: zlib-devel >= 1.0.4
 %if %ssl
 %if %ssl
-Buildrequires: openssl-devel
+BuildRequires: openssl-devel
 %endif
 %endif
 %if %kerberos
 %if %kerberos
-Buildrequires: krb5-devel
+BuildRequires: krb5-devel
 %endif
 %endif
 %if %nls
 %if %nls
-Buildrequires: gettext >= 0.10.35
+BuildRequires: gettext >= 0.10.35
 %endif
 %endif
 
 
 %if %pam
 %if %pam
 %if %non6xpamdeps
 %if %non6xpamdeps
-Buildrequires: pam-devel
+BuildRequires: pam-devel
 %endif
 %endif
 %endif
 %endif
 
 
-BuildRequires: bison, flex, pam-devel
-
-Url: http://www.postgresql.org/ 
-Buildroot: %{_tmppath}/%{name}-%{version}-root
 Obsoletes: postgresql-clients
 Obsoletes: postgresql-clients
 Obsoletes: postgresql-python
 Obsoletes: postgresql-python
 Obsoletes: postgresql7
 Obsoletes: postgresql7
@@ -93,6 +96,17 @@ Conflicts: postgresql-jdbc < %{pgver}
 Obsoletes: postgresql7-plperl
 Obsoletes: postgresql7-plperl
 %endif
 %endif
 
 
+Requires: /sbin/ldconfig initscripts
+Requires(pre): shadow-utils
+%if %{with systemd}
+BuildRequires: systemd-devel
+%{?systemd_requires}
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig, /sbin/service
+Requires(postun): chkconfig, /sbin/service
+%endif
+
 # This is the PostgreSQL Global Development Group Official RPMset spec file,
 # This is the PostgreSQL Global Development Group Official RPMset spec file,
 # or a derivative thereof.
 # or a derivative thereof.
 # Copyright 2001 Lamar Owen <lamar@postgresql.org> <lamar.owen@wgcr.org>
 # Copyright 2001 Lamar Owen <lamar@postgresql.org> <lamar.owen@wgcr.org>
@@ -118,9 +132,6 @@ Obsoletes: postgresql7-plperl
 # rpm --define 'packagename 0' .... to force the package NOT to build.
 # rpm --define 'packagename 0' .... to force the package NOT to build.
 # The base package, the lib package, the devel package, and the server package always get built.
 # The base package, the lib package, the devel package, and the server package always get built.
 
 
-Vendor: Project Vine
-Distribution: Vine Linux
-
 %description
 %description
 PostgreSQL is an advanced Object-Relational database management system
 PostgreSQL is an advanced Object-Relational database management system
 (DBMS) that supports almost all SQL constructs (including
 (DBMS) that supports almost all SQL constructs (including
@@ -210,6 +221,21 @@ PostgreSQL は先進的でオブジェクト指向的なデータベース管理
 テナンスしたりしたい場合は postgresql-server をインストールする必要が
 テナンスしたりしたい場合は postgresql-server をインストールする必要が
 あります。さらに postgresql パッケージもインストールしてください。
 あります。さらに postgresql パッケージもインストールしてください。
 
 
+%package llvmjit
+Summary:        Just-in-time compilation support for PostgreSQL
+Summary(ja):    PostgreSQLのJust-in-timeコンパイルサポート
+Requires:       %{name}-server%{?_isa} = %{version}-%{release}
+Requires:       llvm => 5.0
+Provides:       postgresql-llvmjit >= %{version}-%{release}
+BuildRequires:  llvm-devel
+BuildRequires:  clang-devel
+
+%description 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.
+
 %package docs
 %package docs
 Summary: Extra documentation for PostgreSQL
 Summary: Extra documentation for PostgreSQL
 Summary(ja): PostgreSQL に関するその他の文書
 Summary(ja): PostgreSQL に関するその他の文書
@@ -240,6 +266,9 @@ Summary: PostgreSQL development header files.
 Summary(ja): PostgreSQL のサーバサイド開発用ヘッダファイル
 Summary(ja): PostgreSQL のサーバサイド開発用ヘッダファイル
 Group: Development/Libraries
 Group: Development/Libraries
 Requires: %{name}-static = %{version}
 Requires: %{name}-static = %{version}
+Requires: libicu-devel
+Requires: clang-devel
+Requires: llvm-devel
 Obsoletes: postgresql7-devel
 Obsoletes: postgresql7-devel
 Conflicts: postgresql8-devel
 Conflicts: postgresql8-devel
 Conflicts: libpq-devel >= 9.3.0
 Conflicts: libpq-devel >= 9.3.0
@@ -318,6 +347,9 @@ system, including regression tests and benchmarks.
 %endif
 %endif
 
 
 
 
+%debug_package
+
+
 %prep
 %prep
 %setup -q -n postgresql-%{version}
 %setup -q -n postgresql-%{version}
 
 
@@ -338,10 +370,6 @@ CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100`
 	--prefix=%{_prefix} \
 	--prefix=%{_prefix} \
 	--libdir=%{_libdir} \
 	--libdir=%{_libdir} \
 	--disable-rpath \
 	--disable-rpath \
-%if %beta
-	--enable-debug \
-	--enable-cassert \
-%endif
 %if %plperl
 %if %plperl
 	--with-perl \
 	--with-perl \
 %endif
 %endif
@@ -369,7 +397,13 @@ CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100`
 	--mandir=%{_mandir} \
 	--mandir=%{_mandir} \
 	--with-docdir=%{_docdir} \
 	--with-docdir=%{_docdir} \
 	--includedir=%{_includedir}/pgsql \
 	--includedir=%{_includedir}/pgsql \
-	--datadir=%{_datadir}/pgsql
+	--datadir=%{_datadir}/pgsql \
+	--with-icu \
+	--with-llvm \
+%if %{with systemd}
+	--with-systemd \
+%endif
+	%{nil}
 
 
 make %{?_smp_mflags} all
 make %{?_smp_mflags} all
 make %{?_smp_mflags} -C contrib all
 make %{?_smp_mflags} -C contrib all
@@ -394,12 +428,18 @@ make -C contrib DESTDIR=$RPM_BUILD_ROOT install
 install -m644 src/Makefile.global $RPM_BUILD_ROOT%{_includedir}/pgsql
 install -m644 src/Makefile.global $RPM_BUILD_ROOT%{_includedir}/pgsql
 install -m644 src/Makefile.shlib $RPM_BUILD_ROOT%{_includedir}/pgsql
 install -m644 src/Makefile.shlib $RPM_BUILD_ROOT%{_includedir}/pgsql
 
 
+%if %{with systemd}
+install -Dpm0644 %{SOURCE1000} $RPM_BUILD_ROOT%{_unitdir}/postgresql.service
+# ... and make a tmpfiles script to recreate it at reboot.
+install -Dpm0644 %{SOURCE1001} $RPM_BUILD_ROOT%{_tmpfilesdir}/postgresql.conf
+%else
 # initscript
 # initscript
 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
 sed -e "s/@pgver@/%{pgver}/" \
 sed -e "s/@pgver@/%{pgver}/" \
 	-e "s|@docdir@|%{_docdir}/postgresql-%{version}|" %{SOURCE3} \
 	-e "s|@docdir@|%{_docdir}/postgresql-%{version}|" %{SOURCE3} \
 	> $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
 	> $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
 chmod 755 $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
 chmod 755 $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
+%endif
 
 
 # PGDATA needs removal of group and world permissions due to pg_pwd hole.
 # PGDATA needs removal of group and world permissions due to pg_pwd hole.
 install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/data
 install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/data
@@ -490,6 +530,7 @@ rm -rf ./extension
 mv -f %{buildroot}%{_docdir}/postgresql/extension ./
 mv -f %{buildroot}%{_docdir}/postgresql/extension ./
 rm -f %{buildroot}%{_mandir}/man1/ecpg.*
 rm -f %{buildroot}%{_mandir}/man1/ecpg.*
 
 
+
 %pre server
 %pre server
 groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
 groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
 useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
 useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
@@ -532,16 +573,27 @@ EOF
 fi
 fi
 
 
 %post server
 %post server
-chkconfig --add postgresql
 /sbin/ldconfig
 /sbin/ldconfig
+%if %{with systemd}
+%systemd_post postgresql.service
+%else
+chkconfig --add postgresql
+%endif
 
 
 %preun server
 %preun server
-if [ $1 = 0 ] ; then
+%if %{with systemd}
+%systemd_preun postgresql.service
+%else
+if [ $1 = 0 -o -x /bin/systemctl ] ; then
 	chkconfig --del postgresql
 	chkconfig --del postgresql
 fi
 fi
+%endif
 
 
 %postun server
 %postun server
 /sbin/ldconfig 
 /sbin/ldconfig 
+%if %{with systemd}
+%systemd_postun_with_restart postgresql.service
+%else
 if [ $1 -ge 1 ]; then
 if [ $1 -ge 1 ]; then
   /sbin/service postgresql condrestart >/dev/null 2>&1
   /sbin/service postgresql condrestart >/dev/null 2>&1
 fi
 fi
@@ -551,6 +603,7 @@ if [ $1 = 0 ] ; then
 	    groupdel postgres >/dev/null 2>&1 || : 
 	    groupdel postgres >/dev/null 2>&1 || : 
     fi
     fi
 fi
 fi
+%endif
 
 
 %if %tcl
 %if %tcl
 %post -p /sbin/ldconfig   tcl
 %post -p /sbin/ldconfig   tcl
@@ -603,9 +656,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/vacuumdb.*
 %{_mandir}/man1/vacuumdb.*
 %{_mandir}/man3/*
 %{_mandir}/man3/*
 %{_mandir}/man7/*
 %{_mandir}/man7/*
-
-
 %{_localedir}/*/LC_MESSAGES/pgscripts-%{pgver}.mo
 %{_localedir}/*/LC_MESSAGES/pgscripts-%{pgver}.mo
+%dir %{_libdir}/postgresql/bitcode
 
 
 %files docs
 %files docs
 %defattr(-,root,root)
 %defattr(-,root,root)
@@ -679,7 +731,12 @@ rm -rf $RPM_BUILD_ROOT
 %files server -f server.lst
 %files server -f server.lst
 %defattr(-,root,root)
 %defattr(-,root,root)
 %doc extension
 %doc extension
+%if %{with systemd}
+%{_unitdir}/postgresql.service
+%{_tmpfilesdir}/postgresql.conf
+%else
 %{_sysconfdir}/rc.d/init.d/postgresql
 %{_sysconfdir}/rc.d/init.d/postgresql
+%endif
 %dir %{_sysconfdir}/sysconfig/pgsql
 %dir %{_sysconfdir}/sysconfig/pgsql
 %{_bindir}/initdb
 %{_bindir}/initdb
 %{_bindir}/pg_archivecleanup
 %{_bindir}/pg_archivecleanup
@@ -742,6 +799,12 @@ rm -rf $RPM_BUILD_ROOT
 %attr(700,postgres,postgres) %dir /var/lib/pgsql/backups
 %attr(700,postgres,postgres) %dir /var/lib/pgsql/backups
 %attr(644,postgres,postgres) %config(noreplace) /var/lib/pgsql/.bash_profile
 %attr(644,postgres,postgres) %config(noreplace) /var/lib/pgsql/.bash_profile
 
 
+%files llvmjit
+%defattr(-,root,root)
+%{_libdir}/postgresql/bitcode/*
+%{_libdir}/postgresql/llvmjit.so
+%{_libdir}/postgresql/llvmjit_types.bc
+
 %files devel -f devel.lst
 %files devel -f devel.lst
 %defattr(-,root,root)
 %defattr(-,root,root)
 %{_includedir}/pgsql
 %{_includedir}/pgsql
@@ -789,6 +852,10 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 %endif
 
 
 %changelog
 %changelog
+* Fri May 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.3-1
+- new upstream release.
+- added systemd support (disabled as default).
+
 * Fri Feb 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.2-1
 * Fri Feb 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.2-1
 - new upstream release.
 - new upstream release.