Mercurial > hg > portage
changeset 140:ae18a6f7faee
pull latest chagnes from Holgi
author | Dirk Olmes <dirk.olmes@googlemail.com> |
---|---|
date | Thu, 02 Jul 2009 14:12:03 +0200 |
parents | 4a719c618dfb (current diff) 800c31c752cf (diff) |
children | ad98f234d6dd |
files | dev-db/postgresql-base/Manifest dev-db/postgresql-base/files/postgresql-8.3-base.patch dev-db/postgresql-base/files/postgresql-8.3-common.patch dev-db/postgresql-base/files/postgresql-8.x-relax_ssl_perms.patch dev-db/postgresql-base/postgresql-base-8.3.6.ebuild dev-db/postgresql-server/Manifest dev-db/postgresql-server/files/postgresql-8.3-common.patch dev-db/postgresql-server/files/postgresql-8.3-server.patch dev-db/postgresql-server/files/postgresql.conf-8.3 dev-db/postgresql-server/files/postgresql.init-8.3 dev-db/postgresql-server/postgresql-server-8.3.6.ebuild mail-client/alpine/Manifest mail-client/alpine/alpine-2.00.ebuild net-fs/samba/samba-3.3.1.ebuild net-mail/up-imapproxy/Manifest net-mail/up-imapproxy/files/imapproxy.rc6 net-mail/up-imapproxy/up-imapproxy-1.2.6.ebuild net-misc/rabbitmq-server/Manifest net-misc/rabbitmq-server/rabbitmq-server-1.5.3.ebuild net-misc/zmq/zmq-0.4.ebuild |
diffstat | 33 files changed, 602 insertions(+), 3908 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app-arch/pigz/Manifest Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,2 @@ +DIST pigz-2.1.4.tar.gz 35951 RMD160 9c6651d5b75ac9bb67e66420c7b0c3bfbf4b1b15 SHA1 72f639ffb296c6a5dd7b1a45ed2620a5834d55e1 SHA256 2593933f34a8a8634c4dcbbb3ef199e6d38e4b044c3d1ba40ae1d337c49c30e2 +EBUILD pigz-2.1.4.ebuild 514 RMD160 5252ce1952dae74f49c01d5e78b01a3e4b5c14ba SHA1 88a9d881d0e96b49f6409c14df3dfd533de80a99 SHA256 b9db5adfc607d204a3c26d26db05e0dd1fe6d48f9885aefa00a509d3f0559340
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app-arch/pigz/pigz-2.1.4.ebuild Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,30 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils flag-o-matic + +DESCRIPTION="Standard GNU compressor" +HOMEPAGE="http://www.zlib.net/pigz/" +SRC_URI="http://www.zlib.net/pigz/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" + +RDEPEND="" +DEPEND="${RDEPEND} + sys-libs/zlib" + +src_unpack() { + unpack ${A} + cd "${S}" +} + +src_compile() { + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die +} + +src_install() { + dobin pigz || die +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-db/pgpool-II/Manifest Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,3 @@ +AUX pgpool-II.init 397 RMD160 982661c7ed406af8cee485aec125a3c28320d008 SHA1 b0433f446f98acd2ca82930f073c6fd886ce19a7 SHA256 fc1f92d95d198a4fa7a4ae3e0bbad5ba093667c068550bd6a18bc86ab61252fa +DIST pgpool-II-2.2.2.tar.gz 961675 RMD160 adfeb49ae04fc765b221b9232e1285d3f922e8d3 SHA1 877832eb777e0ab49feed24444a55fab3ff583b4 SHA256 2a404dd3965c5d869c17ab0c031395a43445d6fcf0c72df8bd78d9629b8ed25b +EBUILD pgpool-II-2.2.2.ebuild 947 RMD160 d041ff1832e1ebf781e2b381f606f83dea4d1704 SHA1 7bb0f2afe399d250a91aa320880a3c0064f5ef98 SHA256 24b389566b5ba85d2468626eed3f4ff6c57189fa682f034e87819d0c3e6f0de2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-db/pgpool-II/files/pgpool-II.init Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,21 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +start() { + ebegin "Starting pgpool-II" + start-stop-daemon --start --quiet --exec /usr/bin/pgpool + result=$? + eend $result +} + +stop() { + ebegin "Stopping pgpool-II" + start-stop-daemon --stop --quiet --exec /usr/bin/pgpool + result=$? + eend $result +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-db/pgpool-II/pgpool-II-2.2.2.ebuild Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,35 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DESCRIPTION="New generation connection pool server for PostgreSQL" +HOMEPAGE="http://pgpool.projects.postgresql.org/" +SRC_URI="http://pgfoundry.org/frs/download.php/2108/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~sparc ~x86" +IUSE="" + +DEPEND="dev-db/postgresql-base" + +src_unpack() { + unpack ${A} + S="${WORKDIR}/${PN}-2.2" + cd ${S} + sed -i -e "/^logdir/s:/tmp:/var/run:g" pgpool.conf.sample || die +} + +src_compile() { + econf --with-pgsql=/usr/include/postgresql || die + emake || die +} + +src_install () { + einstall || die + mv ${D}/etc/pcp.conf.sample ${D}/etc/pcp.conf + mv ${D}/etc/pgpool.conf.sample ${D}/etc/pgpool.conf + mv ${D}/etc/pool_hba.conf.sample ${D}/etc/pool_hba.conf + dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README* TODO + newinitd "${FILESDIR}/pgpool-II.init" pgpool-II || die "Inserting init.d-file failed" +} +
--- a/dev-db/postgresql-base/Manifest Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -AUX postgresql-8.3-base.patch 4130 RMD160 53cf20e4161ac9a9abd14c1a834f2e4508c5b44a SHA1 f58dbfde59f1543c8bd87527a1dfc3356c06db90 SHA256 a3bb8eca2d472a22d744a23d47d829b9931cd5bae2206e90d7e0fac4399927a5 -AUX postgresql-8.3-common.patch 2641 RMD160 0822bf1512457e91d5f32f9d192de6f197db9c55 SHA1 e4bdbd5eee1023e8f0b42ef408b34b57495d1e2b SHA256 e416c26d9c3d266b306ddbc0a2b648054739b7ace35e2b4e449fbdaf094bc197 -AUX postgresql-8.x-relax_ssl_perms.patch 764 RMD160 d1ce5164779c0b0c9229dc13d2eebe6b8c960616 SHA1 f28af41e549bbe3a0b4b8669a2762f71bf3e8a9e SHA256 98bc99954521db083320bd9a6b3a0a5d6eb960af3699527c16e53c567e22394a -DIST postgresql-8.3.6.tar.bz2 14081040 RMD160 fa30a5e426ffd4800bd918012e0094c56ad1bae1 SHA1 6ef6d564988209e5c85b061c71af58bebac522bd SHA256 fd0239849839227649e2f472a1ffeab87f9eedc75a1d11c803dde65b109d7479 -EBUILD postgresql-base-8.3.6.ebuild 4664 RMD160 e131ef0e13d31fd982a739c8fe9c83f199852b56 SHA1 a5e1e81459439d9d683a58aa453209e35c747e48 SHA256 6978b378a20196ffb4851dac809653c6ad7c026fbbd8bc1847824c1e38d3764a
--- a/dev-db/postgresql-base/files/postgresql-8.3-base.patch Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -=== contrib/Makefile -================================================================== ---- contrib/Makefile (revision 2) -+++ contrib/Makefile (local) -@@ -5,41 +5,10 @@ - include $(top_builddir)/src/Makefile.global - - WANTED_DIRS = \ -- adminpack \ -- btree_gist \ -- chkpass \ -- cube \ -- dblink \ -- dict_int \ -- dict_xsyn \ -- earthdistance \ -- fuzzystrmatch \ -- hstore \ -- intagg \ -- intarray \ -- isn \ -- lo \ -- ltree \ - oid2name \ -- pageinspect \ -- pg_buffercache \ -- pg_freespacemap \ -- pg_standby \ -- pg_trgm \ - pgbench \ -- pgcrypto \ -- pgrowlocks \ -- pgstattuple \ -- seg \ -- spi \ -- tablefunc \ -- test_parser \ -- tsearch2 \ - vacuumlo - --ifeq ($(with_openssl),yes) --WANTED_DIRS += sslinfo --endif - - ifeq ($(with_ossp_uuid),yes) - WANTED_DIRS += uuid-ossp -=== src/Makefile -================================================================== ---- src/Makefile (revision 2) -+++ src/Makefile (local) -@@ -15,16 +15,11 @@ - - all install installdirs uninstall distprep: - $(MAKE) -C port $@ -- $(MAKE) -C timezone $@ - $(MAKE) -C backend $@ -- $(MAKE) -C backend/utils/mb/conversion_procs $@ -- $(MAKE) -C backend/snowball $@ - $(MAKE) -C include $@ - $(MAKE) -C interfaces $@ - $(MAKE) -C bin $@ -- $(MAKE) -C pl $@ - $(MAKE) -C makefiles $@ -- $(MAKE) -C test/regress $@ - - install: install-local - -=== src/backend/Makefile -================================================================== ---- src/backend/Makefile (revision 2) -+++ src/backend/Makefile (local) -@@ -34,7 +34,7 @@ - - ########################################################################## - --all: submake-libpgport postgres $(POSTGRES_IMP) -+all: someheaders - - ifneq ($(PORTNAME), cygwin) - ifneq ($(PORTNAME), win32) -@@ -107,8 +107,7 @@ - - .PHONY: $(DIRS:%=%-recursive) - # Update the commonly used headers before building the subdirectories --$(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h -- $(MAKE) -C $(subst -recursive,,$@) all -+someheaders $(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h - - - # The postgres.o target is needed by the rule in Makefile.global that -@@ -155,23 +154,7 @@ - - ########################################################################## - --install: all installdirs install-bin --ifeq ($(PORTNAME), cygwin) --ifeq ($(MAKE_DLL), true) -- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' --endif --endif --ifeq ($(PORTNAME), win32) --ifeq ($(MAKE_DLL), true) -- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' --endif --endif -- $(MAKE) -C catalog install-data -- $(MAKE) -C tsearch install-data -- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' -- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' -- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' -- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample' -+install: - - install-bin: postgres $(POSTGRES_IMP) installdirs - $(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)' -=== src/bin/Makefile -================================================================== ---- src/bin/Makefile (revision 2) -+++ src/bin/Makefile (local) -@@ -13,8 +13,8 @@ - top_builddir = ../.. - include $(top_builddir)/src/Makefile.global - --DIRS = initdb ipcclean pg_ctl pg_dump \ -- psql scripts pg_config pg_controldata pg_resetxlog -+DIRS = pg_dump \ -+ psql scripts pg_config - ifeq ($(PORTNAME), win32) - DIRS+=pgevent - endif -=== src/include/pg_config_manual.h -================================================================== ---- src/include/pg_config_manual.h (revision 2) -+++ src/include/pg_config_manual.h (local) -@@ -184,7 +184,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" - - /* - * The random() function is expected to yield values between 0 and
--- a/dev-db/postgresql-base/files/postgresql-8.3-common.patch Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -diff --git a/config/programs.m4 b/config/programs.m4 -index 9434113..d72b35c 100644 ---- a/config/programs.m4 -+++ b/config/programs.m4 -@@ -202,8 +202,12 @@ AC_DEFUN([PGAC_CHECK_GETTEXT], - dnl FIXME: We should probably check for version >=0.10.36. - AC_CHECK_PROGS(XGETTEXT, xgettext) - -- # Note: share/locale is always the default, independent of $datadir -- localedir='${prefix}/share/locale' -+ # Note: share/locale *WAS* always the default, independent of $datadir -+ AC_ARG_WITH([locale-dir], -+ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]), -+ [ localedir="${withval}" ], -+ [ localedir='${prefix}/share/locale' ] -+ ) - AC_SUBST(localedir) - ])# PGAC_CHECK_GETTEXT - -diff --git a/configure.in b/configure.in -index 58cc61c..07ffc38 100644 ---- a/configure.in -+++ b/configure.in -@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros - - AC_INIT([PostgreSQL], [8.3RC1], [pgsql-bugs@postgresql.org]) - --m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required. --Untested combinations of 'autoconf' and PostgreSQL versions are not --recommended. You can remove the check from 'configure.in' but it is then --your responsibility whether the result works or not.])]) - AC_COPYRIGHT([Copyright (c) 1996-2008, PostgreSQL Global Development Group]) - AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) - AC_CONFIG_AUX_DIR(config) -diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h -index 7d9448f..07799bc 100644 ---- a/src/include/storage/s_lock.h -+++ b/src/include/storage/s_lock.h -@@ -298,6 +298,29 @@ tas(volatile slock_t *lock) - - #endif /* __s390__ || __s390x__ */ - -+#if defined(__sh__) -+#define HAS_TEST_AND_SET -+ -+typedef unsigned char slock_t; -+ -+#define TAS(lock) tas(lock) -+ -+static __inline__ int -+tas(volatile slock_t *lock) -+{ -+ register int _res = 1; -+ -+ __asm__ __volatile__( -+ "tas.b @%1\n\t" -+ "movt %0\n\t" -+ "xor #1,%0" -+: "=z"(_res) -+: "r"(lock) -+: "t","memory"); -+ return _res; -+} -+ -+#endif /* __sh__ */ - - #if defined(__sparc__) /* Sparc */ - #define HAS_TEST_AND_SET -diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin -index 9f761d4..83b2974 100644 ---- a/src/makefiles/Makefile.darwin -+++ b/src/makefiles/Makefile.darwin -@@ -5,7 +5,15 @@ DLSUFFIX = .so - CFLAGS_SL = - - ifdef PGXS -+ifdef PGXS_IN_SERVER -+ifndef PGXS_WITH_SERVER -+BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres -+else -+BE_DLLLIBS= -bundle_loader ${PGXS_WITH_SERVER} -+endif -+else - BE_DLLLIBS= -bundle_loader $(bindir)/postgres -+endif - else - BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres - endif
--- a/dev-db/postgresql-base/files/postgresql-8.x-relax_ssl_perms.patch Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -ur postgresql-8.0.15.orig/src/backend/libpq/be-secure.c postgresql-8.0.15/src/backend/libpq/be-secure.c ---- postgresql-8.0.15.orig/src/backend/libpq/be-secure.c 2008-02-21 04:06:04.334289203 +0100 -+++ postgresql-8.0.15/src/backend/libpq/be-secure.c 2008-02-21 04:08:47.309426324 +0100 -@@ -737,8 +737,8 @@ - * data directory permission check in postmaster.c) - */ - #if !defined(WIN32) && !defined(__CYGWIN__) -- if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IRWXG | S_IRWXO)) || -- buf.st_uid != geteuid()) -+ if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IWGRP | S_IRWXO)) || -+ (buf.st_uid != geteuid()) && buf.st_uid != 0) - ereport(FATAL, - (errcode(ERRCODE_CONFIG_FILE_ERROR), - errmsg("unsafe permissions on private key file \"%s\"",
--- a/dev-db/postgresql-base/postgresql-base-8.3.6.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-base/postgresql-base-8.3.5.ebuild,v 1.1 2008/12/03 19:21:50 caleb Exp $ - -EAPI="1" - -WANT_AUTOCONF="latest" -WANT_AUTOMAKE="none" - -inherit eutils multilib toolchain-funcs versionator autotools - -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" - -DESCRIPTION="PostgreSQL libraries and clients" -HOMEPAGE="http://www.postgresql.org/" -SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" -LICENSE="POSTGRESQL" -SLOT="$(get_version_component_range 1-2)" -IUSE_LINGUAS=" - linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr - linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl - linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv - linguas_tr linguas_zh_CN linguas_zh_TW" -IUSE="doc kerberos nls pam pg-intdatetime readline ssl threads zlib ldap ${IUSE_LINGUAS}" -RESTRICT="test" - -wanted_languages() { - for u in ${IUSE_LINGUAS} ; do - use $u && echo -n "${u#linguas_} " - done -} - -RDEPEND="kerberos? ( virtual/krb5 ) - pam? ( virtual/pam ) - readline? ( >=sys-libs/readline-4.1 ) - ssl? ( >=dev-libs/openssl-0.9.6-r1 ) - zlib? ( >=sys-libs/zlib-1.1.3 ) - >=app-admin/eselect-postgresql-0.3 - !dev-db/postgresql-libs - !dev-db/postgresql-client - !dev-db/libpq - !dev-db/postgresql - ldap? ( net-nds/openldap )" -DEPEND="${RDEPEND} - sys-devel/flex - >=sys-devel/bison-1.875 - nls? ( sys-devel/gettext )" -PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" - -S="${WORKDIR}/postgresql-${PV}" - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ - "${FILESDIR}/postgresql-${SLOT}-base.patch" \ - "${FILESDIR}/postgresql-8.x-relax_ssl_perms.patch" - - # to avoid collision - it only should be installed by server - rm "${S}/src/backend/nls.mk" - - # because psql/help.c includes the file - ln -s "${S}/src/include/libpq/pqsignal.h" "${S}/src/bin/psql/" - - eautoconf -} - -src_compile() { - econf --prefix=/usr/$(get_libdir)/postgresql-${SLOT} \ - --datadir=/usr/share/postgresql-${SLOT} \ - --sysconfdir=/etc/postgresql-${SLOT} \ - --includedir=/usr/include/postgresql-${SLOT} \ - --with-locale-dir=/usr/share/postgresql-${SLOT}/locale \ - --mandir=/usr/share/postgresql-${SLOT}/man \ - --without-docdir \ - --enable-depend \ - --without-tcl \ - --without-perl \ - --without-python \ - $(use_with readline) \ - $(use_with kerberos krb5) \ - $(use_with kerberos gssapi) \ - "$(use_enable nls nls "$(wanted_languages)")" \ - $(use_with pam) \ - $(use_enable pg-intdatetime integer-datetimes ) \ - $(use_with ssl openssl) \ - $(use_enable threads thread-safety) \ - $(use_enable threads thread-safety-force) \ - $(use_with zlib) \ - $(use_with ldap) \ - ${myconf} \ - || die "configure failed" - - emake LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake failed" - - cd "${S}/contrib" - emake LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake failed" -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - insinto /usr/include/postgresql-${SLOT}/postmaster - doins "${S}"/src/include/postmaster/*.h - dodir /usr/share/postgresql-${SLOT}/man/man1 - tar -zxf "${S}/doc/man.tar.gz" -C "${D}"/usr/share/postgresql-${SLOT}/man man1/{ecpg,pg_config}.1 - - rm "${D}/usr/share/postgresql-${SLOT}/man/man1"/{initdb,ipcclean,pg_controldata,pg_ctl,pg_resetxlog,pg_restore,postgres,postmaster}.1 - dodoc README HISTORY doc/{README.*,TODO,bug.template} - - cd "${S}/contrib" - emake DESTDIR="${D}" install || die "emake install failed" - cd "${S}" - - dodir /etc/eselect/postgresql/slots/${SLOT} - - IDIR="/usr/include/postgresql-${SLOT}" - cat > "${D}/etc/eselect/postgresql/slots/${SLOT}/base" <<-__EOF__ -postgres_ebuilds="\${postgres_ebuilds} ${PF}" -postgres_prefix=/usr/$(get_libdir)/postgresql-${SLOT} -postgres_datadir=/usr/share/postgresql-${SLOT} -postgres_bindir=/usr/$(get_libdir)/postgresql-${SLOT}/bin -postgres_symlinks=( - ${IDIR} /usr/include/postgresql - ${IDIR}/libpq-fe.h /usr/include/libpq-fe.h - ${IDIR}/libpq /usr/include/libpq - ${IDIR}/postgres_ext.h /usr/include/postgres_ext.h -) -__EOF__ - - cat >"${T}/50postgresql-94-${SLOT}" <<-__EOF__ - LDPATH=/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir) - MANPATH=/usr/share/postgresql-${SLOT}/man - __EOF__ - doenvd "${T}/50postgresql-94-${SLOT}" - - keepdir /etc/postgresql-${SLOT} -} - -pkg_postinst() { - eselect postgresql update - [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} - elog "If you need a global psqlrc-file, you can place it in '${ROOT}/etc/postgresql-${SLOT}/'." -} - -pkg_postrm() { - eselect postgresql update -}
--- a/dev-db/postgresql-server/Manifest Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -AUX postgresql-8.3-common.patch 2641 RMD160 0822bf1512457e91d5f32f9d192de6f197db9c55 SHA1 e4bdbd5eee1023e8f0b42ef408b34b57495d1e2b SHA256 e416c26d9c3d266b306ddbc0a2b648054739b7ace35e2b4e449fbdaf094bc197 -AUX postgresql-8.3-server.patch 66296 RMD160 6acd5dec3b411d0439bab47a344406df25c08b7a SHA1 fca417c169d5de6c2ea036ab80a4ce02665ae881 SHA256 74684e07df2ff15f3c10d4f586cd72fba51c996ab9a97b6aee11f79987fc4de6 -AUX postgresql.conf-8.3 1725 RMD160 5bdd027b82013feddcba5d68c09e4122e219ecd2 SHA1 c1bc9ba72623efa12bfad55a0e12a57350955409 SHA256 15cb0f8052d0ecc1bced449777f76875c06ab088f67c1f7f3148b84e97082233 -AUX postgresql.init-8.3 3036 RMD160 9a6e0eab7413b82ccf4bfaf6494b3eaa1abf3c4c SHA1 8896cd60d669bdbc5b76649ee26bb23e2c5c9654 SHA256 0685e2e5ff9b97ff22cdbf590fed0c76cb13b4c087bb961a751fdb4e03fb3dea -DIST postgresql-8.3.6.tar.bz2 14081040 RMD160 fa30a5e426ffd4800bd918012e0094c56ad1bae1 SHA1 6ef6d564988209e5c85b061c71af58bebac522bd SHA256 fd0239849839227649e2f472a1ffeab87f9eedc75a1d11c803dde65b109d7479 -EBUILD postgresql-server-8.3.6.ebuild 9662 RMD160 48e9383552053aca0728635ba977412fedbcfc73 SHA1 8a2076011865de5e03e75f80fc64d61bff70ec92 SHA256 8c6e0a3732d8ce8460155d9862fb8e6720fec95a2e62388ed8011eab9113e2e2
--- a/dev-db/postgresql-server/files/postgresql-8.3-common.patch Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -diff --git a/config/programs.m4 b/config/programs.m4 -index 9434113..d72b35c 100644 ---- a/config/programs.m4 -+++ b/config/programs.m4 -@@ -202,8 +202,12 @@ AC_DEFUN([PGAC_CHECK_GETTEXT], - dnl FIXME: We should probably check for version >=0.10.36. - AC_CHECK_PROGS(XGETTEXT, xgettext) - -- # Note: share/locale is always the default, independent of $datadir -- localedir='${prefix}/share/locale' -+ # Note: share/locale *WAS* always the default, independent of $datadir -+ AC_ARG_WITH([locale-dir], -+ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]), -+ [ localedir="${withval}" ], -+ [ localedir='${prefix}/share/locale' ] -+ ) - AC_SUBST(localedir) - ])# PGAC_CHECK_GETTEXT - -diff --git a/configure.in b/configure.in -index 58cc61c..07ffc38 100644 ---- a/configure.in -+++ b/configure.in -@@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros - - AC_INIT([PostgreSQL], [8.3RC1], [pgsql-bugs@postgresql.org]) - --m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required. --Untested combinations of 'autoconf' and PostgreSQL versions are not --recommended. You can remove the check from 'configure.in' but it is then --your responsibility whether the result works or not.])]) - AC_COPYRIGHT([Copyright (c) 1996-2008, PostgreSQL Global Development Group]) - AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) - AC_CONFIG_AUX_DIR(config) -diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h -index 7d9448f..07799bc 100644 ---- a/src/include/storage/s_lock.h -+++ b/src/include/storage/s_lock.h -@@ -298,6 +298,29 @@ tas(volatile slock_t *lock) - - #endif /* __s390__ || __s390x__ */ - -+#if defined(__sh__) -+#define HAS_TEST_AND_SET -+ -+typedef unsigned char slock_t; -+ -+#define TAS(lock) tas(lock) -+ -+static __inline__ int -+tas(volatile slock_t *lock) -+{ -+ register int _res = 1; -+ -+ __asm__ __volatile__( -+ "tas.b @%1\n\t" -+ "movt %0\n\t" -+ "xor #1,%0" -+: "=z"(_res) -+: "r"(lock) -+: "t","memory"); -+ return _res; -+} -+ -+#endif /* __sh__ */ - - #if defined(__sparc__) /* Sparc */ - #define HAS_TEST_AND_SET -diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin -index 9f761d4..83b2974 100644 ---- a/src/makefiles/Makefile.darwin -+++ b/src/makefiles/Makefile.darwin -@@ -5,7 +5,15 @@ DLSUFFIX = .so - CFLAGS_SL = - - ifdef PGXS -+ifdef PGXS_IN_SERVER -+ifndef PGXS_WITH_SERVER -+BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres -+else -+BE_DLLLIBS= -bundle_loader ${PGXS_WITH_SERVER} -+endif -+else - BE_DLLLIBS= -bundle_loader $(bindir)/postgres -+endif - else - BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres - endif
--- a/dev-db/postgresql-server/files/postgresql-8.3-server.patch Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2449 +0,0 @@ -diff -Naur postgresql-8.3.3.orig/contrib/adminpack/Makefile postgresql-8.3.3/contrib/adminpack/Makefile ---- postgresql-8.3.3.orig/contrib/adminpack/Makefile 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/contrib/adminpack/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -1,7 +1,7 @@ - # $PostgreSQL: pgsql/contrib/adminpack/Makefile,v 1.6 2007/11/10 23:59:50 momjian Exp $ - - MODULE_big = adminpack --PG_CPPFLAGS = -I$(libpq_srcdir) -+PG_CPPFLAGS = -I$(libpq_srcdir) -I../../src/include/ - DATA_built = adminpack.sql - DATA = uninstall_adminpack.sql - OBJS = adminpack.o -diff -Naur postgresql-8.3.3.orig/contrib/Makefile postgresql-8.3.3/contrib/Makefile ---- postgresql-8.3.3.orig/contrib/Makefile 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/contrib/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -20,22 +20,19 @@ - isn \ - lo \ - ltree \ -- oid2name \ - pageinspect \ - pg_buffercache \ - pg_freespacemap \ - pg_standby \ - pg_trgm \ -- pgbench \ - pgcrypto \ - pgrowlocks \ - pgstattuple \ - seg \ - spi \ - tablefunc \ -- test_parser \ - tsearch2 \ -- vacuumlo -+ test_parser - - ifeq ($(with_openssl),yes) - WANTED_DIRS += sslinfo -diff -Naur postgresql-8.3.3.orig/contrib/uuid-ossp/Makefile postgresql-8.3.3/contrib/uuid-ossp/Makefile ---- postgresql-8.3.3.orig/contrib/uuid-ossp/Makefile 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/contrib/uuid-ossp/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -1,11 +1,13 @@ - # $PostgreSQL: pgsql/contrib/uuid-ossp/Makefile,v 1.4 2007/11/13 00:13:19 tgl Exp $ - -+PG_CPPFLAGS += "-DHAVE_OSSP_UUID_H" -+ - MODULE_big = uuid-ossp - OBJS = uuid-ossp.o - DATA_built = uuid-ossp.sql - DATA = uninstall_uuid-ossp.sql - --SHLIB_LINK += $(OSSP_UUID_LIBS) -+SHLIB_LINK += -lossp-uuid - - ifdef USE_PGXS - PG_CONFIG = pg_config -diff -Naur postgresql-8.3.3.orig/contrib/xml2/Makefile postgresql-8.3.3/contrib/xml2/Makefile ---- postgresql-8.3.3.orig/contrib/xml2/Makefile 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/contrib/xml2/Makefile 2008-06-14 13:21:32.000000000 +0200 -@@ -4,7 +4,8 @@ - - OBJS = $(if $(filter -lxslt, $(LIBS)), xpath.o xslt_proc.o, xpath.o) - --SHLIB_LINK += $(filter -lxslt, $(LIBS)) $(filter -lxml2, $(LIBS)) -+PG_CPPFLAGS = $(shell xml2-config --cflags) -+SHLIB_LINK += $(shell xml2-config --libs) $(shell xslt-config --libs) - - DATA_built = pgxml.sql - DATA = uninstall_pgxml.sql -diff -Naur postgresql-8.3.3.orig/GNUmakefile.in postgresql-8.3.3/GNUmakefile.in ---- postgresql-8.3.3.orig/GNUmakefile.in 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/GNUmakefile.in 2008-06-14 12:57:12.000000000 +0200 -@@ -11,19 +11,16 @@ - all: - $(MAKE) -C doc all - $(MAKE) -C src all -- $(MAKE) -C config all - @echo "All of PostgreSQL successfully made. Ready to install." - - install: - $(MAKE) -C doc $@ - $(MAKE) -C src $@ -- $(MAKE) -C config $@ - @echo "PostgreSQL installation complete." - - installdirs uninstall: - $(MAKE) -C doc $@ - $(MAKE) -C src $@ -- $(MAKE) -C config $@ - - distprep: - $(MAKE) -C doc $@ -diff -Naur postgresql-8.3.3.orig/src/bin/initdb/Makefile postgresql-8.3.3/src/bin/initdb/Makefile ---- postgresql-8.3.3.orig/src/bin/initdb/Makefile 2008-06-14 12:56:40.000000000 +0200 -+++ postgresql-8.3.3/src/bin/initdb/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -14,7 +14,7 @@ - top_builddir = ../../.. - include $(top_builddir)/src/Makefile.global - --override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) -+override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/libpq $(CPPFLAGS) - - OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES) - -diff -Naur postgresql-8.3.3.orig/src/bin/Makefile postgresql-8.3.3/src/bin/Makefile ---- postgresql-8.3.3.orig/src/bin/Makefile 2008-06-14 12:56:40.000000000 +0200 -+++ postgresql-8.3.3/src/bin/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -13,8 +13,8 @@ - top_builddir = ../.. - include $(top_builddir)/src/Makefile.global - --DIRS = initdb ipcclean pg_ctl pg_dump \ -- psql scripts pg_config pg_controldata pg_resetxlog -+DIRS = initdb ipcclean pg_ctl \ -+ pg_controldata pg_resetxlog - ifeq ($(PORTNAME), win32) - DIRS+=pgevent - endif -diff -Naur postgresql-8.3.3.orig/src/include/pg_config_manual.h postgresql-8.3.3/src/include/pg_config_manual.h ---- postgresql-8.3.3.orig/src/include/pg_config_manual.h 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/src/include/pg_config_manual.h 2008-06-14 12:57:12.000000000 +0200 -@@ -184,7 +184,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" - - /* - * The random() function is expected to yield values between 0 and -diff -Naur postgresql-8.3.3.orig/src/Makefile postgresql-8.3.3/src/Makefile ---- postgresql-8.3.3.orig/src/Makefile 2008-06-14 12:56:40.000000000 +0200 -+++ postgresql-8.3.3/src/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -19,14 +19,11 @@ - $(MAKE) -C backend $@ - $(MAKE) -C backend/utils/mb/conversion_procs $@ - $(MAKE) -C backend/snowball $@ -- $(MAKE) -C include $@ -- $(MAKE) -C interfaces $@ - $(MAKE) -C bin $@ - $(MAKE) -C pl $@ -- $(MAKE) -C makefiles $@ - $(MAKE) -C test/regress $@ - --install: install-local -+install: - - install-local: installdirs-local - $(INSTALL_DATA) Makefile.global '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global' -diff -Naur postgresql-8.3.3.orig/src/Makefile.global.in postgresql-8.3.3/src/Makefile.global.in ---- postgresql-8.3.3.orig/src/Makefile.global.in 2008-06-14 12:56:41.000000000 +0200 -+++ postgresql-8.3.3/src/Makefile.global.in 2008-06-14 12:57:12.000000000 +0200 -@@ -373,10 +373,8 @@ - - - submake-libpq: -- $(MAKE) -C $(libpq_builddir) all - - submake-libpgport: -- $(MAKE) -C $(top_builddir)/src/port all - - .PHONY: submake-libpq submake-libpgport - -@@ -419,6 +417,8 @@ - LDFLAGS += $(PROFILE) - endif - -+CFLAGS += -I${top_srcdir}/src/include -+ - - ########################################################################## - # -diff -Naur postgresql-8.3.3.orig/src/port/Makefile postgresql-8.3.3/src/port/Makefile ---- postgresql-8.3.3.orig/src/port/Makefile 2008-06-14 12:56:40.000000000 +0200 -+++ postgresql-8.3.3/src/port/Makefile 2008-06-14 12:57:12.000000000 +0200 -@@ -35,11 +35,10 @@ - # foo_srv.o and foo.o are both built from foo.c, but only foo.o has -DFRONTEND - OBJS_SRV = $(OBJS:%.o=%_srv.o) - --all: libpgport.a libpgport_srv.a -+all: libpgport_srv.a - - # libpgport is needed by some contrib --install: all installdirs -- $(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a' -+install: - - installdirs: - $(mkinstalldirs) '$(DESTDIR)$(libdir)' -diff -Naur postgresql-8.3.3.orig/src/test/regress/GNUmakefile postgresql-8.3.3/src/test/regress/GNUmakefile ---- postgresql-8.3.3.orig/src/test/regress/GNUmakefile 2008-06-14 12:56:40.000000000 +0200 -+++ postgresql-8.3.3/src/test/regress/GNUmakefile 2008-06-14 12:57:12.000000000 +0200 -@@ -141,7 +141,7 @@ - ## - - check: all -- ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) $(TEMP_CONF) -+ ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) $(TEMP_CONF) --psqldir=/usr/lib/postgresql-${SLOT}/bin/ - - installcheck: all - ./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) -diff -Naur postgresql-8.3.3.orig/src/test/regress/pg_regress.c postgresql-8.3.3/src/test/regress/pg_regress.c ---- postgresql-8.3.3.orig/src/test/regress/pg_regress.c 2008-06-14 12:56:40.000000000 +0200 -+++ postgresql-8.3.3/src/test/regress/pg_regress.c 2008-06-14 12:57:12.000000000 +0200 -@@ -781,9 +781,6 @@ - sprintf(tmp, "%s/install/%s", temp_install, datadir); - datadir = tmp; - -- /* psql will be installed into temp-install bindir */ -- psqldir = bindir; -- - /* - * Set up shared library paths to include the temp install. - * -@@ -2069,7 +2066,7 @@ - */ - snprintf(buf, sizeof(buf), - SYSTEMQUOTE "\"%s/psql\" -X postgres <%s 2>%s" SYSTEMQUOTE, -- bindir, DEVNULL, DEVNULL); -+ psqldir, DEVNULL, DEVNULL); - for (i = 0; i < 60; i++) - { - /* Done if psql succeeds */ -diff -Naur postgresql-8.3.3.orig/src/test/regress/pg_regress.c.orig postgresql-8.3.3/src/test/regress/pg_regress.c.orig ---- postgresql-8.3.3.orig/src/test/regress/pg_regress.c.orig 1970-01-01 01:00:00.000000000 +0100 -+++ postgresql-8.3.3/src/test/regress/pg_regress.c.orig 2008-03-31 03:32:01.000000000 +0200 -@@ -0,0 +1,2221 @@ -+/*------------------------------------------------------------------------- -+ * -+ * pg_regress --- regression test driver -+ * -+ * This is a C implementation of the previous shell script for running -+ * the regression tests, and should be mostly compatible with it. -+ * Initial author of C translation: Magnus Hagander -+ * -+ * This code is released under the terms of the PostgreSQL License. -+ * -+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group -+ * Portions Copyright (c) 1994, Regents of the University of California -+ * -+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.41.2.2 2008/03/31 01:32:01 tgl Exp $ -+ * -+ *------------------------------------------------------------------------- -+ */ -+ -+#include "pg_regress.h" -+ -+#include <ctype.h> -+#include <sys/stat.h> -+#include <sys/wait.h> -+#include <signal.h> -+#include <unistd.h> -+ -+#ifdef HAVE_SYS_RESOURCE_H -+#include <sys/time.h> -+#include <sys/resource.h> -+#endif -+ -+#include "getopt_long.h" -+#include "pg_config_paths.h" -+ -+/* for resultmap we need a list of pairs of strings */ -+typedef struct _resultmap -+{ -+ char *test; -+ char *type; -+ char *resultfile; -+ struct _resultmap *next; -+} _resultmap; -+ -+/* -+ * Values obtained from pg_config_paths.h and Makefile. The PG installation -+ * paths are only used in temp_install mode: we use these strings to find -+ * out where "make install" will put stuff under the temp_install directory. -+ * In non-temp_install mode, the only thing we need is the location of psql, -+ * which we expect to find in psqldir, or in the PATH if psqldir isn't given. -+ */ -+char *bindir = PGBINDIR; -+char *libdir = LIBDIR; -+char *datadir = PGSHAREDIR; -+char *host_platform = HOST_TUPLE; -+ -+#ifndef WIN32_ONLY_COMPILER -+static char *makeprog = MAKEPROG; -+#endif -+ -+#ifndef WIN32 /* not used in WIN32 case */ -+static char *shellprog = SHELLPROG; -+#endif -+ -+/* currently we can use the same diff switches on all platforms */ -+const char *basic_diff_opts = "-w"; -+const char *pretty_diff_opts = "-w -C3"; -+ -+/* options settable from command line */ -+_stringlist *dblist = NULL; -+bool debug = false; -+char *inputdir = "."; -+char *outputdir = "."; -+char *psqldir = NULL; -+static _stringlist *loadlanguage = NULL; -+static int max_connections = 0; -+static char *encoding = NULL; -+static _stringlist *schedulelist = NULL; -+static _stringlist *extra_tests = NULL; -+static char *temp_install = NULL; -+static char *temp_config = NULL; -+static char *top_builddir = NULL; -+static int temp_port = 65432; -+static bool nolocale = false; -+static char *hostname = NULL; -+static int port = -1; -+static char *user = NULL; -+static char *srcdir = NULL; -+static _stringlist *extraroles = NULL; -+ -+/* internal variables */ -+static const char *progname; -+static char *logfilename; -+static FILE *logfile; -+static char *difffilename; -+ -+static _resultmap *resultmap = NULL; -+ -+static PID_TYPE postmaster_pid = INVALID_PID; -+static bool postmaster_running = false; -+ -+static int success_count = 0; -+static int fail_count = 0; -+static int fail_ignore_count = 0; -+ -+static bool directory_exists(const char *dir); -+static void make_directory(const char *dir); -+ -+static void -+header(const char *fmt,...) -+/* This extension allows gcc to check the format string for consistency with -+ the supplied arguments. */ -+__attribute__((format(printf, 1, 2))); -+static void -+status(const char *fmt,...) -+/* This extension allows gcc to check the format string for consistency with -+ the supplied arguments. */ -+__attribute__((format(printf, 1, 2))); -+static void -+psql_command(const char *database, const char *query,...) -+/* This extension allows gcc to check the format string for consistency with -+ the supplied arguments. */ -+__attribute__((format(printf, 2, 3))); -+ -+#ifdef WIN32 -+typedef BOOL(WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE); -+ -+/* Windows API define missing from MingW headers */ -+#define DISABLE_MAX_PRIVILEGE 0x1 -+#endif -+ -+/* -+ * allow core files if possible. -+ */ -+#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_CORE) -+static void -+unlimit_core_size(void) -+{ -+ struct rlimit lim; -+ -+ getrlimit(RLIMIT_CORE, &lim); -+ if (lim.rlim_max == 0) -+ { -+ fprintf(stderr, -+ _("%s: cannot set core size,: disallowed by hard limit.\n"), -+ progname); -+ return; -+ } -+ else if (lim.rlim_max == RLIM_INFINITY || lim.rlim_cur < lim.rlim_max) -+ { -+ lim.rlim_cur = lim.rlim_max; -+ setrlimit(RLIMIT_CORE, &lim); -+ } -+} -+#endif -+ -+ -+/* -+ * Add an item at the end of a stringlist. -+ */ -+void -+add_stringlist_item(_stringlist ** listhead, const char *str) -+{ -+ _stringlist *newentry = malloc(sizeof(_stringlist)); -+ _stringlist *oldentry; -+ -+ newentry->str = strdup(str); -+ newentry->next = NULL; -+ if (*listhead == NULL) -+ *listhead = newentry; -+ else -+ { -+ for (oldentry = *listhead; oldentry->next; oldentry = oldentry->next) -+ /* skip */ ; -+ oldentry->next = newentry; -+ } -+} -+ -+/* -+ * Free a stringlist. -+ */ -+static void -+free_stringlist(_stringlist ** listhead) -+{ -+ if (listhead == NULL || *listhead == NULL) -+ return; -+ if ((*listhead)->next != NULL) -+ free_stringlist(&((*listhead)->next)); -+ free((*listhead)->str); -+ free(*listhead); -+ *listhead = NULL; -+} -+ -+/* -+ * Split a delimited string into a stringlist -+ */ -+static void -+split_to_stringlist(const char *s, const char *delim, _stringlist ** listhead) -+{ -+ char *sc = strdup(s); -+ char *token = strtok(sc, delim); -+ -+ while (token) -+ { -+ add_stringlist_item(listhead, token); -+ token = strtok(NULL, delim); -+ } -+ free(sc); -+} -+ -+/* -+ * Print a progress banner on stdout. -+ */ -+static void -+header(const char *fmt,...) -+{ -+ char tmp[64]; -+ va_list ap; -+ -+ va_start(ap, fmt); -+ vsnprintf(tmp, sizeof(tmp), fmt, ap); -+ va_end(ap); -+ -+ fprintf(stdout, "============== %-38s ==============\n", tmp); -+ fflush(stdout); -+} -+ -+/* -+ * Print "doing something ..." --- supplied text should not end with newline -+ */ -+static void -+status(const char *fmt,...) -+{ -+ va_list ap; -+ -+ va_start(ap, fmt); -+ vfprintf(stdout, fmt, ap); -+ fflush(stdout); -+ va_end(ap); -+ -+ if (logfile) -+ { -+ va_start(ap, fmt); -+ vfprintf(logfile, fmt, ap); -+ va_end(ap); -+ } -+} -+ -+/* -+ * Done "doing something ..." -+ */ -+static void -+status_end(void) -+{ -+ fprintf(stdout, "\n"); -+ fflush(stdout); -+ if (logfile) -+ fprintf(logfile, "\n"); -+} -+ -+/* -+ * shut down temp postmaster -+ */ -+static void -+stop_postmaster(void) -+{ -+ if (postmaster_running) -+ { -+ /* We use pg_ctl to issue the kill and wait for stop */ -+ char buf[MAXPGPATH * 2]; -+ -+ /* On Windows, system() seems not to force fflush, so... */ -+ fflush(stdout); -+ fflush(stderr); -+ -+ snprintf(buf, sizeof(buf), -+ SYSTEMQUOTE "\"%s/pg_ctl\" stop -D \"%s/data\" -s -m fast" SYSTEMQUOTE, -+ bindir, temp_install); -+ system(buf); /* ignore exit status */ -+ postmaster_running = false; -+ } -+} -+ -+/* -+ * Always exit through here, not through plain exit(), to ensure we make -+ * an effort to shut down a temp postmaster -+ */ -+void -+exit_nicely(int code) -+{ -+ stop_postmaster(); -+ exit(code); -+} -+ -+/* -+ * Check whether string matches pattern -+ * -+ * In the original shell script, this function was implemented using expr(1), -+ * which provides basic regular expressions restricted to match starting at -+ * the string start (in conventional regex terms, there's an implicit "^" -+ * at the start of the pattern --- but no implicit "$" at the end). -+ * -+ * For now, we only support "." and ".*" as non-literal metacharacters, -+ * because that's all that anyone has found use for in resultmap. This -+ * code could be extended if more functionality is needed. -+ */ -+static bool -+string_matches_pattern(const char *str, const char *pattern) -+{ -+ while (*str && *pattern) -+ { -+ if (*pattern == '.' && pattern[1] == '*') -+ { -+ pattern += 2; -+ /* Trailing .* matches everything. */ -+ if (*pattern == '\0') -+ return true; -+ -+ /* -+ * Otherwise, scan for a text position at which we can match the -+ * rest of the pattern. -+ */ -+ while (*str) -+ { -+ /* -+ * Optimization to prevent most recursion: don't recurse -+ * unless first pattern char might match this text char. -+ */ -+ if (*str == *pattern || *pattern == '.') -+ { -+ if (string_matches_pattern(str, pattern)) -+ return true; -+ } -+ -+ str++; -+ } -+ -+ /* -+ * End of text with no match. -+ */ -+ return false; -+ } -+ else if (*pattern != '.' && *str != *pattern) -+ { -+ /* -+ * Not the single-character wildcard and no explicit match? Then -+ * time to quit... -+ */ -+ return false; -+ } -+ -+ str++; -+ pattern++; -+ } -+ -+ if (*pattern == '\0') -+ return true; /* end of pattern, so declare match */ -+ -+ /* End of input string. Do we have matching pattern remaining? */ -+ while (*pattern == '.' && pattern[1] == '*') -+ pattern += 2; -+ if (*pattern == '\0') -+ return true; /* end of pattern, so declare match */ -+ -+ return false; -+} -+ -+/* -+ * Replace all occurances of a string in a string with a different string. -+ * NOTE: Assumes there is enough room in the target buffer! -+ */ -+void -+replace_string(char *string, char *replace, char *replacement) -+{ -+ char *ptr; -+ -+ while ((ptr = strstr(string, replace)) != NULL) -+ { -+ char *dup = strdup(string); -+ -+ strlcpy(string, dup, ptr - string + 1); -+ strcat(string, replacement); -+ strcat(string, dup + (ptr - string) + strlen(replace)); -+ free(dup); -+ } -+} -+ -+/* -+ * Convert *.source found in the "source" directory, replacing certain tokens -+ * in the file contents with their intended values, and put the resulting files -+ * in the "dest" directory, replacing the ".source" prefix in their names with -+ * the given suffix. -+ */ -+static void -+convert_sourcefiles_in(char *source, char *dest, char *suffix) -+{ -+ char abs_srcdir[MAXPGPATH]; -+ char abs_builddir[MAXPGPATH]; -+ char testtablespace[MAXPGPATH]; -+ char indir[MAXPGPATH]; -+ struct stat st; -+ int ret; -+ char **name; -+ char **names; -+ int count = 0; -+ -+#ifdef WIN32 -+ char *c; -+#endif -+ -+ if (!getcwd(abs_builddir, sizeof(abs_builddir))) -+ { -+ fprintf(stderr, _("%s: could not get current directory: %s\n"), -+ progname, strerror(errno)); -+ exit_nicely(2); -+ } -+ -+ /* -+ * in a VPATH build, use the provided source directory; otherwise, use the -+ * current directory. -+ */ -+ if (srcdir) -+ strlcpy(abs_srcdir, srcdir, MAXPGPATH); -+ else -+ strlcpy(abs_srcdir, abs_builddir, MAXPGPATH); -+ -+ snprintf(indir, MAXPGPATH, "%s/%s", abs_srcdir, source); -+ -+ /* Check that indir actually exists and is a directory */ -+ ret = stat(indir, &st); -+ if (ret != 0 || !S_ISDIR(st.st_mode)) -+ { -+ /* -+ * No warning, to avoid noise in tests that do not have -+ * these directories; for example, ecpg, contrib and src/pl. -+ */ -+ return; -+ } -+ -+ names = pgfnames(indir); -+ if (!names) -+ /* Error logged in pgfnames */ -+ exit_nicely(2); -+ -+#ifdef WIN32 -+ /* in Win32, replace backslashes with forward slashes */ -+ for (c = abs_builddir; *c; c++) -+ if (*c == '\\') -+ *c = '/'; -+ for (c = abs_srcdir; *c; c++) -+ if (*c == '\\') -+ *c = '/'; -+#endif -+ -+ snprintf(testtablespace, MAXPGPATH, "%s/testtablespace", abs_builddir); -+ -+#ifdef WIN32 -+ /* -+ * On Windows only, clean out the test tablespace dir, or create it if it -+ * doesn't exist. On other platforms we expect the Makefile to take -+ * care of that. (We don't migrate that functionality in here because -+ * it'd be harder to cope with platform-specific issues such as SELinux.) -+ * -+ * XXX it would be better if pg_regress.c had nothing at all to do with -+ * testtablespace, and this were handled by a .BAT file or similar on -+ * Windows. See pgsql-hackers discussion of 2008-01-18. -+ */ -+ if (directory_exists(testtablespace)) -+ rmtree(testtablespace, true); -+ make_directory(testtablespace); -+#endif -+ -+ /* finally loop on each file and do the replacement */ -+ for (name = names; *name; name++) -+ { -+ char srcfile[MAXPGPATH]; -+ char destfile[MAXPGPATH]; -+ char prefix[MAXPGPATH]; -+ FILE *infile, -+ *outfile; -+ char line[1024]; -+ -+ /* reject filenames not finishing in ".source" */ -+ if (strlen(*name) < 8) -+ continue; -+ if (strcmp(*name + strlen(*name) - 7, ".source") != 0) -+ continue; -+ -+ count++; -+ -+ /* build the full actual paths to open */ -+ snprintf(prefix, strlen(*name) - 6, "%s", *name); -+ snprintf(srcfile, MAXPGPATH, "%s/%s", indir, *name); -+ snprintf(destfile, MAXPGPATH, "%s/%s.%s", dest, prefix, suffix); -+ -+ infile = fopen(srcfile, "r"); -+ if (!infile) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"), -+ progname, srcfile, strerror(errno)); -+ exit_nicely(2); -+ } -+ outfile = fopen(destfile, "w"); -+ if (!outfile) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for writing: %s\n"), -+ progname, destfile, strerror(errno)); -+ exit_nicely(2); -+ } -+ while (fgets(line, sizeof(line), infile)) -+ { -+ replace_string(line, "@abs_srcdir@", abs_srcdir); -+ replace_string(line, "@abs_builddir@", abs_builddir); -+ replace_string(line, "@testtablespace@", testtablespace); -+ replace_string(line, "@DLSUFFIX@", DLSUFFIX); -+ fputs(line, outfile); -+ } -+ fclose(infile); -+ fclose(outfile); -+ } -+ -+ /* -+ * If we didn't process any files, complain because it probably means -+ * somebody neglected to pass the needed --srcdir argument. -+ */ -+ if (count <= 0) -+ { -+ fprintf(stderr, _("%s: no *.source files found in %s\n"), -+ progname, indir); -+ exit_nicely(2); -+ } -+ -+ pgfnames_cleanup(names); -+} -+ -+/* Create the .sql and .out files from the .source files, if any */ -+static void -+convert_sourcefiles(void) -+{ -+ convert_sourcefiles_in("input", "sql", "sql"); -+ convert_sourcefiles_in("output", "expected", "out"); -+} -+ -+/* -+ * Scan resultmap file to find which platform-specific expected files to use. -+ * -+ * The format of each line of the file is -+ * testname/hostplatformpattern=substitutefile -+ * where the hostplatformpattern is evaluated per the rules of expr(1), -+ * namely, it is a standard regular expression with an implicit ^ at the start. -+ * (We currently support only a very limited subset of regular expressions, -+ * see string_matches_pattern() above.) What hostplatformpattern will be -+ * matched against is the config.guess output. (In the shell-script version, -+ * we also provided an indication of whether gcc or another compiler was in -+ * use, but that facility isn't used anymore.) -+ */ -+static void -+load_resultmap(void) -+{ -+ char buf[MAXPGPATH]; -+ FILE *f; -+ -+ /* scan the file ... */ -+ snprintf(buf, sizeof(buf), "%s/resultmap", inputdir); -+ f = fopen(buf, "r"); -+ if (!f) -+ { -+ /* OK if it doesn't exist, else complain */ -+ if (errno == ENOENT) -+ return; -+ fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"), -+ progname, buf, strerror(errno)); -+ exit_nicely(2); -+ } -+ -+ while (fgets(buf, sizeof(buf), f)) -+ { -+ char *platform; -+ char *file_type; -+ char *expected; -+ int i; -+ -+ /* strip trailing whitespace, especially the newline */ -+ i = strlen(buf); -+ while (i > 0 && isspace((unsigned char) buf[i - 1])) -+ buf[--i] = '\0'; -+ -+ /* parse out the line fields */ -+ file_type = strchr(buf, ':'); -+ if (!file_type) -+ { -+ fprintf(stderr, _("incorrectly formatted resultmap entry: %s\n"), -+ buf); -+ exit_nicely(2); -+ } -+ *file_type++ = '\0'; -+ -+ platform = strchr(file_type, ':'); -+ if (!platform) -+ { -+ fprintf(stderr, _("incorrectly formatted resultmap entry: %s\n"), -+ buf); -+ exit_nicely(2); -+ } -+ *platform++ = '\0'; -+ expected = strchr(platform, '='); -+ if (!expected) -+ { -+ fprintf(stderr, _("incorrectly formatted resultmap entry: %s\n"), -+ buf); -+ exit_nicely(2); -+ } -+ *expected++ = '\0'; -+ -+ /* -+ * if it's for current platform, save it in resultmap list. Note: by -+ * adding at the front of the list, we ensure that in ambiguous cases, -+ * the last match in the resultmap file is used. This mimics the -+ * behavior of the old shell script. -+ */ -+ if (string_matches_pattern(host_platform, platform)) -+ { -+ _resultmap *entry = malloc(sizeof(_resultmap)); -+ -+ entry->test = strdup(buf); -+ entry->type = strdup(file_type); -+ entry->resultfile = strdup(expected); -+ entry->next = resultmap; -+ resultmap = entry; -+ } -+ } -+ fclose(f); -+} -+ -+/* -+ * Check in resultmap if we should be looking at a different file -+ */ -+static -+const char * -+get_expectfile(const char *testname, const char *file) -+{ -+ char *file_type; -+ _resultmap *rm; -+ -+ /* -+ * Determine the file type from the file name. This is just what is -+ * following the last dot in the file name. -+ */ -+ if (!file || !(file_type = strrchr(file, '.'))) -+ return NULL; -+ -+ file_type++; -+ -+ for (rm = resultmap; rm != NULL; rm = rm->next) -+ { -+ if (strcmp(testname, rm->test) == 0 && strcmp(file_type, rm->type) == 0) -+ { -+ return rm->resultfile; -+ } -+ } -+ -+ return NULL; -+} -+ -+/* -+ * Handy subroutine for setting an environment variable "var" to "val" -+ */ -+static void -+doputenv(const char *var, const char *val) -+{ -+ char *s = malloc(strlen(var) + strlen(val) + 2); -+ -+ sprintf(s, "%s=%s", var, val); -+ putenv(s); -+} -+ -+/* -+ * Set the environment variable "pathname", prepending "addval" to its -+ * old value (if any). -+ */ -+static void -+add_to_path(const char *pathname, char separator, const char *addval) -+{ -+ char *oldval = getenv(pathname); -+ char *newval; -+ -+ if (!oldval || !oldval[0]) -+ { -+ /* no previous value */ -+ newval = malloc(strlen(pathname) + strlen(addval) + 2); -+ sprintf(newval, "%s=%s", pathname, addval); -+ } -+ else -+ { -+ newval = malloc(strlen(pathname) + strlen(addval) + strlen(oldval) + 3); -+ sprintf(newval, "%s=%s%c%s", pathname, addval, separator, oldval); -+ } -+ putenv(newval); -+} -+ -+/* -+ * Prepare environment variables for running regression tests -+ */ -+static void -+initialize_environment(void) -+{ -+ char *tmp; -+ -+ /* -+ * Clear out any non-C locale settings -+ */ -+ unsetenv("LC_COLLATE"); -+ unsetenv("LC_CTYPE"); -+ unsetenv("LC_MONETARY"); -+ unsetenv("LC_MESSAGES"); -+ unsetenv("LC_NUMERIC"); -+ unsetenv("LC_TIME"); -+ unsetenv("LC_ALL"); -+ unsetenv("LANG"); -+ unsetenv("LANGUAGE"); -+ /* On Windows the default locale cannot be English, so force it */ -+#if defined(WIN32) || defined(__CYGWIN__) -+ putenv("LANG=en"); -+#endif -+ -+ /* -+ * Set multibyte as requested -+ */ -+ if (encoding) -+ doputenv("PGCLIENTENCODING", encoding); -+ else -+ unsetenv("PGCLIENTENCODING"); -+ -+ /* -+ * Set timezone and datestyle for datetime-related tests -+ */ -+ putenv("PGTZ=PST8PDT"); -+ putenv("PGDATESTYLE=Postgres, MDY"); -+ -+ if (temp_install) -+ { -+ /* -+ * Clear out any environment vars that might cause psql to connect to -+ * the wrong postmaster, or otherwise behave in nondefault ways. (Note -+ * we also use psql's -X switch consistently, so that ~/.psqlrc files -+ * won't mess things up.) Also, set PGPORT to the temp port, and set -+ * or unset PGHOST depending on whether we are using TCP or Unix -+ * sockets. -+ */ -+ unsetenv("PGDATABASE"); -+ unsetenv("PGUSER"); -+ unsetenv("PGSERVICE"); -+ unsetenv("PGSSLMODE"); -+ unsetenv("PGREQUIRESSL"); -+ unsetenv("PGCONNECT_TIMEOUT"); -+ unsetenv("PGDATA"); -+ if (hostname != NULL) -+ doputenv("PGHOST", hostname); -+ else -+ unsetenv("PGHOST"); -+ unsetenv("PGHOSTADDR"); -+ if (port != -1) -+ { -+ char s[16]; -+ -+ sprintf(s, "%d", port); -+ doputenv("PGPORT", s); -+ } -+ -+ /* -+ * Adjust path variables to point into the temp-install tree -+ */ -+ tmp = malloc(strlen(temp_install) + 32 + strlen(bindir)); -+ sprintf(tmp, "%s/install/%s", temp_install, bindir); -+ bindir = tmp; -+ -+ tmp = malloc(strlen(temp_install) + 32 + strlen(libdir)); -+ sprintf(tmp, "%s/install/%s", temp_install, libdir); -+ libdir = tmp; -+ -+ tmp = malloc(strlen(temp_install) + 32 + strlen(datadir)); -+ sprintf(tmp, "%s/install/%s", temp_install, datadir); -+ datadir = tmp; -+ -+ /* psql will be installed into temp-install bindir */ -+ psqldir = bindir; -+ -+ /* -+ * Set up shared library paths to include the temp install. -+ * -+ * LD_LIBRARY_PATH covers many platforms. DYLD_LIBRARY_PATH works on -+ * Darwin, and maybe other Mach-based systems. LIBPATH is for AIX. -+ * Windows needs shared libraries in PATH (only those linked into -+ * executables, not dlopen'ed ones). Feel free to account for others -+ * as well. -+ */ -+ add_to_path("LD_LIBRARY_PATH", ':', libdir); -+ add_to_path("DYLD_LIBRARY_PATH", ':', libdir); -+ add_to_path("LIBPATH", ':', libdir); -+#if defined(WIN32) || defined(__CYGWIN__) -+ add_to_path("PATH", ';', libdir); -+#endif -+ } -+ else -+ { -+ const char *pghost; -+ const char *pgport; -+ -+ /* -+ * When testing an existing install, we honor existing environment -+ * variables, except if they're overridden by command line options. -+ */ -+ if (hostname != NULL) -+ { -+ doputenv("PGHOST", hostname); -+ unsetenv("PGHOSTADDR"); -+ } -+ if (port != -1) -+ { -+ char s[16]; -+ -+ sprintf(s, "%d", port); -+ doputenv("PGPORT", s); -+ } -+ if (user != NULL) -+ doputenv("PGUSER", user); -+ -+ /* -+ * Report what we're connecting to -+ */ -+ pghost = getenv("PGHOST"); -+ pgport = getenv("PGPORT"); -+#ifndef HAVE_UNIX_SOCKETS -+ if (!pghost) -+ pghost = "localhost"; -+#endif -+ -+ if (pghost && pgport) -+ printf(_("(using postmaster on %s, port %s)\n"), pghost, pgport); -+ if (pghost && !pgport) -+ printf(_("(using postmaster on %s, default port)\n"), pghost); -+ if (!pghost && pgport) -+ printf(_("(using postmaster on Unix socket, port %s)\n"), pgport); -+ if (!pghost && !pgport) -+ printf(_("(using postmaster on Unix socket, default port)\n")); -+ } -+ -+ convert_sourcefiles(); -+ load_resultmap(); -+} -+ -+/* -+ * Issue a command via psql, connecting to the specified database -+ * -+ * Since we use system(), this doesn't return until the operation finishes -+ */ -+static void -+psql_command(const char *database, const char *query,...) -+{ -+ char query_formatted[1024]; -+ char query_escaped[2048]; -+ char psql_cmd[MAXPGPATH + 2048]; -+ va_list args; -+ char *s; -+ char *d; -+ -+ /* Generate the query with insertion of sprintf arguments */ -+ va_start(args, query); -+ vsnprintf(query_formatted, sizeof(query_formatted), query, args); -+ va_end(args); -+ -+ /* Now escape any shell double-quote metacharacters */ -+ d = query_escaped; -+ for (s = query_formatted; *s; s++) -+ { -+ if (strchr("\\\"$`", *s)) -+ *d++ = '\\'; -+ *d++ = *s; -+ } -+ *d = '\0'; -+ -+ /* And now we can build and execute the shell command */ -+ snprintf(psql_cmd, sizeof(psql_cmd), -+ SYSTEMQUOTE "\"%s%spsql\" -X -c \"%s\" \"%s\"" SYSTEMQUOTE, -+ psqldir ? psqldir : "", -+ psqldir ? "/" : "", -+ query_escaped, -+ database); -+ -+ if (system(psql_cmd) != 0) -+ { -+ /* psql probably already reported the error */ -+ fprintf(stderr, _("command failed: %s\n"), psql_cmd); -+ exit_nicely(2); -+ } -+} -+ -+/* -+ * Spawn a process to execute the given shell command; don't wait for it -+ * -+ * Returns the process ID (or HANDLE) so we can wait for it later -+ */ -+PID_TYPE -+spawn_process(const char *cmdline) -+{ -+#ifndef WIN32 -+ pid_t pid; -+ -+ /* -+ * Must flush I/O buffers before fork. Ideally we'd use fflush(NULL) here -+ * ... does anyone still care about systems where that doesn't work? -+ */ -+ fflush(stdout); -+ fflush(stderr); -+ if (logfile) -+ fflush(logfile); -+ -+ pid = fork(); -+ if (pid == -1) -+ { -+ fprintf(stderr, _("%s: could not fork: %s\n"), -+ progname, strerror(errno)); -+ exit_nicely(2); -+ } -+ if (pid == 0) -+ { -+ /* -+ * In child -+ * -+ * Instead of using system(), exec the shell directly, and tell it to -+ * "exec" the command too. This saves two useless processes per -+ * parallel test case. -+ */ -+ char *cmdline2 = malloc(strlen(cmdline) + 6); -+ -+ sprintf(cmdline2, "exec %s", cmdline); -+ execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); -+ fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), -+ progname, shellprog, strerror(errno)); -+ exit(1); /* not exit_nicely here... */ -+ } -+ /* in parent */ -+ return pid; -+#else -+ char *cmdline2; -+ BOOL b; -+ STARTUPINFO si; -+ PROCESS_INFORMATION pi; -+ HANDLE origToken; -+ HANDLE restrictedToken; -+ SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; -+ SID_AND_ATTRIBUTES dropSids[2]; -+ __CreateRestrictedToken _CreateRestrictedToken = NULL; -+ HANDLE Advapi32Handle; -+ -+ ZeroMemory(&si, sizeof(si)); -+ si.cb = sizeof(si); -+ -+ Advapi32Handle = LoadLibrary("ADVAPI32.DLL"); -+ if (Advapi32Handle != NULL) -+ { -+ _CreateRestrictedToken = (__CreateRestrictedToken) GetProcAddress(Advapi32Handle, "CreateRestrictedToken"); -+ } -+ -+ if (_CreateRestrictedToken == NULL) -+ { -+ if (Advapi32Handle != NULL) -+ FreeLibrary(Advapi32Handle); -+ fprintf(stderr, "ERROR: cannot create restricted tokens on this platform\n"); -+ exit_nicely(2); -+ } -+ -+ /* Open the current token to use as base for the restricted one */ -+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &origToken)) -+ { -+ fprintf(stderr, "could not open process token: %lu\n", GetLastError()); -+ exit_nicely(2); -+ } -+ -+ /* Allocate list of SIDs to remove */ -+ ZeroMemory(&dropSids, sizeof(dropSids)); -+ if (!AllocateAndInitializeSid(&NtAuthority, 2, -+ SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &dropSids[0].Sid) || -+ !AllocateAndInitializeSid(&NtAuthority, 2, -+ SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0, 0, &dropSids[1].Sid)) -+ { -+ fprintf(stderr, "could not allocate SIDs: %lu\n", GetLastError()); -+ exit_nicely(2); -+ } -+ -+ b = _CreateRestrictedToken(origToken, -+ DISABLE_MAX_PRIVILEGE, -+ sizeof(dropSids) / sizeof(dropSids[0]), -+ dropSids, -+ 0, NULL, -+ 0, NULL, -+ &restrictedToken); -+ -+ FreeSid(dropSids[1].Sid); -+ FreeSid(dropSids[0].Sid); -+ CloseHandle(origToken); -+ FreeLibrary(Advapi32Handle); -+ -+ if (!b) -+ { -+ fprintf(stderr, "could not create restricted token: %lu\n", GetLastError()); -+ exit_nicely(2); -+ } -+ -+ cmdline2 = malloc(strlen(cmdline) + 8); -+ sprintf(cmdline2, "cmd /c %s", cmdline); -+ -+ if (!CreateProcessAsUser(restrictedToken, -+ NULL, -+ cmdline2, -+ NULL, -+ NULL, -+ TRUE, -+ CREATE_SUSPENDED, -+ NULL, -+ NULL, -+ &si, -+ &pi)) -+ { -+ fprintf(stderr, _("could not start process for \"%s\": %lu\n"), -+ cmdline2, GetLastError()); -+ exit_nicely(2); -+ } -+ -+#ifndef __CYGWIN__ -+ AddUserToDacl(pi.hProcess); -+#endif -+ -+ free(cmdline2); -+ -+ ResumeThread(pi.hThread); -+ CloseHandle(pi.hThread); -+ return pi.hProcess; -+#endif -+} -+ -+/* -+ * Count bytes in file -+ */ -+static long -+file_size(const char *file) -+{ -+ long r; -+ FILE *f = fopen(file, "r"); -+ -+ if (!f) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"), -+ progname, file, strerror(errno)); -+ return -1; -+ } -+ fseek(f, 0, SEEK_END); -+ r = ftell(f); -+ fclose(f); -+ return r; -+} -+ -+/* -+ * Count lines in file -+ */ -+static int -+file_line_count(const char *file) -+{ -+ int c; -+ int l = 0; -+ FILE *f = fopen(file, "r"); -+ -+ if (!f) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"), -+ progname, file, strerror(errno)); -+ return -1; -+ } -+ while ((c = fgetc(f)) != EOF) -+ { -+ if (c == '\n') -+ l++; -+ } -+ fclose(f); -+ return l; -+} -+ -+static bool -+file_exists(const char *file) -+{ -+ FILE *f = fopen(file, "r"); -+ -+ if (!f) -+ return false; -+ fclose(f); -+ return true; -+} -+ -+static bool -+directory_exists(const char *dir) -+{ -+ struct stat st; -+ -+ if (stat(dir, &st) != 0) -+ return false; -+ if (S_ISDIR(st.st_mode)) -+ return true; -+ return false; -+} -+ -+/* Create a directory */ -+static void -+make_directory(const char *dir) -+{ -+ if (mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO) < 0) -+ { -+ fprintf(stderr, _("%s: could not create directory \"%s\": %s\n"), -+ progname, dir, strerror(errno)); -+ exit_nicely(2); -+ } -+} -+ -+/* -+ * In: filename.ext, Return: filename_i.ext, where 0 < i <= 9 -+ */ -+static char * -+get_alternative_expectfile(const char *expectfile, int i) -+{ -+ char *last_dot; -+ int ssize = strlen(expectfile) + 2 + 1; -+ char *tmp = (char *) malloc(ssize); -+ char *s = (char *) malloc(ssize); -+ -+ strcpy(tmp, expectfile); -+ last_dot = strrchr(tmp, '.'); -+ if (!last_dot) -+ return NULL; -+ *last_dot = '\0'; -+ snprintf(s, ssize, "%s_%d.%s", tmp, i, last_dot + 1); -+ free(tmp); -+ return s; -+} -+ -+/* -+ * Run a "diff" command and also check that it didn't crash -+ */ -+static int -+run_diff(const char *cmd, const char *filename) -+{ -+ int r; -+ -+ r = system(cmd); -+ if (!WIFEXITED(r) || WEXITSTATUS(r) > 1) -+ { -+ fprintf(stderr, _("diff command failed with status %d: %s\n"), r, cmd); -+ exit_nicely(2); -+ } -+#ifdef WIN32 -+ -+ /* -+ * On WIN32, if the 'diff' command cannot be found, system() returns 1, -+ * but produces nothing to stdout, so we check for that here. -+ */ -+ if (WEXITSTATUS(r) == 1 && file_size(filename) <= 0) -+ { -+ fprintf(stderr, _("diff command not found: %s\n"), cmd); -+ exit_nicely(2); -+ } -+#endif -+ -+ return WEXITSTATUS(r); -+} -+ -+/* -+ * Check the actual result file for the given test against expected results -+ * -+ * Returns true if different (failure), false if correct match found. -+ * In the true case, the diff is appended to the diffs file. -+ */ -+static bool -+results_differ(const char *testname, const char *resultsfile, const char *default_expectfile) -+{ -+ char expectfile[MAXPGPATH]; -+ char diff[MAXPGPATH]; -+ char cmd[MAXPGPATH * 3]; -+ char best_expect_file[MAXPGPATH]; -+ FILE *difffile; -+ int best_line_count; -+ int i; -+ int l; -+ const char *platform_expectfile; -+ -+ /* -+ * We can pass either the resultsfile or the expectfile, they should have -+ * the same type (filename.type) anyway. -+ */ -+ platform_expectfile = get_expectfile(testname, resultsfile); -+ -+ strcpy(expectfile, default_expectfile); -+ if (platform_expectfile) -+ { -+ /* -+ * Replace everything afer the last slash in expectfile with what the -+ * platform_expectfile contains. -+ */ -+ char *p = strrchr(expectfile, '/'); -+ -+ if (p) -+ strcpy(++p, platform_expectfile); -+ } -+ -+ /* Name to use for temporary diff file */ -+ snprintf(diff, sizeof(diff), "%s.diff", resultsfile); -+ -+ /* OK, run the diff */ -+ snprintf(cmd, sizeof(cmd), -+ SYSTEMQUOTE "diff %s \"%s\" \"%s\" > \"%s\"" SYSTEMQUOTE, -+ basic_diff_opts, expectfile, resultsfile, diff); -+ -+ /* Is the diff file empty? */ -+ if (run_diff(cmd, diff) == 0) -+ { -+ unlink(diff); -+ return false; -+ } -+ -+ /* There may be secondary comparison files that match better */ -+ best_line_count = file_line_count(diff); -+ strcpy(best_expect_file, expectfile); -+ -+ for (i = 0; i <= 9; i++) -+ { -+ char *alt_expectfile; -+ -+ alt_expectfile = get_alternative_expectfile(expectfile, i); -+ if (!file_exists(alt_expectfile)) -+ continue; -+ -+ snprintf(cmd, sizeof(cmd), -+ SYSTEMQUOTE "diff %s \"%s\" \"%s\" > \"%s\"" SYSTEMQUOTE, -+ basic_diff_opts, alt_expectfile, resultsfile, diff); -+ -+ if (run_diff(cmd, diff) == 0) -+ { -+ unlink(diff); -+ return false; -+ } -+ -+ l = file_line_count(diff); -+ if (l < best_line_count) -+ { -+ /* This diff was a better match than the last one */ -+ best_line_count = l; -+ strcpy(best_expect_file, alt_expectfile); -+ } -+ free(alt_expectfile); -+ } -+ -+ /* -+ * fall back on the canonical results file if we haven't tried it yet and -+ * haven't found a complete match yet. -+ */ -+ -+ if (platform_expectfile) -+ { -+ snprintf(cmd, sizeof(cmd), -+ SYSTEMQUOTE "diff %s \"%s\" \"%s\" > \"%s\"" SYSTEMQUOTE, -+ basic_diff_opts, default_expectfile, resultsfile, diff); -+ -+ if (run_diff(cmd, diff) == 0) -+ { -+ /* No diff = no changes = good */ -+ unlink(diff); -+ return false; -+ } -+ -+ l = file_line_count(diff); -+ if (l < best_line_count) -+ { -+ /* This diff was a better match than the last one */ -+ best_line_count = l; -+ strcpy(best_expect_file, default_expectfile); -+ } -+ } -+ -+ /* -+ * Use the best comparison file to generate the "pretty" diff, which we -+ * append to the diffs summary file. -+ */ -+ snprintf(cmd, sizeof(cmd), -+ SYSTEMQUOTE "diff %s \"%s\" \"%s\" >> \"%s\"" SYSTEMQUOTE, -+ pretty_diff_opts, best_expect_file, resultsfile, difffilename); -+ run_diff(cmd, difffilename); -+ -+ /* And append a separator */ -+ difffile = fopen(difffilename, "a"); -+ if (difffile) -+ { -+ fprintf(difffile, -+ "\n======================================================================\n\n"); -+ fclose(difffile); -+ } -+ -+ unlink(diff); -+ return true; -+} -+ -+/* -+ * Wait for specified subprocesses to finish -+ * -+ * If names isn't NULL, report each subprocess as it finishes -+ * -+ * Note: it's OK to scribble on the pids array, but not on the names array -+ */ -+static void -+wait_for_tests(PID_TYPE * pids, char **names, int num_tests) -+{ -+ int tests_left; -+ int i; -+ -+#ifdef WIN32 -+ PID_TYPE *active_pids = malloc(num_tests * sizeof(PID_TYPE)); -+ -+ memcpy(active_pids, pids, num_tests * sizeof(PID_TYPE)); -+#endif -+ -+ tests_left = num_tests; -+ while (tests_left > 0) -+ { -+ PID_TYPE p; -+ -+#ifndef WIN32 -+ p = wait(NULL); -+ -+ if (p == INVALID_PID) -+ { -+ fprintf(stderr, _("failed to wait for subprocesses: %s\n"), -+ strerror(errno)); -+ exit_nicely(2); -+ } -+#else -+ int r; -+ -+ r = WaitForMultipleObjects(tests_left, active_pids, FALSE, INFINITE); -+ if (r < WAIT_OBJECT_0 || r >= WAIT_OBJECT_0 + tests_left) -+ { -+ fprintf(stderr, _("failed to wait for subprocesses: %lu\n"), -+ GetLastError()); -+ exit_nicely(2); -+ } -+ p = active_pids[r - WAIT_OBJECT_0]; -+ /* compact the active_pids array */ -+ active_pids[r - WAIT_OBJECT_0] = active_pids[tests_left - 1]; -+#endif /* WIN32 */ -+ -+ for (i = 0; i < num_tests; i++) -+ { -+ if (p == pids[i]) -+ { -+#ifdef WIN32 -+ CloseHandle(pids[i]); -+#endif -+ pids[i] = INVALID_PID; -+ if (names) -+ status(" %s", names[i]); -+ tests_left--; -+ break; -+ } -+ } -+ } -+ -+#ifdef WIN32 -+ free(active_pids); -+#endif -+} -+ -+/* -+ * Run all the tests specified in one schedule file -+ */ -+static void -+run_schedule(const char *schedule, test_function tfunc) -+{ -+#define MAX_PARALLEL_TESTS 100 -+ char *tests[MAX_PARALLEL_TESTS]; -+ _stringlist *resultfiles[MAX_PARALLEL_TESTS]; -+ _stringlist *expectfiles[MAX_PARALLEL_TESTS]; -+ _stringlist *tags[MAX_PARALLEL_TESTS]; -+ PID_TYPE pids[MAX_PARALLEL_TESTS]; -+ _stringlist *ignorelist = NULL; -+ char scbuf[1024]; -+ FILE *scf; -+ int line_num = 0; -+ -+ memset(resultfiles, 0, sizeof(_stringlist *) * MAX_PARALLEL_TESTS); -+ memset(expectfiles, 0, sizeof(_stringlist *) * MAX_PARALLEL_TESTS); -+ memset(tags, 0, sizeof(_stringlist *) * MAX_PARALLEL_TESTS); -+ -+ scf = fopen(schedule, "r"); -+ if (!scf) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for reading: %s\n"), -+ progname, schedule, strerror(errno)); -+ exit_nicely(2); -+ } -+ -+ while (fgets(scbuf, sizeof(scbuf), scf)) -+ { -+ char *test = NULL; -+ char *c; -+ int num_tests; -+ bool inword; -+ int i; -+ -+ line_num++; -+ -+ for (i = 0; i < MAX_PARALLEL_TESTS; i++) -+ { -+ if (resultfiles[i] == NULL) -+ break; -+ free_stringlist(&resultfiles[i]); -+ free_stringlist(&expectfiles[i]); -+ free_stringlist(&tags[i]); -+ } -+ -+ /* strip trailing whitespace, especially the newline */ -+ i = strlen(scbuf); -+ while (i > 0 && isspace((unsigned char) scbuf[i - 1])) -+ scbuf[--i] = '\0'; -+ -+ if (scbuf[0] == '\0' || scbuf[0] == '#') -+ continue; -+ if (strncmp(scbuf, "test: ", 6) == 0) -+ test = scbuf + 6; -+ else if (strncmp(scbuf, "ignore: ", 8) == 0) -+ { -+ c = scbuf + 8; -+ while (*c && isspace((unsigned char) *c)) -+ c++; -+ add_stringlist_item(&ignorelist, c); -+ -+ /* -+ * Note: ignore: lines do not run the test, they just say that -+ * failure of this test when run later on is to be ignored. A bit -+ * odd but that's how the shell-script version did it. -+ */ -+ continue; -+ } -+ else -+ { -+ fprintf(stderr, _("syntax error in schedule file \"%s\" line %d: %s\n"), -+ schedule, line_num, scbuf); -+ exit_nicely(2); -+ } -+ -+ num_tests = 0; -+ inword = false; -+ for (c = test; *c; c++) -+ { -+ if (isspace((unsigned char) *c)) -+ { -+ *c = '\0'; -+ inword = false; -+ } -+ else if (!inword) -+ { -+ if (num_tests >= MAX_PARALLEL_TESTS) -+ { -+ /* can't print scbuf here, it's already been trashed */ -+ fprintf(stderr, _("too many parallel tests in schedule file \"%s\", line %d\n"), -+ schedule, line_num); -+ exit_nicely(2); -+ } -+ tests[num_tests] = c; -+ num_tests++; -+ inword = true; -+ } -+ } -+ -+ if (num_tests == 0) -+ { -+ fprintf(stderr, _("syntax error in schedule file \"%s\" line %d: %s\n"), -+ schedule, line_num, scbuf); -+ exit_nicely(2); -+ } -+ -+ if (num_tests == 1) -+ { -+ status(_("test %-20s ... "), tests[0]); -+ pids[0] = (tfunc) (tests[0], &resultfiles[0], &expectfiles[0], &tags[0]); -+ wait_for_tests(pids, NULL, 1); -+ /* status line is finished below */ -+ } -+ else if (max_connections > 0 && max_connections < num_tests) -+ { -+ int oldest = 0; -+ -+ status(_("parallel group (%d tests, in groups of %d): "), -+ num_tests, max_connections); -+ for (i = 0; i < num_tests; i++) -+ { -+ if (i - oldest >= max_connections) -+ { -+ wait_for_tests(pids + oldest, tests + oldest, i - oldest); -+ oldest = i; -+ } -+ pids[i] = (tfunc) (tests[i], &resultfiles[i], &expectfiles[i], &tags[i]); -+ } -+ wait_for_tests(pids + oldest, tests + oldest, i - oldest); -+ status_end(); -+ } -+ else -+ { -+ status(_("parallel group (%d tests): "), num_tests); -+ for (i = 0; i < num_tests; i++) -+ { -+ pids[i] = (tfunc) (tests[i], &resultfiles[i], &expectfiles[i], &tags[i]); -+ } -+ wait_for_tests(pids, tests, num_tests); -+ status_end(); -+ } -+ -+ /* Check results for all tests */ -+ for (i = 0; i < num_tests; i++) -+ { -+ _stringlist *rl, -+ *el, -+ *tl; -+ bool differ = false; -+ -+ if (num_tests > 1) -+ status(_(" %-20s ... "), tests[i]); -+ -+ /* -+ * Advance over all three lists simultaneously. -+ * -+ * Compare resultfiles[j] with expectfiles[j] always. Tags are -+ * optional but if there are tags, the tag list has the same -+ * length as the other two lists. -+ */ -+ for (rl = resultfiles[i], el = expectfiles[i], tl = tags[i]; -+ rl != NULL; /* rl and el have the same length */ -+ rl = rl->next, el = el->next) -+ { -+ bool newdiff; -+ -+ if (tl) -+ tl = tl->next; /* tl has the same lengt has rl and el -+ * if it exists */ -+ -+ newdiff = results_differ(tests[i], rl->str, el->str); -+ if (newdiff && tl) -+ { -+ printf("%s ", tl->str); -+ } -+ differ |= newdiff; -+ } -+ -+ if (differ) -+ { -+ bool ignore = false; -+ _stringlist *sl; -+ -+ for (sl = ignorelist; sl != NULL; sl = sl->next) -+ { -+ if (strcmp(tests[i], sl->str) == 0) -+ { -+ ignore = true; -+ break; -+ } -+ } -+ if (ignore) -+ { -+ status(_("failed (ignored)")); -+ fail_ignore_count++; -+ } -+ else -+ { -+ status(_("FAILED")); -+ fail_count++; -+ } -+ } -+ else -+ { -+ status(_("ok")); -+ success_count++; -+ } -+ -+ status_end(); -+ } -+ } -+ -+ fclose(scf); -+} -+ -+/* -+ * Run a single test -+ */ -+static void -+run_single_test(const char *test, test_function tfunc) -+{ -+ PID_TYPE pid; -+ _stringlist *resultfiles = NULL; -+ _stringlist *expectfiles = NULL; -+ _stringlist *tags = NULL; -+ _stringlist *rl, -+ *el, -+ *tl; -+ bool differ = false; -+ -+ status(_("test %-20s ... "), test); -+ pid = (tfunc) (test, &resultfiles, &expectfiles, &tags); -+ wait_for_tests(&pid, NULL, 1); -+ -+ /* -+ * Advance over all three lists simultaneously. -+ * -+ * Compare resultfiles[j] with expectfiles[j] always. Tags are optional -+ * but if there are tags, the tag list has the same length as the other -+ * two lists. -+ */ -+ for (rl = resultfiles, el = expectfiles, tl = tags; -+ rl != NULL; /* rl and el have the same length */ -+ rl = rl->next, el = el->next) -+ { -+ bool newdiff; -+ -+ if (tl) -+ tl = tl->next; /* tl has the same lengt has rl and el if it -+ * exists */ -+ -+ newdiff = results_differ(test, rl->str, el->str); -+ if (newdiff && tl) -+ { -+ printf("%s ", tl->str); -+ } -+ differ |= newdiff; -+ } -+ -+ if (differ) -+ { -+ status(_("FAILED")); -+ fail_count++; -+ } -+ else -+ { -+ status(_("ok")); -+ success_count++; -+ } -+ status_end(); -+} -+ -+/* -+ * Create the summary-output files (making them empty if already existing) -+ */ -+static void -+open_result_files(void) -+{ -+ char file[MAXPGPATH]; -+ FILE *difffile; -+ -+ /* create the log file (copy of running status output) */ -+ snprintf(file, sizeof(file), "%s/regression.out", outputdir); -+ logfilename = strdup(file); -+ logfile = fopen(logfilename, "w"); -+ if (!logfile) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for writing: %s\n"), -+ progname, logfilename, strerror(errno)); -+ exit_nicely(2); -+ } -+ -+ /* create the diffs file as empty */ -+ snprintf(file, sizeof(file), "%s/regression.diffs", outputdir); -+ difffilename = strdup(file); -+ difffile = fopen(difffilename, "w"); -+ if (!difffile) -+ { -+ fprintf(stderr, _("%s: could not open file \"%s\" for writing: %s\n"), -+ progname, difffilename, strerror(errno)); -+ exit_nicely(2); -+ } -+ /* we don't keep the diffs file open continuously */ -+ fclose(difffile); -+ -+ /* also create the output directory if not present */ -+ snprintf(file, sizeof(file), "%s/results", outputdir); -+ if (!directory_exists(file)) -+ make_directory(file); -+} -+ -+static void -+drop_database_if_exists(const char *dbname) -+{ -+ header(_("dropping database \"%s\""), dbname); -+ psql_command("postgres", "DROP DATABASE IF EXISTS \"%s\"", dbname); -+} -+ -+static void -+create_database(const char *dbname) -+{ -+ _stringlist *sl; -+ -+ /* -+ * We use template0 so that any installation-local cruft in template1 will -+ * not mess up the tests. -+ */ -+ header(_("creating database \"%s\""), dbname); -+ if (encoding) -+ psql_command("postgres", "CREATE DATABASE \"%s\" TEMPLATE=template0 ENCODING='%s'", dbname, encoding); -+ else -+ psql_command("postgres", "CREATE DATABASE \"%s\" TEMPLATE=template0", dbname); -+ psql_command(dbname, -+ "ALTER DATABASE \"%s\" SET lc_messages TO 'C';" -+ "ALTER DATABASE \"%s\" SET lc_monetary TO 'C';" -+ "ALTER DATABASE \"%s\" SET lc_numeric TO 'C';" -+ "ALTER DATABASE \"%s\" SET lc_time TO 'C';" -+ "ALTER DATABASE \"%s\" SET timezone_abbreviations TO 'Default';", -+ dbname, dbname, dbname, dbname, dbname); -+ -+ /* -+ * Install any requested procedural languages -+ */ -+ for (sl = loadlanguage; sl != NULL; sl = sl->next) -+ { -+ header(_("installing %s"), sl->str); -+ psql_command(dbname, "CREATE LANGUAGE \"%s\"", sl->str); -+ } -+} -+ -+static void -+drop_role_if_exists(const char *rolename) -+{ -+ header(_("dropping role \"%s\""), rolename); -+ psql_command("postgres", "DROP ROLE IF EXISTS \"%s\"", rolename); -+} -+ -+static void -+create_role(const char *rolename, const _stringlist * granted_dbs) -+{ -+ header(_("creating role \"%s\""), rolename); -+ psql_command("postgres", "CREATE ROLE \"%s\" WITH LOGIN", rolename); -+ for (; granted_dbs != NULL; granted_dbs = granted_dbs->next) -+ { -+ psql_command("postgres", "GRANT ALL ON DATABASE \"%s\" TO \"%s\"", -+ granted_dbs->str, rolename); -+ } -+} -+ -+static void -+help(void) -+{ -+ printf(_("PostgreSQL regression test driver\n")); -+ printf(_("\n")); -+ printf(_("Usage: %s [options...] [extra tests...]\n"), progname); -+ printf(_("\n")); -+ printf(_("Options:\n")); -+ printf(_(" --dbname=DB use database DB (default \"regression\")\n")); -+ printf(_(" --debug turn on debug mode in programs that are run\n")); -+ printf(_(" --inputdir=DIR take input files from DIR (default \".\")\n")); -+ printf(_(" --load-language=lang load the named language before running the\n")); -+ printf(_(" tests; can appear multiple times\n")); -+ printf(_(" --create-role=ROLE create the specified role before testing\n")); -+ printf(_(" --max-connections=N maximum number of concurrent connections\n")); -+ printf(_(" (default is 0 meaning unlimited)\n")); -+ printf(_(" --multibyte=ENCODING use ENCODING as the multibyte encoding\n")); -+ printf(_(" --outputdir=DIR place output files in DIR (default \".\")\n")); -+ printf(_(" --schedule=FILE use test ordering schedule from FILE\n")); -+ printf(_(" (can be used multiple times to concatenate)\n")); -+ printf(_(" --srcdir=DIR absolute path to source directory (for VPATH builds)\n")); -+ printf(_(" --temp-install=DIR create a temporary installation in DIR\n")); -+ printf(_("\n")); -+ printf(_("Options for \"temp-install\" mode:\n")); -+ printf(_(" --no-locale use C locale\n")); -+ printf(_(" --top-builddir=DIR (relative) path to top level build directory\n")); -+ printf(_(" --temp-port=PORT port number to start temp postmaster on\n")); -+ printf(_(" --temp-config=PATH append contents of PATH to temporary config\n")); -+ printf(_("\n")); -+ printf(_("Options for using an existing installation:\n")); -+ printf(_(" --host=HOST use postmaster running on HOST\n")); -+ printf(_(" --port=PORT use postmaster running at PORT\n")); -+ printf(_(" --user=USER connect as USER\n")); -+ printf(_(" --psqldir=DIR use psql in DIR (default: find in PATH)\n")); -+ printf(_("\n")); -+ printf(_("The exit status is 0 if all tests passed, 1 if some tests failed, and 2\n")); -+ printf(_("if the tests could not be run for some reason.\n")); -+ printf(_("\n")); -+ printf(_("Report bugs to <pgsql-bugs@postgresql.org>.\n")); -+} -+ -+int -+regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc) -+{ -+ _stringlist *sl; -+ int c; -+ int i; -+ int option_index; -+ char buf[MAXPGPATH * 4]; -+ -+ static struct option long_options[] = { -+ {"help", no_argument, NULL, 'h'}, -+ {"version", no_argument, NULL, 'V'}, -+ {"dbname", required_argument, NULL, 1}, -+ {"debug", no_argument, NULL, 2}, -+ {"inputdir", required_argument, NULL, 3}, -+ {"load-language", required_argument, NULL, 4}, -+ {"max-connections", required_argument, NULL, 5}, -+ {"multibyte", required_argument, NULL, 6}, -+ {"outputdir", required_argument, NULL, 7}, -+ {"schedule", required_argument, NULL, 8}, -+ {"temp-install", required_argument, NULL, 9}, -+ {"no-locale", no_argument, NULL, 10}, -+ {"top-builddir", required_argument, NULL, 11}, -+ {"temp-port", required_argument, NULL, 12}, -+ {"host", required_argument, NULL, 13}, -+ {"port", required_argument, NULL, 14}, -+ {"user", required_argument, NULL, 15}, -+ {"psqldir", required_argument, NULL, 16}, -+ {"srcdir", required_argument, NULL, 17}, -+ {"create-role", required_argument, NULL, 18}, -+ {"temp-config", required_argument, NULL, 19}, -+ {NULL, 0, NULL, 0} -+ }; -+ -+ progname = get_progname(argv[0]); -+ set_pglocale_pgservice(argv[0], "pg_regress"); -+ -+#ifndef HAVE_UNIX_SOCKETS -+ /* no unix domain sockets available, so change default */ -+ hostname = "localhost"; -+#endif -+ -+ /* -+ * We call the initialization function here because that way we can set -+ * default parameters and let them be overwritten by the commandline. -+ */ -+ ifunc(); -+ -+ while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) -+ { -+ switch (c) -+ { -+ case 'h': -+ help(); -+ exit_nicely(0); -+ case 'V': -+ printf("pg_regress (PostgreSQL %s)\n", PG_VERSION); -+ exit_nicely(0); -+ case 1: -+ -+ /* -+ * If a default database was specified, we need to remove it -+ * before we add the specified one. -+ */ -+ free_stringlist(&dblist); -+ split_to_stringlist(strdup(optarg), ", ", &dblist); -+ break; -+ case 2: -+ debug = true; -+ break; -+ case 3: -+ inputdir = strdup(optarg); -+ break; -+ case 4: -+ add_stringlist_item(&loadlanguage, optarg); -+ break; -+ case 5: -+ max_connections = atoi(optarg); -+ break; -+ case 6: -+ encoding = strdup(optarg); -+ break; -+ case 7: -+ outputdir = strdup(optarg); -+ break; -+ case 8: -+ add_stringlist_item(&schedulelist, optarg); -+ break; -+ case 9: -+ /* temp_install must be absolute path */ -+ if (is_absolute_path(optarg)) -+ temp_install = strdup(optarg); -+ else -+ { -+ char cwdbuf[MAXPGPATH]; -+ -+ if (!getcwd(cwdbuf, sizeof(cwdbuf))) -+ { -+ fprintf(stderr, _("could not get current working directory: %s\n"), strerror(errno)); -+ exit_nicely(2); -+ } -+ temp_install = malloc(strlen(cwdbuf) + strlen(optarg) + 2); -+ sprintf(temp_install, "%s/%s", cwdbuf, optarg); -+ } -+ canonicalize_path(temp_install); -+ break; -+ case 10: -+ nolocale = true; -+ break; -+ case 11: -+ top_builddir = strdup(optarg); -+ break; -+ case 12: -+ { -+ int p = atoi(optarg); -+ -+ /* Since Makefile isn't very bright, check port range */ -+ if (p >= 1024 && p <= 65535) -+ temp_port = p; -+ } -+ break; -+ case 13: -+ hostname = strdup(optarg); -+ break; -+ case 14: -+ port = atoi(optarg); -+ break; -+ case 15: -+ user = strdup(optarg); -+ break; -+ case 16: -+ /* "--psqldir=" should mean to use PATH */ -+ if (strlen(optarg)) -+ psqldir = strdup(optarg); -+ break; -+ case 17: -+ srcdir = strdup(optarg); -+ break; -+ case 18: -+ split_to_stringlist(strdup(optarg), ", ", &extraroles); -+ break; -+ case 19: -+ temp_config = strdup(optarg); -+ break; -+ default: -+ /* getopt_long already emitted a complaint */ -+ fprintf(stderr, _("\nTry \"%s -h\" for more information.\n"), -+ progname); -+ exit_nicely(2); -+ } -+ } -+ -+ /* -+ * if we still have arguments, they are extra tests to run -+ */ -+ while (argc - optind >= 1) -+ { -+ add_stringlist_item(&extra_tests, argv[optind]); -+ optind++; -+ } -+ -+ if (temp_install) -+ port = temp_port; -+ -+ /* -+ * Initialization -+ */ -+ open_result_files(); -+ -+ initialize_environment(); -+ -+#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_CORE) -+ unlimit_core_size(); -+#endif -+ -+ if (temp_install) -+ { -+ /* -+ * Prepare the temp installation -+ */ -+ if (!top_builddir) -+ { -+ fprintf(stderr, _("--top-builddir must be specified when using --temp-install\n")); -+ exit_nicely(2); -+ } -+ -+ if (directory_exists(temp_install)) -+ { -+ header(_("removing existing temp installation")); -+ rmtree(temp_install, true); -+ } -+ -+ header(_("creating temporary installation")); -+ -+ /* make the temp install top directory */ -+ make_directory(temp_install); -+ -+ /* and a directory for log files */ -+ snprintf(buf, sizeof(buf), "%s/log", outputdir); -+ if (!directory_exists(buf)) -+ make_directory(buf); -+ -+ /* "make install" */ -+#ifndef WIN32_ONLY_COMPILER -+ snprintf(buf, sizeof(buf), -+ SYSTEMQUOTE "\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install with_perl=no with_python=no > \"%s/log/install.log\" 2>&1" SYSTEMQUOTE, -+ makeprog, top_builddir, temp_install, outputdir); -+#else -+ snprintf(buf, sizeof(buf), -+ SYSTEMQUOTE "perl \"%s/src/tools/msvc/install.pl\" \"%s/install\" >\"%s/log/install.log\" 2>&1" SYSTEMQUOTE, -+ top_builddir, temp_install, outputdir); -+#endif -+ if (system(buf)) -+ { -+ fprintf(stderr, _("\n%s: installation failed\nExamine %s/log/install.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf); -+ exit_nicely(2); -+ } -+ -+ /* initdb */ -+ header(_("initializing database system")); -+ snprintf(buf, sizeof(buf), -+ SYSTEMQUOTE "\"%s/initdb\" -D \"%s/data\" -L \"%s\" --noclean%s%s > \"%s/log/initdb.log\" 2>&1" SYSTEMQUOTE, -+ bindir, temp_install, datadir, -+ debug ? " --debug" : "", -+ nolocale ? " --no-locale" : "", -+ outputdir); -+ if (system(buf)) -+ { -+ fprintf(stderr, _("\n%s: initdb failed\nExamine %s/log/initdb.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf); -+ exit_nicely(2); -+ } -+ -+ /* add any extra config specified to the postgresql.conf */ -+ if (temp_config != NULL) -+ { -+ FILE *extra_conf; -+ FILE *pg_conf; -+ char line_buf[1024]; -+ -+ snprintf(buf, sizeof(buf), "%s/data/postgresql.conf", temp_install); -+ pg_conf = fopen(buf, "a"); -+ if (pg_conf == NULL) -+ { -+ fprintf(stderr, _("\n%s: could not open %s for adding extra config:\nError was %s\n"), progname, buf, strerror(errno)); -+ exit_nicely(2); -+ } -+ extra_conf = fopen(temp_config, "r"); -+ if (extra_conf == NULL) -+ { -+ fprintf(stderr, _("\n%s: could not open %s to read extra config:\nError was %s\n"), progname, buf, strerror(errno)); -+ exit_nicely(2); -+ } -+ while (fgets(line_buf, sizeof(line_buf), extra_conf) != NULL) -+ fputs(line_buf, pg_conf); -+ fclose(extra_conf); -+ fclose(pg_conf); -+ } -+ -+ /* -+ * Start the temp postmaster -+ */ -+ header(_("starting postmaster")); -+ snprintf(buf, sizeof(buf), -+ SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE, -+ bindir, temp_install, -+ debug ? " -d 5" : "", -+ hostname ? hostname : "", -+ outputdir); -+ postmaster_pid = spawn_process(buf); -+ if (postmaster_pid == INVALID_PID) -+ { -+ fprintf(stderr, _("\n%s: could not spawn postmaster: %s\n"), -+ progname, strerror(errno)); -+ exit_nicely(2); -+ } -+ -+ /* -+ * Wait till postmaster is able to accept connections (normally only a -+ * second or so, but Cygwin is reportedly *much* slower). Don't wait -+ * forever, however. -+ */ -+ snprintf(buf, sizeof(buf), -+ SYSTEMQUOTE "\"%s/psql\" -X postgres <%s 2>%s" SYSTEMQUOTE, -+ bindir, DEVNULL, DEVNULL); -+ for (i = 0; i < 60; i++) -+ { -+ /* Done if psql succeeds */ -+ if (system(buf) == 0) -+ break; -+ -+ /* -+ * Fail immediately if postmaster has exited -+ */ -+#ifndef WIN32 -+ if (kill(postmaster_pid, 0) != 0) -+#else -+ if (WaitForSingleObject(postmaster_pid, 0) == WAIT_OBJECT_0) -+#endif -+ { -+ fprintf(stderr, _("\n%s: postmaster failed\nExamine %s/log/postmaster.log for the reason\n"), progname, outputdir); -+ exit_nicely(2); -+ } -+ -+ pg_usleep(1000000L); -+ } -+ if (i >= 60) -+ { -+ fprintf(stderr, _("\n%s: postmaster did not respond within 60 seconds\nExamine %s/log/postmaster.log for the reason\n"), progname, outputdir); -+ -+ /* -+ * If we get here, the postmaster is probably wedged somewhere in -+ * startup. Try to kill it ungracefully rather than leaving a -+ * stuck postmaster that might interfere with subsequent test -+ * attempts. -+ */ -+#ifndef WIN32 -+ if (kill(postmaster_pid, SIGKILL) != 0 && -+ errno != ESRCH) -+ fprintf(stderr, _("\n%s: could not kill failed postmaster: %s\n"), -+ progname, strerror(errno)); -+#else -+ if (TerminateProcess(postmaster_pid, 255) == 0) -+ fprintf(stderr, _("\n%s: could not kill failed postmaster: %lu\n"), -+ progname, GetLastError()); -+#endif -+ -+ exit_nicely(2); -+ } -+ -+ postmaster_running = true; -+ -+ printf(_("running on port %d with pid %lu\n"), -+ temp_port, (unsigned long) postmaster_pid); -+ } -+ else -+ { -+ /* -+ * Using an existing installation, so may need to get rid of -+ * pre-existing database(s) and role(s) -+ */ -+ for (sl = dblist; sl; sl = sl->next) -+ drop_database_if_exists(sl->str); -+ for (sl = extraroles; sl; sl = sl->next) -+ drop_role_if_exists(sl->str); -+ } -+ -+ /* -+ * Create the test database(s) and role(s) -+ */ -+ for (sl = dblist; sl; sl = sl->next) -+ create_database(sl->str); -+ for (sl = extraroles; sl; sl = sl->next) -+ create_role(sl->str, dblist); -+ -+ /* -+ * Ready to run the tests -+ */ -+ header(_("running regression test queries")); -+ -+ for (sl = schedulelist; sl != NULL; sl = sl->next) -+ { -+ run_schedule(sl->str, tfunc); -+ } -+ -+ for (sl = extra_tests; sl != NULL; sl = sl->next) -+ { -+ run_single_test(sl->str, tfunc); -+ } -+ -+ /* -+ * Shut down temp installation's postmaster -+ */ -+ if (temp_install) -+ { -+ header(_("shutting down postmaster")); -+ stop_postmaster(); -+ } -+ -+ fclose(logfile); -+ -+ /* -+ * Emit nice-looking summary message -+ */ -+ if (fail_count == 0 && fail_ignore_count == 0) -+ snprintf(buf, sizeof(buf), -+ _(" All %d tests passed. "), -+ success_count); -+ else if (fail_count == 0) /* fail_count=0, fail_ignore_count>0 */ -+ snprintf(buf, sizeof(buf), -+ _(" %d of %d tests passed, %d failed test(s) ignored. "), -+ success_count, -+ success_count + fail_ignore_count, -+ fail_ignore_count); -+ else if (fail_ignore_count == 0) /* fail_count>0 && fail_ignore_count=0 */ -+ snprintf(buf, sizeof(buf), -+ _(" %d of %d tests failed. "), -+ fail_count, -+ success_count + fail_count); -+ else -+ /* fail_count>0 && fail_ignore_count>0 */ -+ snprintf(buf, sizeof(buf), -+ _(" %d of %d tests failed, %d of these failures ignored. "), -+ fail_count + fail_ignore_count, -+ success_count + fail_count + fail_ignore_count, -+ fail_ignore_count); -+ -+ putchar('\n'); -+ for (i = strlen(buf); i > 0; i--) -+ putchar('='); -+ printf("\n%s\n", buf); -+ for (i = strlen(buf); i > 0; i--) -+ putchar('='); -+ putchar('\n'); -+ putchar('\n'); -+ -+ if (file_size(difffilename) > 0) -+ { -+ printf(_("The differences that caused some tests to fail can be viewed in the\n" -+ "file \"%s\". A copy of the test summary that you see\n" -+ "above is saved in the file \"%s\".\n\n"), -+ difffilename, logfilename); -+ } -+ else -+ { -+ unlink(difffilename); -+ unlink(logfilename); -+ } -+ -+ if (fail_count != 0) -+ exit_nicely(1); -+ -+ return 0; -+}
--- a/dev-db/postgresql-server/files/postgresql.conf-8.3 Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -# PostgreSQL's Database Directory -PGDATA="/var/lib/postgresql/8.3/data" - -# PostgreSQL User -PGUSER="postgres" - -# PostgreSQL Group -PGGROUP="postgres" - -# Extra options to run postmaster with, e.g.: -# -N is the maximal number of client connections -# -B is the number of shared buffers and has to be at least 2x the value for -N -# Please read the man-page to postmaster for more options. Many of these options -# can be set directly in the configuration-file. -#PGOPTS="-N 512 -B 1024" - - -# SERVER SHUTDOWN: -# The server will receive 3 signals in the worst case: -# 1. SIGTERM -# This signals the server to ignore new connections and to -# wait for all clients to end their transactions before shutting down. -# Use WAIT_FOR_DISCONNECT to control how much time the clients -# should have until the next signal is being sent. -# 2. SIGINT -# Tell the server to forcefully disconnect all clients. -# Terminating a client results in a rollback of the open transactions for this client. -# Use WAIT_FOR_CLEANUP to determine how much time the server has -# for cleanup. -# 3. SIGQUIT -# This will terminate the server immediately and results in a recovery run for the next start. - -# Wait for clients to disconnect -WAIT_FOR_DISCONNECT=30 - -# Time the server has to clean up -WAIT_FOR_CLEANUP=60 - -# Time the server has to quit (with a recover-run on next startup) -# Set to 0 to deactivate it -WAIT_FOR_QUIT=60 - -# Comment this out if you don't want to wait for the server to -# startup before continuing. For example, if this server is a -# PITR log shipping based replication standby -WAIT_FOR_START="-w" - -# If you have to export environment variables for the database process, -# this can be done here. -# -# Example: -# export R_HOME="/usr/lib/R"
--- a/dev-db/postgresql-server/files/postgresql.init-8.3 Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3,v 1.4 2008/09/28 22:53:02 caleb Exp $ - -opts="${opts} reload" - -depend() { - use net - if [ -L /etc/eselect/postgresql/service ] ; then - local p_service="$(for f in /etc/eselect/postgresql/service/* ; do source $f ; done ; echo $postgres_service )" - test "${p_service}" = "${SVCNAME}" && provide postgresql - fi -} - -checkconfig() { - if [ ! -d "$PGDATA" ] ; then - eerror "Directory not found: $PGDATA" - eerror "Please make sure that PGDATA points to the right path." - eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster." - return 1 - fi -} - -start() { - checkconfig || return 1 - - ebegin "Starting PostgreSQL" - - if [ -f "$PGDATA/postmaster.pid" ] ; then - rm -f "$PGDATA/postmaster.pid" - fi - - local retval - - su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl start ${WAIT_FOR_START} -o '--silent-mode=true ${PGOPTS}'" - retval=$? - [ $retval -ne 0 ] && eend $retval && return $retval - - # The following is to catch the case of an already running server - # in which pg_ctl doesn't know to which server it connected to and false reports the server as 'up' - sleep 2 - if [ ! -f "$PGDATA/postmaster.pid" ] ; then - eerror "The pid-file doesn't exist but pg_ctl reported a running server." - eerror "Please check whether there is another server running on the same port or read the log-file." - eend 1 - return 1 - fi - - local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") - ps -p "${pid}" &> /dev/null - eend $? -} - -stop() { - ebegin "Stopping PostgreSQL (this can take up to $(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)" - - local retval - - su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -t ${WAIT_FOR_DISCONNECT} -m smart" - - retval=$? - [ $retval -eq 0 ] && eend $retval && return $retval - - ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds." - ewarn "Going to shutdown the server anyway." - - su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -m fast" - - retval=$? - [ $retval -eq 0 ] && eend $retval && return $retval - - if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then - eerror "Server did not shut down and sending the SIGQUIT has been disabled." - eend $retval - return $retval - fi - - ewarn "Shutting down the server gracefully failed." - ewarn "Forcing it to shutdown which leads to a recover-run on next startup." - - su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -m immediate" - - retval=$? - [ $retval -eq 0 ] && eend $retval && return $retval - - eerror "Forced shutdown failed!!! Something is wrong with your system, please take care of it manually." - eend $? -} - -reload() { - ebegin "Reloading PostgreSQL configuration" - su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl reload" - eend $? -}
--- a/dev-db/postgresql-server/postgresql-server-8.3.6.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/postgresql-server-8.3.5.ebuild,v 1.1 2008/12/03 19:27:06 caleb Exp $ - -EAPI="1" - -WANT_AUTOCONF="latest" -WANT_AUTOMAKE="none" -inherit eutils multilib toolchain-funcs versionator autotools - -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" - -DESCRIPTION="PostgreSQL server" -HOMEPAGE="http://www.postgresql.org/" -SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2" -LICENSE="POSTGRESQL" -SLOT="$(get_version_component_range 1-2)" -IUSE_LINGUAS=" - linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr - linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl - linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv - linguas_tr linguas_zh_CN linguas_zh_TW" -IUSE="doc perl python selinux tcl uuid xml nls kernel_linux ${IUSE_LINGUAS}" - -wanted_languages() { - for u in ${IUSE_LINGUAS} ; do - use $u && echo -n "${u#linguas_} " - done -} - -RDEPEND="~dev-db/postgresql-base-${PV}:${SLOT} - perl? ( >=dev-lang/perl-5.6.1-r2 ) - python? ( >=dev-lang/python-2.2 dev-python/egenix-mx-base ) - selinux? ( sec-policy/selinux-postgresql ) - tcl? ( >=dev-lang/tcl-8 ) - uuid? ( dev-libs/ossp-uuid ) - xml? ( dev-libs/libxml2 dev-libs/libxslt )" -DEPEND="${RDEPEND} - sys-devel/flex - xml? ( dev-util/pkgconfig )" -PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" - -S="${WORKDIR}/postgresql-${PV}" - -pkg_setup() { - enewgroup postgres 70 - enewuser postgres 70 /bin/bash /var/lib/postgresql postgres -} - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \ - "${FILESDIR}/postgresql-${SLOT}-server.patch" - - if hasq test ${FEATURES}; then - sed -e "s|/no/such/location|${S}/src/test/regress/tmp_check/no/such/location|g" -i src/test/regress/{input,output}/tablespace.source - else - echo "all install:" > "${S}/src/test/regress/GNUmakefile" - fi - - eautoconf -} - -src_compile() { - # TODO: test if PPC really cannot work with other CFLAGS settings - # use ppc && CFLAGS="-pipe -fsigned-char" - - # eval is needed to get along with pg_config quotation of space-rich entities. - eval econf "$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \ - --disable-thread-safety \ - $(use_with perl) \ - $(use_with python) \ - $(use_with tcl) \ - $(use_with xml libxml) \ - $(use_with xml libxslt) \ - $(use_with uuid ossp-uuid) \ - --with-system-tzdata="/usr/share/zoneinfo" \ - --with-includes="/usr/include/postgresql-${SLOT}/" \ - "$(built_with_use ~dev-db/postgresql-base-${PV} nls && use_enable nls nls "$(wanted_languages)")" \ - || die "configure failed" - - for bd in . contrib $(use xml && echo contrib/xml2); do - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake -C $bd -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ - NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake in $bd failed" - done -} - -src_install() { - if use perl ; then - mv -f "${S}/src/pl/plperl/GNUmakefile" "${S}/src/pl/plperl/GNUmakefile_orig" - sed -e "s:\$(DESTDIR)\$(plperl_installdir):\$(plperl_installdir):" \ - "${S}/src/pl/plperl/GNUmakefile_orig" > "${S}/src/pl/plperl/GNUmakefile" - fi - - for bd in . contrib $(use xml && echo contrib/xml2) ; do - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake install -C $bd -j1 DESTDIR="${D}" \ - PGXS_IN_SERVER=1 PGXS_WITH_SERVER="${S}/src/backend/postgres" \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - NO_PGXS=0 USE_PGXS=1 docdir=/usr/share/doc/${PF} || die "emake install in $bd failed" - done - - rm -rf "${D}/usr/share/postgresql-${SLOT}/man/man7/" "${D}/usr/share/doc/${PF}/html" - rm "${D}"/usr/share/postgresql-${SLOT}/man/man1/{clusterdb,create{db,lang,user},drop{db,lang,user},ecpg,pg_{config,dump,dumpall,restore},psql,reindexdb,vacuumdb}.1 - - dodoc README HISTORY doc/{README.*,TODO,bug.template} - - dodir /etc/eselect/postgresql/slots/${SLOT} - cat >"${D}/etc/eselect/postgresql/slots/${SLOT}/service" <<-__EOF__ - postgres_ebuilds="\${postgres_ebuilds} ${PF}" - postgres_service="postgresql-${SLOT}" - __EOF__ - - newinitd "${FILESDIR}/postgresql.init-${SLOT}" postgresql-${SLOT} || die "Inserting init.d-file failed" - newconfd "${FILESDIR}/postgresql.conf-${SLOT}" postgresql-${SLOT} || die "Inserting conf.d-file failed" - - keepdir /var/run/postgresql - fperms 0770 /var/run/postgresql - fowners postgres:postgres /var/run/postgresql -} - -pkg_postinst() { - eselect postgresql update - [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT} - [[ "$(eselect postgresql show-service)" = "(none)" ]] && eselect postgresql set-service ${SLOT} - - ewarn "Please note that the standard location of the socket has changed from /tmp" - ewarn "to /var/run/postgresql and you have to be in the 'postgres' group to access" - ewarn "the socket." - ewarn "This can break applications which have the standard location hard-coded." - ewarn "If such an application links against the libpq, please re-emerge it," - ewarn "if that doesn't help or the application accesses the socket without using libpq," - ewarn "please file a bug-report." - ewarn "You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location." - - elog "Execute the following command to setup the initial database environment:" - elog - elog "emerge --config =${CATEGORY}/${PF}" - elog - elog "The autovacuum function, which was in contrib, has been moved to the main" - elog "PostgreSQL functions starting with 8.1." - elog "You can enable it in the clusters postgresql.conf." -} - -pkg_postrm() { - eselect postgresql update -} - -pkg_config() { - [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" - - einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable." - einfo "More information can be found here:" - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" - einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" - einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable." - einfo - einfo "You can change the directory where the database cluster is being created by setting" - einfo "the PGDATA variable." - einfo - einfo "PG_INITDB_OPTS is currently set to:" - einfo " \"${PG_INITDB_OPTS}\"" - einfo "and the database cluster will be created in:" - einfo " \"${PGDATA}\"" - einfo "Are you ready to continue? (Y/n)" - read answer - [ -z $answer ] && answer=Y - [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" - - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - eerror "The given directory \"${PGDATA}\" already contains a database cluster." - die "cluster already exists" - fi - - [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" - einfo "Checking system parameters..." - - if ! use kernel_linux ; then - SKIP_SYSTEM_TESTS=yes - einfo " Tests not supported on this OS (yet)" - fi - - if [ -z ${SKIP_SYSTEM_TESTS} ] ; then - einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..." - - local SEMMSL=$(sysctl -n kernel.sem | cut -f1) - local SEMMNS=$(sysctl -n kernel.sem | cut -f2) - local SEMMNI=$(sysctl -n kernel.sem | cut -f4) - local SHMMAX=$(sysctl -n kernel.shmmax) - - local SEMMSL_MIN=17 - local SEMMNS_MIN=$(( ( ${PG_MAX_CONNECTIONS}/16 ) * 17 )) - local SEMMNI_MIN=$(( ( ${PG_MAX_CONNECTIONS}+15 ) / 16 )) - local SHMMAX_MIN=$(( 500000 + ( 30600 * ${PG_MAX_CONNECTIONS} ) )) - - for p in SEMMSL SEMMNS SEMMNI SHMMAX ; do - if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then - eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)" - eerror "You have now several options:" - eerror " - Change the mentioned system parameter" - eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a value lower than ${PG_MAX_CONNECTIONS}" - eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely" - eerror "More information can be found here:" - eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html" - die "system test failed" - fi - done - einfo "Passed." - else - einfo "Skipped." - fi - - einfo "Creating the data directory ..." - mkdir -p "${PGDATA}" - chown -Rf postgres:postgres "${PGDATA}" - chmod 0700 "${PGDATA}" - - einfo "Initializing the database ..." - - su postgres -c "/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb --pgdata \"${PGDATA}\" ${PG_INITDB_OPTS}" - - einfo - einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." - einfo - - if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then - ewarn "You didn't install the database cluster in the standard location, please make sure that you set" - ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})" - fi -} - -src_test() { - einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" - PATH="/usr/$(get_libdir)/postgresql-${SLOT}/bin:${PATH}" \ - emake -j1 check \ - PGXS=$(/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --pgxs) \ - NO_PGXS=0 USE_PGXS=1 SLOT=${SLOT} || die "Make check failed. See above for details." - - einfo "Yes, there are other tests which could be run." - einfo "... and no, we don't plan to add/support them." - einfo "For now, the main regressions tests will suffice." - einfo "If you think other tests are necessary, please submit a" - einfo "bug including a patch for this ebuild to enable them." -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/mercurial/Manifest Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,5 @@ +AUX 70mercurial-gentoo.el 76 RMD160 1891ab510adb464211b4cc35c5b6e4b149da79fa SHA1 72eb35d2bf86fa8f806acfbc823b88fc5188741b SHA256 c215746e4a5375569808c6aa6ddabe08e82d33d744128179be3142d9cd53a5ab +DIST mercurial-1.3.tar.gz 1768227 RMD160 20032f18a2bbe1d60969567299bb9ca3392fe6d9 SHA1 af1bfc2817e0719124593e4ec03f0056a4b2870c SHA256 f25feec95586b60b939c60a1dfc0d20d69ebe0f1eca38dc3a8edbcba5b6dfd47 +EBUILD mercurial-1.3.ebuild 3226 RMD160 743d444c471c607972c0cedb0da2599574b6672a SHA1 a29c432f1335a05cdf26aba60ccbb62e17540f5f SHA256 0f1b83d61da1f559d97d934c7c21601015cb8a622ece49344af3bc0294cca507 +MISC mercurial-1.3.ebuild~ 3227 RMD160 53995ef1c666099a6a80610326c6c0ac208ec998 SHA1 806a68c5ddbf45e8a8eac4fda7cc596f458d4895 SHA256 caa14f58750f897be2c0cb3d8c09e699aee280d3c06ad7e4eafaf58eaa24d8bf +MISC metadata.xml 645 RMD160 2a33b3987960796da78558e671c4e5e0c6f10241 SHA1 6cd04e19dc7796b53afe98a9831e128c4c96f3ca SHA256 e0b05e42345698eda32c513e3a8f14d8bf42d5344dcd804b1f2234da327524e2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/mercurial/mercurial-1.3.ebuild Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,118 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-util/mercurial/mercurial-1.0.2.ebuild,v 1.7 2008/10/17 08:04:41 aballier Exp $ + +inherit bash-completion elisp-common flag-o-matic eutils distutils + +DESCRIPTION="Scalable distributed SCM" +HOMEPAGE="http://www.selenic.com/mercurial/" +SRC_URI="http://www.selenic.com/mercurial/release/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 ~hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd" +IUSE="bugzilla emacs gpg test zsh-completion" + +CDEPEND=">=dev-lang/python-2.3" +RDEPEND="${CDEPEND} + bugzilla? ( dev-python/mysql-python ) + gpg? ( app-crypt/gnupg ) + zsh-completion? ( app-shells/zsh )" +DEPEND="${CDEPEND} + emacs? ( virtual/emacs ) + test? ( app-arch/unzip + dev-python/pygments )" + +PYTHON_MODNAME="${PN} hgext" +SITEFILE="70${PN}-gentoo.el" + +src_compile() { + filter-flags -ftracer -ftree-vectorize + + distutils_src_compile + + if use emacs; then + cd "${S}"/contrib + elisp-compile mercurial.el || die "elisp-compile failed!" + fi + + rm -rf contrib/{win32,macosx} +} + +src_install() { + distutils_src_install + + dobashcompletion contrib/bash_completion ${PN} + + if use zsh-completion ; then + insinto /usr/share/zsh/site-functions + newins contrib/zsh_completion _hg + fi + + rm -f doc/*.?.txt + dodoc CONTRIBUTORS PKG-INFO README doc/*.txt + cp hgweb*.cgi "${D}"/usr/share/doc/${PF}/ + + dobin contrib/hgk + dobin contrib/hg-relink + dobin contrib/hg-ssh + + rm -f contrib/hgk contrib/hg-relink contrib/hg-ssh + + rm -f contrib/bash_completion + cp -r contrib "${D}"/usr/share/doc/${PF}/ + doman doc/*.? + + cat > "${T}/80mercurial" <<-EOF +HG=/usr/bin/hg +EOF + doenvd "${T}/80mercurial" + + if use emacs; then + elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!" + elisp-site-file-install "${FILESDIR}"/${SITEFILE} + fi +} + +src_test() { + local testdir="${T}/tests" + mkdir -p -m1777 "${testdir}" || die + cd "${S}/tests/" + rm -f *svn* # Subversion tests fail with 1.5 + rm -f test-convert-baz* # GNU Arch baz + rm -f test-convert-cvs* # CVS + rm -f test-convert-darcs* # Darcs + rm -f test-convert-git* # git + rm -f test-convert-mtn* # monotone + rm -f test-convert-tla* # GNU Arch tla + rm -f test-doctest* # doctest always fails with python 2.5.x + if ! has userpriv ${FEATURES}; then + einfo "Removing tests which require user privileges to succeed" + rm -f test-command-template # Test is broken when run as root + rm -f test-convert # Test is broken when run as root + rm -f test-lock-badness # Test is broken when run as root + rm -f test-permissions # Test is broken when run as root + rm -f test-pull-permission # Test is broken when run as root + fi + einfo "Running Mercurial tests ..." + python run-tests.py --tmpdir="${testdir}" || die "test failed" +} + +pkg_postinst() { + distutils_pkg_postinst + use emacs && elisp-site-regen + bash-completion_pkg_postinst + + elog "If you want to convert repositories from other tools using convert" + elog "extension please install correct tool:" + elog " dev-util/cvs" + elog " dev-util/darcs" + elog " dev-util/git" + elog " dev-util/monotone" + elog " dev-util/subversion" +} + +pkg_postrm() { + distutils_pkg_postrm + use emacs && elisp-site-regen +}
--- a/mail-client/alpine/Manifest Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -DIST all.patch.gz 170342 RMD160 81647cc792f26da49ef6c5263ff0a5bc55e89d07 SHA1 c8a0daa6b98020f8fc21a68f99e87cc90711aee6 SHA256 d6908fcb25f18f42906c1793b741390f88b48adf5764ba33848f9b4a5018ead0 -DIST alpine-2.00.tar.bz2 5222673 RMD160 9e67704b23b3973d8b878e65ad9e6f5026c10d13 SHA1 dcbd3c5419954f484ccf706feaba31ce48cdebc4 SHA256 c85db8405af90375ba2440c85b7952d80996154e9916b83acca558dc82e0a2a6 -EBUILD alpine-2.00.ebuild 4053 RMD160 bc7833df191592dc23323336b91cb14608b91861 SHA1 5a86fcd5cde05c2cca15b7a2f4b0c166282f67eb SHA256 51e88fb32ac03764852fe1d2183c2efacc210b704346bcdf65f72cb1877f8021
--- a/mail-client/alpine/alpine-2.00.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit eutils flag-o-matic - -DESCRIPTION="alpine is the successor of the famous mail and news reader pine" -HOMEPAGE="http://www.washington.edu/alpine/ http://staff.washington.edu/chappa/alpine/" -SRC_URI="ftp://ftp.cac.washington.edu/alpine/${P}.tar.bz2 - chappa? ( http://staff.washington.edu/chappa/alpine/patches/${P}/all.patch.gz )" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~x86-fbsd" -IUSE="chappa doc ipv6 kerberos ldap nls onlyalpine passfile smime spell ssl threads topal userland_BSD" - -DEPEND="virtual/pam - >=sys-libs/ncurses-5.1 - ssl? ( dev-libs/openssl ) - ldap? ( net-nds/openldap ) - kerberos? ( app-crypt/mit-krb5 ) - spell? ( app-text/aspell ) - topal? ( >=mail-client/topal-62 )" -RDEPEND="${DEPEND} - app-misc/mime-types - !onlyalpine? ( !app-editors/pico ) - !onlyalpine? ( !mail-client/pine ) - !<=net-mail/uw-imap-2004g" - -maildir_warn() { - elog - elog "This build of ${PN} has Maildir support built in as" - elog "part of the chappa-all patch." - elog - elog "If you have a maildir at ~/Maildir it will be your" - elog "default INBOX. The path may be changed with the" - elog "\"maildir-location\" setting in alpine." - elog - elog "To use /var/spool/mail INBOX again, set" - elog "\"disable-these-drivers=md\" in your .pinerc file." - elog - elog "Alternately, you might want to read following webpage, which explains how to" - elog "use multiple mailboxes simultaneously:" - elog - elog "http://www.math.washington.edu/~chappa/pine/pine-info/collections/incoming-folders/" - elog -} - -src_unpack() { - unpack ${A} - use chappa && epatch "${WORKDIR}"/all.patch - # topal needs updating for alpine 2.00 - #use topal && epatch /usr/share/topal/patches/${P}.patch - use topal && die "topal needs updating for ${P}. Please disable it for now." -} - -src_compile() { - local myconf="--without-tcl - --with-system-pinerc=/etc/pine.conf - --with-system-fixed-pinerc=/etc/pine.conf.fixed - --with-ssl-certs-dir=/etc/ssl/certs" - - use ssl || myconf="${myconf} --without-ssl" - use ldap || myconf="${myconf} --without-ldap" - use passfile && myconf="${myconf} --with-passfile=.pinepwd" - use kerberos || myconf="${myconf} --without-krb5" - use threads || myconf="${myconf} --without-pthread" - use spell && myconf="${myconf} --with-interactive-spellcheck=/usr/bin/aspell" - use nls || myconf="${myconf} --disable-nls" - use ipv6 || myconf="${myconf} --without-ipv6" - use smime || myconf="${myconf} --without-smime" - - # fixme - # --with-system-mail-directory=DIR? - - # fixme - # --as-needed breaks linking of c-client for executables - # filter-ldflags --as-needed does not work for "-Wl,-O1,--as-needed,-z,now" ?? - LDFLAGS=`echo $LDFLAGS | sed s/--as-needed//g | sed s/,,/,/g` - econf ${myconf} LDFLAGS="$LDFLAGS" || die "configure problem" - - if use userland_BSD; then - make || die "make failed" - else - emake || die "emake failed" - fi -} - -src_install() { - if use onlyalpine; then - dobin alpine/alpine - doman doc/alpine.1 - else - if use userland_BSD; then - make DESTDIR="${D}" install - else - emake DESTDIR="${D}" install - fi - - doman doc/rpdump.1 doc/rpload.1 - fi - - dodoc NOTICE - if use chappa; then - dodoc README.maildir - fi - - if use doc; then - dodoc README doc/brochure.txt doc/tech-notes.txt - docinto imap - dodoc imap/docs/*.txt imap/docs/CONFIG imap/docs/RELNOTES - - docinto imap/rfc - dodoc imap/docs/rfc/*.txt - - docinto html/tech-notes - dohtml -r doc/tech-notes/ - fi -} - -pkg_postinst() { - use chappa && maildir_warn - if use spell; then - elog - elog "In order to use spell checking" - elog " emerge app-dicts/aspell-\<your_langs\>" - elog "and setup alpine with:" - elog " Speller = /usr/bin/aspell -c" - elog - fi - if use topal; then - elog - elog "In order to use gpg with topal" - elog " read /usr/doc/topal/README.txt" - elog - fi - if use passfile ; then - elog - elog "${PN} will cache passwords between connections." - elog "File ~/.pinepw will be used for this." - elog - fi -}
--- a/net-fs/samba/Manifest Thu May 28 10:32:12 2009 +0200 +++ b/net-fs/samba/Manifest Thu Jul 02 14:12:03 2009 +0200 @@ -11,6 +11,6 @@ AUX samba-conf 1291 RMD160 326fb4beee8105d839d23e37f4989d7e332c996b SHA1 af7cd695f212d7ec022df05ba2f821a8f9878ab2 SHA256 dfaf474c3cbfa3d3b26d1531c6f5913739d5815c4b8083063934ee4fd6b38861 AUX samba-init 1133 RMD160 77a084e8f78665af0233f19dc9c4a49693360da1 SHA1 09d7f1d676856289b61e890396a9976e2ccc794a SHA256 3b41d16daf02f9a1ab12e62c4c915f58e7801c07be48e2a94086eb288bb86aad AUX samba-xinetd 286 RMD160 c90bd8518082eb4c182d5f7bd223a76f8e3c7fab SHA1 b250c5ca539187d8b481bcfb6ea3a915d7e8b26b SHA256 964d06dc33beff38978a8f03cd12b05c33d8258ed73aa9ffbf137fe226de25b8 -DIST samba-3.3.1.tar.gz 26057285 RMD160 3b75ef91440b79b649aef66670e5b23a94428590 SHA1 add05aad5bff976d3d25fc455e91c5f8539107a1 SHA256 d2bd8fdd72026d26481827baa35b8311d7531753b87b6086b4d7a3dcdb42e170 -EBUILD samba-3.3.1.ebuild 7736 RMD160 7872a31da441d4a93363bfc3a4f7cf2ec2a69379 SHA1 9e825a80db3989bf09d2bdbb177f7b5eae51c415 SHA256 9f3a573f1f6ea84d4d21276bd3631cfe04e635467cbc98a5dc9acc2e3a503328 +DIST samba-3.3.6.tar.gz 26097470 RMD160 a4759d23e3e264dcb5902b36794d2102aab2f494 SHA1 e6dea0bc938bd74e593a78c23afb55574edfba9a SHA256 da66e05f87ce6540ef709fbd347a706bc8e3b69cfab568ebf58bfe2e9ed44263 +EBUILD samba-3.3.6.ebuild 7593 RMD160 b7bdd2cf043878df2b4392391f4f47ebf1bb4b48 SHA1 b15a0ef7b58c2f20863ca455f8bfa36ee0de193d SHA256 e9391c54879e636afdff5b505d8a183dbf31169ce3151e6a62474afd5d9048be MISC metadata.xml 950 RMD160 4947143536f9776d7dd7f7d6552d624e1f2ac14d SHA1 ef8a8c0c5cd229c88b1f93042ebfbdafaf45deb2 SHA256 b040a13821dbd3f1214b96ed5a808188ef0996161b0ce0cc11de8d8397de960f
--- a/net-fs/samba/samba-3.3.1.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.2.0_rc2.ebuild,v 1.1 2008/06/12 12:10:25 dev-zero Exp $ - -inherit eutils pam multilib versionator confutils - -MY_P=${PN}-${PV/_/} - -DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${MY_P}.tar.gz" -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE_LINGUAS="linguas_ja linguas_pl" -IUSE="${IUSE_LINGUAS} acl ads async automount caps cups doc examples ipv6 kernel_linux ldap fam - pam quotas readline selinux swat syslog winbind" - -RDEPEND="dev-libs/popt - dev-libs/iniparser - virtual/libiconv - acl? ( kernel_linux? ( sys-apps/acl ) ) - cups? ( net-print/cups ) - ipv6? ( sys-apps/xinetd ) - ads? ( virtual/krb5 sys-fs/e2fsprogs ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam ) - readline? ( sys-libs/readline ) - selinux? ( sec-policy/selinux-samba ) - swat? ( sys-apps/xinetd ) - syslog? ( virtual/logger ) - fam? ( virtual/fam ) - caps? ( sys-libs/libcap )" -DEPEND="${RDEPEND}" - -S="${WORKDIR}/${MY_P}" -CONFDIR="${FILESDIR}/config-3.3" -PRIVATE_DST=/var/lib/samba/private - -# Tests are currently broken due to hardcoded paths (due to --with-fhs) -# The problem is that --without-fhs lets samba use lockdir (which can be changed in smb.conf) -# which is wrong as well. -RESTRICT="test" - -pkg_setup() { - confutils_use_depend_all ads ldap -} - -src_unpack() { - unpack ${A} - cd "${S}/source" - - # Ok, agreed, this is ugly. But it avoids a patch we - # need for every samba version and we don't need autotools - sed -i \ - -e 's|"lib32" ||' \ - -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ - configure || die "sed failed" - - rm "${S}/docs/manpages"/{mount,umount}.cifs.8 - - sed -i \ - -e 's|tdbsam|tdbsam:${PRIVATEDIR}/passdb.tdb|' \ - "${S}/source/script/tests/selftest.sh" || die "sed failed" -} - -src_compile() { - cd "${S}/source" - - local myconf - local mylangs - local mymod_shared - - mylangs="--with-manpages-langs=en" - use linguas_ja && mylangs="${mylangs},ja" - use linguas_pl && mylangs="${mylangs},pl" - - use winbind && mymod_shared="--with-shared-modules=idmap_rid" - if use ldap ; then - myconf="${myconf} $(use_with ads)" - use winbind && mymod_shared="${mymod_shared},idmap_ad" - fi - - [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" - use hppa && myconf="${myconf} --disable-pie" - - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # Otherwise we get the whole swat stuff installed - if ! use swat ; then - sed -i \ - -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ - Makefile.in || die "sed failed" - fi - - econf \ - --with-fhs \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/$(get_libdir)/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-piddir=/var/run/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-privatedir=${PRIVATE_DST} \ - --with-libsmbclient \ - --without-spinlocks \ - --enable-socket-wrapper \ - --enable-nss-wrapper \ - --with-cifsmount=no \ - $(use_with acl acl-support) \ - $(use_with async aio-support) \ - $(use_with automount) \ - $(use_enable cups) \ - $(use_enable fam) \ - $(use_with ads krb5) \ - $(use_with ads dnsupdate) \ - $(use_with ldap) \ - $(use_with pam) $(use_with pam pam_smbpass) \ - $(use_with quotas) $(use_with quotas sys-quotas) \ - $(use_with readline) \ - $(use_with syslog) \ - $(use_with winbind) \ - ${myconf} ${mylangs} ${mymod_shared} || die "econf failed" - - emake proto || die "emake proto failed" - emake everything || die "emake everything failed" - -} - -src_test() { - cd "${S}/source" - emake test || die "tests failed" -} - -src_install() { - cd "${S}/source" - - emake DESTDIR="${D}" install-everything || die "emake install-everything failed" - - # Extra rpctorture progs - local extra_bins="rpctorture" - for i in ${extra_bins} ; do - [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" - done - - # remove .old stuff from /usr/bin: - rm -f "${D}"/usr/bin/*.old - - # Removing executable bits from header-files - fperms 644 /usr/include/libsmbclient.h - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - dolib.so nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - # make the smb backend symlink for cups printing support (bug #133133) - if use cups ; then - dodir $(cups-config --serverbin)/backend - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - cd "${S}/source" - - # General config files - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example - - newpamd "${CONFDIR}/samba.pam" samba - use winbind && dopamd "${CONFDIR}/system-auth-winbind" - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - else - rm -f "${D}/usr/sbin/swat" - rm -f "${D}/usr/share/man/man8/swat.8" - fi - - newinitd "${FILESDIR}/samba-init" samba - newconfd "${FILESDIR}/samba-conf" samba - - if use ldap ; then - insinto /etc/openldap/schema - doins "${S}/examples/LDAP/samba.schema" - fi - - if use ipv6 ; then - insinto /etc/xinetd.d - newins "${FILESDIR}/samba-xinetd" smb - fi - - # dirs - diropts -m0700 ; keepdir "${PRIVATE_DST}" - diropts -m1777 ; keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{log,run,cache}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} - - # docs - dodoc "${FILESDIR}/README.gentoo" - dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt} - dodoc "${CONFDIR}/nsswitch.conf-wins" - use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" - - if use examples ; then - insinto /usr/share/doc/${PF} - doins -r "${S}/examples/" - find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 - find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 - fi - - if ! use doc ; then - if ! use swat ; then - rm -rf "${D}/usr/share/doc/${PF}/swat" - else - rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} - rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" - fi - fi - -} - -pkg_preinst() { - local PRIVATE_SRC=/etc/samba/private - if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \ - && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then - ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" - mkdir -p "${D}/${PRIVATE_DST}" - cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/" - eend $? - fi - - if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then - touch "${D}/etc/samba/smb.conf" - fi -} - -pkg_postinst() { - if use swat ; then - einfo "swat must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/swat configuration" - fi - - if use ipv6 ; then - einfo "ipv6 support must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/smb configuration" - fi - - elog "It is possible to start/stop daemons separately:" - elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" - elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" - elog " the daemons configured in /etc/conf.d/samba" - - elog "The mount/umount.cifs helper applications are not included anymore." - elog "Please install net-fs/mount-cifs instead." - - ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to" - ewarn "restart your clients to clear any cached information about the server." - ewarn "Otherwise they might not be able to connect to the volumes." -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/net-fs/samba/samba-3.3.6.ebuild Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,265 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.2.0_rc2.ebuild,v 1.1 2008/06/12 12:10:25 dev-zero Exp $ + +inherit eutils pam multilib versionator confutils + +MY_P=${PN}-${PV/_/} + +DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" +HOMEPAGE="http://www.samba.org/" +SRC_URI="mirror://samba/${MY_P}.tar.gz" +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE_LINGUAS="linguas_ja linguas_pl" +IUSE="${IUSE_LINGUAS} acl ads async automount caps cups doc examples ipv6 kernel_linux ldap fam + pam quotas readline selinux swat syslog winbind" + +RDEPEND="dev-libs/popt + dev-libs/iniparser + virtual/libiconv + acl? ( kernel_linux? ( sys-apps/acl ) ) + cups? ( net-print/cups ) + ipv6? ( sys-apps/xinetd ) + ads? ( virtual/krb5 sys-fs/e2fsprogs ) + ldap? ( net-nds/openldap ) + pam? ( virtual/pam ) + readline? ( sys-libs/readline ) + selinux? ( sec-policy/selinux-samba ) + swat? ( sys-apps/xinetd ) + syslog? ( virtual/logger ) + fam? ( virtual/fam ) + caps? ( sys-libs/libcap )" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${MY_P}" +CONFDIR="${FILESDIR}/config-3.3" +PRIVATE_DST=/var/lib/samba/private + +# Tests are currently broken due to hardcoded paths (due to --with-fhs) +# The problem is that --without-fhs lets samba use lockdir (which can be changed in smb.conf) +# which is wrong as well. +RESTRICT="test" + +pkg_setup() { + confutils_use_depend_all ads ldap +} + +src_unpack() { + unpack ${A} + cd "${S}/source" + + # Ok, agreed, this is ugly. But it avoids a patch we + # need for every samba version and we don't need autotools + sed -i \ + -e 's|"lib32" ||' \ + -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ + configure || die "sed failed" + + rm "${S}/docs/manpages"/{mount,umount}.cifs.8 + + sed -i \ + -e 's|tdbsam|tdbsam:${PRIVATEDIR}/passdb.tdb|' \ + "${S}/source/script/tests/selftest.sh" || die "sed failed" +} + +src_compile() { + cd "${S}/source" + + local myconf + local mylangs + local mymod_shared + + use winbind && mymod_shared="--with-shared-modules=idmap_rid" + if use ldap ; then + myconf="${myconf} $(use_with ads)" + use winbind && mymod_shared="${mymod_shared},idmap_ad" + fi + + [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" + use hppa && myconf="${myconf} --disable-pie" + + use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no + + # Otherwise we get the whole swat stuff installed + if ! use swat ; then + sed -i \ + -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ + Makefile.in || die "sed failed" + fi + + econf \ + --with-fhs \ + --sysconfdir=/etc/samba \ + --localstatedir=/var \ + --with-configdir=/etc/samba \ + --with-modulesdir=/usr/$(get_libdir)/samba \ + --with-pammodulesdir=$(getpam_mod_dir) \ + --with-swatdir=/usr/share/doc/${PF}/swat \ + --with-piddir=/var/run/samba \ + --with-lockdir=/var/cache/samba \ + --with-logfilebase=/var/log/samba \ + --with-privatedir=${PRIVATE_DST} \ + --with-libsmbclient \ + --enable-socket-wrapper \ + --enable-nss-wrapper \ + --with-cifsmount=no \ + $(use_with acl acl-support) \ + $(use_with async aio-support) \ + $(use_with automount) \ + $(use_enable cups) \ + $(use_enable fam) \ + $(use_with ads krb5) \ + $(use_with ads dnsupdate) \ + $(use_with ldap) \ + $(use_with pam) $(use_with pam pam_smbpass) \ + $(use_with quotas) $(use_with quotas sys-quotas) \ + $(use_with readline) \ + $(use_with syslog) \ + $(use_with winbind) \ + ${myconf} ${mylangs} ${mymod_shared} || die "econf failed" + + emake proto || die "emake proto failed" + emake everything || die "emake everything failed" + +} + +src_test() { + cd "${S}/source" + emake test || die "tests failed" +} + +src_install() { + cd "${S}/source" + + emake DESTDIR="${D}" install-everything || die "emake install-everything failed" + + # Extra rpctorture progs + local extra_bins="rpctorture" + for i in ${extra_bins} ; do + [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" + done + + # remove .old stuff from /usr/bin: + rm -f "${D}"/usr/bin/*.old + + # Removing executable bits from header-files + fperms 644 /usr/include/libsmbclient.h + + # Nsswitch extensions. Make link for wins and winbind resolvers + if use winbind ; then + dolib.so nsswitch/libnss_wins.so + dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 + dolib.so nsswitch/libnss_winbind.so + dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 + fi + + # make the smb backend symlink for cups printing support (bug #133133) + if use cups ; then + dodir $(cups-config --serverbin)/backend + dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb + fi + + cd "${S}/source" + + # General config files + insinto /etc/samba + doins "${CONFDIR}"/{smbusers,lmhosts} + newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example + + newpamd "${CONFDIR}/samba.pam" samba + use winbind && dopamd "${CONFDIR}/system-auth-winbind" + if use swat ; then + insinto /etc/xinetd.d + newins "${CONFDIR}/swat.xinetd" swat + else + rm -f "${D}/usr/sbin/swat" + rm -f "${D}/usr/share/man/man8/swat.8" + fi + + newinitd "${FILESDIR}/samba-init" samba + newconfd "${FILESDIR}/samba-conf" samba + + if use ldap ; then + insinto /etc/openldap/schema + doins "${S}/examples/LDAP/samba.schema" + fi + + if use ipv6 ; then + insinto /etc/xinetd.d + newins "${FILESDIR}/samba-xinetd" smb + fi + + # dirs + diropts -m0700 ; keepdir "${PRIVATE_DST}" + diropts -m1777 ; keepdir /var/spool/samba + + diropts -m0755 + keepdir /var/{log,run,cache}/samba + keepdir /var/lib/samba/{netlogon,profiles} + keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} + keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} + + # docs + dodoc "${FILESDIR}/README.gentoo" + dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt} + dodoc "${CONFDIR}/nsswitch.conf-wins" + use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" + + if use examples ; then + insinto /usr/share/doc/${PF} + doins -r "${S}/examples/" + find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 + find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 + fi + + if ! use doc ; then + if ! use swat ; then + rm -rf "${D}/usr/share/doc/${PF}/swat" + else + rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} + rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" + fi + fi + +} + +pkg_preinst() { + local PRIVATE_SRC=/etc/samba/private + if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \ + && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then + ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" + mkdir -p "${D}/${PRIVATE_DST}" + cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/" + eend $? + fi + + if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then + touch "${D}/etc/samba/smb.conf" + fi +} + +pkg_postinst() { + if use swat ; then + einfo "swat must be enabled by xinetd:" + einfo " change the /etc/xinetd.d/swat configuration" + fi + + if use ipv6 ; then + einfo "ipv6 support must be enabled by xinetd:" + einfo " change the /etc/xinetd.d/smb configuration" + fi + + elog "It is possible to start/stop daemons separately:" + elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" + elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" + elog " the daemons configured in /etc/conf.d/samba" + + elog "The mount/umount.cifs helper applications are not included anymore." + elog "Please install net-fs/mount-cifs instead." + + ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to" + ewarn "restart your clients to clear any cached information about the server." + ewarn "Otherwise they might not be able to connect to the volumes." +}
--- a/net-mail/up-imapproxy/Manifest Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -AUX imapproxy.rc6 505 RMD160 f217612eb25c3dab81ce6d206f2a0681169db18d SHA1 deaa2f55e90fe57a97ac1032eba542ec72e5840d SHA256 b0d2369d4f311d37834145887e358c98e65451505985e2457dae9609f72579dd -DIST up-imapproxy-1.2.6.tar.gz 134745 RMD160 4613acd3fcacdc40905ec8692afd3a4e9563258c SHA1 75f497e3fda44ff1526c46ac93e5c863bf6e0963 SHA256 2f5e841bc6c84799f890d24b984726efb7cce26c2ad95923864ddf0353fa3b01 -EBUILD up-imapproxy-1.2.6.ebuild 1254 RMD160 7c2265c6088dd188b2c1a445597e87a2d7291166 SHA1 2a355c6750b6f9fc21c8bfbb970d44e34151bda2 SHA256 8524ff07543195adb9f2dbb00227975f646ef209259db2e5a8ddeacae05a018b
--- a/net-mail/up-imapproxy/files/imapproxy.rc6 Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-mail/up-imapproxy/files/imapproxy.rc6,v 1.2 2004/07/14 23:52:37 agriffis Exp $ - -depend() { - use logger - need net -} - -start() { - ebegin "Starting imapproxy" - start-stop-daemon --start --quiet --exec /usr/sbin/imapproxyd - eend $? -} - -stop() { - ebegin "Stopping imapproxy" - start-stop-daemon --stop --quiet --exec /usr/sbin/imapproxyd - eend $? -}
--- a/net-mail/up-imapproxy/up-imapproxy-1.2.6.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-mail/up-imapproxy/up-imapproxy-1.2.5_rc2.ebuild,v 1.3 2007/02/06 13:08:54 blubb Exp $ - -inherit eutils - -DESCRIPTION="Proxy IMAP transactions between an IMAP client and an IMAP server." -HOMEPAGE="http://www.imapproxy.org/" -SRC_URI="http://www.imapproxy.org/downloads/${P/_/}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ~ppc x86" -IUSE="kerberos ssl tcpd" - -DEPEND=">=sys-libs/ncurses-5.1 - kerberos? ( virtual/krb5 ) - ssl? ( >=dev-libs/openssl-0.9.6 ) - tcpd? ( >=sys-apps/tcp-wrappers-7.6 )" - -S="${WORKDIR}/${P/_/}" -src_unpack() { - unpack ${A} && cd "${S}" - sed -i -e 's:in\.imapproxyd:imapproxyd:g' \ - README Makefile.in include/imapproxy.h || die "sed failed" -} - -src_compile() { - econf \ - $(use_with kerberos krb5) \ - $(use_with ssl openssl) \ - $(use_with tcpd libwrap) \ - || die "econf failed" - - emake || die "emake failed" -} - -src_install() { - dosbin bin/imapproxyd bin/pimpstat || die "dosbin failed" - - insinto /etc - doins scripts/imapproxy.conf || die "doins failed" - - newinitd "${FILESDIR}"/imapproxy.rc6 imapproxy || die "initd failed" - - dodoc ChangeLog README README.known_issues README.ssl -}
--- a/net-misc/rabbitmq-server/Manifest Thu May 28 10:32:12 2009 +0200 +++ b/net-misc/rabbitmq-server/Manifest Thu Jul 02 14:12:03 2009 +0200 @@ -1,2 +1,3 @@ -DIST rabbitmq-server-generic-unix-1.5.3.tar.gz 356427 RMD160 e1d200d55beccbd543378b3ed85f5bfd0d0791b1 SHA1 3b9819af6c689a31b114f36df2ce8ab51e9fb64a SHA256 08980363a52eccb3f4515ad0afd0b0ae3e3f64b28e3df0a0f7702c2979470ea4 -EBUILD rabbitmq-server-1.5.3.ebuild 1051 RMD160 35f9549863af11a127f096783a57dbc0ff3421eb SHA1 166b02e0a531303ce68d7c7b761374c27b831d8f SHA256 794bca4f2c1926e3913e69326e914a783d914816cd21f531b9c870b7ccfdd89f +AUX rabbitmq-server.init 434 RMD160 11a7851c395e488bb03a7a002d62dae405d4f67f SHA1 c1030740427f95eedba3fafbb8a038ea69842607 SHA256 d3f8fb55bbab4506567a9dbc995194720ed63072c82af27bbb6831541a0fb89c +DIST rabbitmq-server-1.6.0.tar.gz 130616 RMD160 d6c9de4e1fb48c6ceb1cb5d717ca2afb5e3266fe SHA1 1834c670d076fa9878223aacaa35a5a6528f1d86 SHA256 0a6e0f6b41548906b07f51be1651e8c05b3621f1c238e7969ef1dc40c47a7a0a +EBUILD rabbitmq-server-1.6.0.ebuild 1664 RMD160 c5d95edef457441d79702f3a29e4c6493a77078b SHA1 17188dc82f1b23645f5092960519dbc86848589c SHA256 ffcba324a2f47c2847f5e11bd12cd536b52782f9ac7e9238e07a3944cb53c43b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/net-misc/rabbitmq-server/files/rabbitmq-server.init Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,22 @@ +#!/sbin/runscript +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/rabbitmq-server/files/rabbitmq-server.init,v 1.1 2009/04/19 12:42:55 caleb Exp $ + +depend() { + need net + use dns +} + +start() { + ebegin "Starting RabbitMQ..." + rabbitmq-server -detached + eend $? +} + +stop() { + ebegin "Stopping RabbitMQ..." + rabbitmqctl stop + eend $? +} +
--- a/net-misc/rabbitmq-server/rabbitmq-server-1.5.3.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit eutils - -DESCRIPTION="RabbitMQ is a high-performance AMQP-compliant message broker written in Erlang." -HOMEPAGE="http://www.rabbitmq.com/" -SRC_URI="http://www.rabbitmq.com/releases/rabbitmq-server/v${PV}/rabbitmq-server-generic-unix-${PV}.tar.gz" -LICENSE="MPL" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="" - -# Q: is RDEPEND-only sufficient for a binary package, since we don't compile? -DEPEND="dev-lang/erlang" -RDEPEND="${DEPEND}" - -# grr: the packaged directory contains an underscore -MODNAME="rabbitmq_server-${PV}" -S="${WORKDIR}/${MODNAME}" - -src_install() { - # erlang module - local targetdir="/usr/$(get_libdir)/erlang/lib/${MODNAME}" - dodir "${targetdir}" - cp -dpR ebin include "${D}/${targetdir}" - - # scripts - dosbin sbin/* - - # docs - dodoc INSTALL LICENSE LICENSE-MPL-RabbitMQ - - # TODO: - # config to set env vars as per INSTALL? - # set LOGDIR to /var/log/rabbitmq.log - # run as different user? -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/net-misc/rabbitmq-server/rabbitmq-server-1.6.0.ebuild Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,56 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/rabbitmq-server/rabbitmq-server-1.5.4-r1.ebuild,v 1.2 2009/04/23 03:37:16 mr_bones_ Exp $ + +inherit eutils + +DESCRIPTION="RabbitMQ is a high-performance AMQP-compliant message broker written in Erlang." +HOMEPAGE="http://www.rabbitmq.com/" +SRC_URI="http://www.rabbitmq.com/releases/rabbitmq-server/v${PV}/rabbitmq-server-${PV}.tar.gz" +LICENSE="MPL-1.1" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +# Q: is RDEPEND-only sufficient for a binary package, since we don't compile? +DEPEND="dev-lang/erlang" +RDEPEND="${DEPEND}" + +src_install() { + # erlang module + local targetdir="/usr/$(get_libdir)/erlang/lib/${P}" + + einfo "Correcting additional Erlang code path in scripts" + sed -i -e "s:\`dirname \$0\`\/..\/ebin:${targetdir}:g" scripts/* || die "sed failed" + + einfo "Installing Erlang module to ${targetdir}" + dodir "${targetdir}" + cp -dpR ebin include "${D}/${targetdir}" + + einfo "Installing server scripts to /usr/sbin" + # Install server scripts to sbin + dosbin scripts/rabbitmq-multi scripts/rabbitmq-server + + einfo "Installing rabbitmqctl to /usr/bin" + # Install control script to bin + dobin scripts/rabbitmqctl + + # Docs + dodoc README + + # create the directory where our log file will go. + diropts -m 0770 -o rabbitmq -g rabbitmq + keepdir /var/log/rabbitmq + + # create the mnesia directory + diropts -m 0770 -o rabbitmq -g rabbitmq + dodir /var/lib/rabbitmq/mnesia + + # Install the init script + newinitd "${FILESDIR}"/rabbitmq-server.init rabbitmq +} + +pkg_setup() { + enewgroup rabbitmq + enewuser rabbitmq -1 -1 -1 rabbitmq +}
--- a/net-misc/zmq/Manifest Thu May 28 10:32:12 2009 +0200 +++ b/net-misc/zmq/Manifest Thu Jul 02 14:12:03 2009 +0200 @@ -1,2 +1,2 @@ -DIST zmq-0.4.tar.gz 482494 RMD160 7760d330fb8244b5bce80210dd284d10844ca44f SHA1 ddf97fe85dfc040a3e4ec751f0ce5a29b3f4aea1 SHA256 ca74a6779cd3fd9f3ee84f48e69e680588ee7dacf2bd65273a16952c78228c0d -EBUILD zmq-0.4.ebuild 1042 RMD160 f9eae30c1f712baa77a8849fad3069692a33f00b SHA1 ddedbd9c7c2c46c0945ce6d88f6b77f69b9e14ca SHA256 353f16d6e58d6e183ee3b13861636db89b916e4cd7ebb6974542af14878dfdb0 +DIST zmq-0.6.1.tar.gz 700331 RMD160 2de62f6ea0c38eb133157d39d13273ea988d5ca4 SHA1 b0f1edf1ea33adde5751c4b24359e9ebce40e554 SHA256 382f478e9806ac4d7b94244f6f7fc3697e53a17d779cc9db4e3f57dd41d6eab5 +EBUILD zmq-0.6.1.ebuild 1083 RMD160 e2289a32e90db7832116834999fd3ba2621bbec5 SHA1 8854d35583d81f38f935ff52e1cfbc243e39332a SHA256 97a1caf1389ff457cd60f909dd4cf7cd44973d992938764bd7b55be08d03cc02
--- a/net-misc/zmq/zmq-0.4.ebuild Thu May 28 10:32:12 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit eutils - -DESCRIPTION="ZeroMQ is a brokerless messaging kernel with extremely high performance." -HOMEPAGE="http://www.zeromq.org/" -SRC_URI="http://www.zeromq.org/local--files/area:download/${P}.tar.gz" -LICENSE="LGPL-3" -SLOT="0" -KEYWORDS="~x86" -#IUSE="c examples java profile python" -#DEPEND="" -#RDEPEND="${DEPEND}" - -src_compile() { - -# TODO: -# --with-perf build performance tests [default=no] -# --with-camera build camera example [default=no] -# --with-exchange build exchange example [default=no] -# --with-chat build chatroom example [default=no] -# --with-c build c language binding [default=no] -# --with-python build Python language binding [default=no] -# --with-java build Java language binding [default=no] - - econf \ - emake || die "emake failed" -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/net-misc/zmq/zmq-0.6.1.ebuild Thu Jul 02 14:12:03 2009 +0200 @@ -0,0 +1,38 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils flag-o-matic + +DESCRIPTION="ZeroMQ is a brokerless messaging kernel with extremely high performance." +HOMEPAGE="http://www.zeromq.org/" +SRC_URI="http://www.zeromq.org/local--files/area:download/${P}.tar.gz" +LICENSE="LGPL-3" +SLOT="0" +KEYWORDS="~x86" +IUSE="amqp c examples java profile python ruby" +#DEPEND="" +#RDEPEND="${DEPEND}" + +src_compile() { + +# TODO: +# --with-perf build performance tests [default=no] +# --with-butterfly build butterfly example [default=no] +# --with-camera build camera example [default=no] +# --with-exchange build exchange example [default=no] +# --with-chat build chatroom example [default=no] +# --with-ruby build Ruby language binding [default=no] + + econf \ + $(use_with amqp) \ + $(use_with c) \ + $(use_with java) \ + $(use_with python) + + emake || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" +}