]> TLD Linux GIT Repositories - packages/postgresql.git/commitdiff
- patch from Debian, move socket to /var/run/postgresql, fix socket path
authorMarcin Krol <hawk@tld-linux.org>
Wed, 22 Aug 2018 20:19:37 +0000 (20:19 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Wed, 22 Aug 2018 20:19:37 +0000 (20:19 +0000)
  on pg_upgrade

postgresql.spec
socket-dir-fixes.patch [new file with mode: 0644]

index cd61240b75ee10ea07adb0f719faa9cae390e8bd..57c5aad03d11bea2456171d3241c04145b9fdfcc 100644 (file)
@@ -45,6 +45,7 @@ Patch3:               per-version-dirs.patch
 Patch4:                postgresql-disable_horology_test.patch
 Patch5:                postgresql-heimdal.patch
 Patch6:                postgresql-link.patch
+Patch7:                socket-dir-fixes.patch
 URL:           http://www.postgresql.org/
 BuildRequires: autoconf >= 2.69
 BuildRequires: automake
@@ -595,6 +596,7 @@ Różne moduły dołączone do PostgreSQL-a.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 # force rebuild of bison/flex files
 find src -name \*.l -o -name \*.y | xargs touch
@@ -656,7 +658,7 @@ done
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
-       $RPM_BUILD_ROOT/var/{lib/pgsql,log} \
+       $RPM_BUILD_ROOT/var/{lib/pgsql,log,run/postgresql} \
        $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
        $RPM_BUILD_ROOT%{_mandir}
 
@@ -927,6 +929,7 @@ update-alternatives \
 %dir %{_libdir}/postgresql
 %dir %{_datadir}/postgresql
 %attr(700,postgres,postgres) %dir /var/lib/pgsql
+%attr(700,postgres,postgres) %dir /var/run/postgresql
 
 %files dirs
 %defattr(644,root,root,755)
diff --git a/socket-dir-fixes.patch b/socket-dir-fixes.patch
new file mode 100644 (file)
index 0000000..61cd4eb
--- /dev/null
@@ -0,0 +1,27 @@
+diff -urpa postgresql-10.5.orig/src/bin/pg_upgrade/option.c postgresql-10.5/src/bin/pg_upgrade/option.c
+--- postgresql-10.5.orig/src/bin/pg_upgrade/option.c   2018-08-22 19:57:55.237373015 +0000
++++ postgresql-10.5/src/bin/pg_upgrade/option.c        2018-08-22 19:59:10.944372163 +0000
+@@ -460,6 +460,11 @@ get_sock_dir(ClusterInfo *cluster, bool
+                       cluster->sockdir = pg_malloc(MAXPGPATH);
+                       if (!getcwd(cluster->sockdir, MAXPGPATH))
+                               pg_fatal("could not determine current directory\n");
++#ifndef UNIX_PATH_MAX
++#define UNIX_PATH_MAX 108
++#endif
++                      if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
++                              strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
+               }
+               else
+               {
+diff -urpa postgresql-10.5.orig/src/include/pg_config_manual.h postgresql-10.5/src/include/pg_config_manual.h
+--- postgresql-10.5.orig/src/include/pg_config_manual.h        2018-08-22 19:57:55.095373017 +0000
++++ postgresql-10.5/src/include/pg_config_manual.h     2018-08-22 19:58:30.664372616 +0000
+@@ -181,7 +181,7 @@
+  * here's where to twiddle it.  You can also override this at runtime
+  * with the postmaster's -k switch.
+  */
+-#define DEFAULT_PGSOCKET_DIR  "/tmp"
++#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
+ /*
+  * This is the default event source for Windows event log.