rpms/postgresql/devel postgresql-use-zoneinfo.patch, NONE, 1.1 postgresql.spec, 1.79, 1.80

Tom Lane (tgl) fedora-extras-commits at redhat.com
Wed Aug 22 21:28:03 UTC 2007


Author: tgl

Update of /cvs/pkgs/rpms/postgresql/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4488

Modified Files:
	postgresql.spec 
Added Files:
	postgresql-use-zoneinfo.patch 
Log Message:
Remove postgresql package's local copy of tzdata files, so it won't
need to be turned for routine timezone updates.

postgresql-use-zoneinfo.patch:

--- NEW FILE postgresql-use-zoneinfo.patch ---
PostgreSQL includes its own copy of the zic timezone database, which is great
for ensuring portable results but not so great from a package maintenance
perspective.  Since the data is in the same format as is provided by the
Linux-standard /usr/share/zoneinfo files, we can avoid having to update
postgresql for timezone updates by just symlinking to those files.

It is allegedly desirable for the link in question to be a relative symlink.
I have strong doubts about this, not least because it requires the horrid
install-time kluge seen below --- we can't use a simple relative symlink when
making the temporary installation used for "make check", since that will be at
an indeterminate location compared to /usr/share.  The actual relative link
also depends fundamentally upon knowing where the PG datadir will get
installed, namely /usr/share/pgsql.

And if you thought that was bad, it turns out that RPM has some fundamental
bugs that make it difficult or impossible to replace a directory with a
symlink during RPM upgrade.  Rather than risk getting caught in that quagmire,
we choose to name the symlink something different than its predecessor
subdirectory.  (This part of the hack could perhaps get undone someday, when
there is no longer any danger of someone trying to rpm-upgrade from an
installation that isn't patched this way.)


diff -Naur postgresql-8.2.4.orig/src/timezone/Makefile postgresql-8.2.4/src/timezone/Makefile
--- postgresql-8.2.4.orig/src/timezone/Makefile	2007-03-14 13:38:15.000000000 -0400
+++ postgresql-8.2.4/src/timezone/Makefile	2007-08-22 16:57:41.000000000 -0400
@@ -38,14 +38,18 @@
 	$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
 
 install: all installdirs
-	./zic -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
+	if [ x'$(DESTDIR)' = x`echo '$(DESTDIR)' | sed 's,tmp_check/install,,'` ] ; then \
+		ln -s '../zoneinfo' '$(DESTDIR)$(datadir)/zoneinfo' ; \
+	else \
+		ln -s '/usr/share/zoneinfo' '$(DESTDIR)$(datadir)/zoneinfo' ; \
+	fi
 	$(MAKE) -C tznames $@
 
 installdirs:
 	$(mkinstalldirs) '$(DESTDIR)$(datadir)'
 
 uninstall:
-	rm -rf '$(DESTDIR)$(datadir)/timezone'
+	rm '$(DESTDIR)$(datadir)/zoneinfo'
 	$(MAKE) -C tznames $@
 
 clean distclean maintainer-clean:
diff -Naur postgresql-8.2.4.orig/src/timezone/pgtz.c postgresql-8.2.4/src/timezone/pgtz.c
--- postgresql-8.2.4.orig/src/timezone/pgtz.c	2006-11-21 18:11:55.000000000 -0500
+++ postgresql-8.2.4/src/timezone/pgtz.c	2007-08-22 16:57:04.000000000 -0400
@@ -52,7 +52,7 @@
 		return tzdir;
 
 	get_share_path(my_exec_path, tzdir);
-	strlcpy(tzdir + strlen(tzdir), "/timezone", MAXPGPATH - strlen(tzdir));
+	strlcpy(tzdir + strlen(tzdir), "/zoneinfo", MAXPGPATH - strlen(tzdir));
 
 	done_tzdir = true;
 	return tzdir;


Index: postgresql.spec
===================================================================
RCS file: /cvs/pkgs/rpms/postgresql/devel/postgresql.spec,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- postgresql.spec	12 Aug 2007 21:21:08 -0000	1.79
+++ postgresql.spec	22 Aug 2007 21:27:31 -0000	1.80
@@ -81,7 +81,7 @@
 Summary: PostgreSQL client programs and libraries
 Name: postgresql
 Version: 8.2.4
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: BSD
 Group: Applications/Databases
 Url: http://www.postgresql.org/ 
@@ -105,6 +105,7 @@
 Patch5: pgtcl-no-rpath.patch
 Patch6: postgresql-perl-rpath.patch
 Patch8: postgresql-prefer-ncurses.patch
+Patch9: postgresql-use-zoneinfo.patch
 
 BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex autoconf
 Prereq: /sbin/ldconfig initscripts
@@ -342,6 +343,7 @@
 # patch5 is applied later
 %patch6 -p1
 %patch8 -p1
+%patch9 -p1
 
 #call autoconf 2.53 or greater
 %aconfver
@@ -602,10 +604,6 @@
 if [ $1 -ge 1 ] ; then
 	/sbin/service postgresql condrestart >/dev/null 2>&1 || :
 fi
-if [ $1 = 0 ] ; then
-	userdel postgres >/dev/null 2>&1 || :
-	groupdel postgres >/dev/null 2>&1 || : 
-fi
 
 %if %plperl
 %post -p /sbin/ldconfig   plperl
@@ -745,7 +743,7 @@
 %{_datadir}/pgsql/postgres.shdescription
 %{_datadir}/pgsql/system_views.sql
 %{_datadir}/pgsql/*.sample
-%{_datadir}/pgsql/timezone/
+%{_datadir}/pgsql/zoneinfo
 %{_datadir}/pgsql/timezonesets/
 %{_libdir}/pgsql/plpgsql.so
 %dir %{_datadir}/pgsql
@@ -822,6 +820,13 @@
 %endif
 
 %changelog
+* Wed Aug 22 2007 Tom Lane <tgl at redhat.com> 8.2.4-4
+- Use tzdata package's data files instead of private copy, so that
+  postgresql-server need not be turned for routine timezone updates
+- Don't remove postgres user/group during RPM uninstall, per Fedora
+  packaging guidelines
+- Rebuild to fix Fedora toolchain issues
+
 * Sun Aug 12 2007 Tom Lane <tgl at redhat.com> 8.2.4-3
 - Recent perl changes in rawhide mean we need a more specific BuildRequires
 




More information about the fedora-extras-commits mailing list