Sync with portage [Fri Oct 7 22:39:13 MSK 2016].

mhiretskiy 572
root 8 years ago
parent 94d52260ef
commit 7b337a54e5

@ -1,2 +1,3 @@
DIST collectd-5.5.2.tar.bz2 1800476 SHA256 017f3a4062187e594d8ab6af685655fb82a8a942dc574668e68242bdb8ba820f SHA512 9d311db4f3677b95e3a47c03af01bdf1127957f6fccb6c601455632d0ea3b39e3f4cd9a6f8f510083e208714bbb0da2e04aaa574a90b0ad6fe984506675475b3 WHIRLPOOL 98ed4fb29eec0ae660d3e1651380a3f17f7bf7f22e687633c4a44974bc84e49cf8de11fd6fea349bfe24809ac3c29a407459a1203b72bcf741e1587c6c0b1773
DIST collectd-5.6.0.tar.bz2 1818470 SHA256 f0ffbbd91fac3682bd324a74b9b4c9eabe781394b303b5cfd457c4cfbe748623 SHA512 5eecd7fe1619850b29e7853e0ab8f9eb7688d0fdf5687cf04930c75a94181c53d7dc0601a1dfa02417bdeb63cccf09b87acd7129e7f155b8d11147ec46982ed8 WHIRLPOOL 690e50f16318e9df39eac62010f8b0a57059356deeedd72505cc4a980876261a198edac095317f97b03913167dcfc49bf9f3b46986bbc3653628856e3a005111
DIST collectd-5.6.1.tar.bz2 1903962 SHA256 c30ff644f91407b4dc2d99787b99cc45ec00e538bd1cc269429d3c5e8a4aee2c SHA512 da25f1a9cbaf47533f5a4d2f5f78b966317d4f21865c5a714954ad9d7d02b4798a3e0471ce52199dc80e01dc2808376cb10a7e19c402aafc984bf595f09951a6 WHIRLPOOL 68ed2b27bbd48f5af5e29743dcd2871ab4c2904d5593bbb6f3e68129f318389e32e13b256d489ea7842b90c406974511c8f324383253c7b438e7b6a9d36d299d

@ -0,0 +1,491 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
PYTHON_COMPAT=( python{2_7,3_4,3_5} )
JAVA_PKG_OPT_USE="collectd_plugins_java"
inherit autotools fcaps flag-o-matic java-pkg-opt-2 linux-info multilib perl-functions python-single-r1 systemd user
DESCRIPTION="Collects system statistics and provides mechanisms to store the values"
HOMEPAGE="https://collectd.org/"
SRC_URI="${HOMEPAGE}/files/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="contrib debug java kernel_Darwin kernel_FreeBSD kernel_linux perl selinux static-libs udev xfs"
# The plugin lists have to follow here since they extend IUSE
# Plugins that don't build (e.g. dependencies not in Gentoo)
# apple_sensors: Requires libIOKit
# aquaero: Requires aerotools-ng/libaquaero5
# barometer: Requires libi2c (i2c_smbus_read_i2c_block_data)
# grpc: Requires libgrpc
# lpar: Requires libperfstat (AIX only)
# mic: Requires Intel Many Integrated Core Architecture API
# (part of Intel's Xeon Phi software)
# netapp: Requires libnetapp (http://communities.netapp.com/docs/DOC-1110)
# pf: Requires BSD packet filter
# pinba: Requires MySQL Pinba engine (http://pinba.org/)
# tape: Requires libkstat (Solaris only)
# write_mongodb: https://github.com/collectd/collectd/issues/492
# write_riemann: Requires riemann-c-client
# xmms: Requires libxmms (v1)
# zone: Solaris only...
COLLECTD_IMPOSSIBLE_PLUGINS="apple_sensors aquaero barometer grpc lpar mic
netapp pf pinba tape write_kafka write_mongodb write_riemann xmms
zone"
# Plugins that have been (compile) tested and can be enabled via COLLECTD_PLUGINS
COLLECTD_TESTED_PLUGINS="aggregation amqp apache apcups ascent battery bind
ceph cgroups chrony conntrack contextswitch cpu cpufreq cpusleep
csv curl curl_json curl_xml dbi df disk dns drbd email entropy
ethstat exec fhcount filecount fscache gmond gps hddtemp interface
ipc ipmi iptables ipvs irq java lua load logfile log_logstash lvm
madwifi match_empty_counter match_hashed match_regex match_timediff
match_value mbmon md memcachec memcached memory modbus mqtt
multimeter mysql netlink network network nfs nginx notify_desktop
notify_email notify_nagios ntpd numa nut olsrd onewire openldap
openvpn oracle perl ping postgresql powerdns processes protocols
python python redis routeros rrdcached rrdtool sensors serial
sigrok smart snmp statsd swap syslog table tail tail_csv
target_notification target_replace target_scale target_set tcpconns
teamspeak2 ted thermal threshold tokyotyrant turbostat unixsock
uptime users uuid varnish virt vmem vserver wireless write_graphite
write_http write_kafka write_log write_redis write_sensu write_tsdb
xencpu zfs_arc zookeeper"
COLLECTD_DISABLED_PLUGINS="${COLLECTD_IMPOSSIBLE_PLUGINS}"
COLLECTD_ALL_PLUGINS=${COLLECTD_TESTED_PLUGINS}
for plugin in ${COLLECTD_ALL_PLUGINS}; do
IUSE="${IUSE} collectd_plugins_${plugin}"
done
unset plugin
# Now come the dependencies.
COMMON_DEPEND="
dev-libs/libgcrypt:=
dev-libs/libltdl:0=
perl? ( dev-lang/perl:=[ithreads] )
udev? ( virtual/udev )
xfs? ( sys-fs/xfsprogs )
collectd_plugins_amqp? ( net-libs/rabbitmq-c )
collectd_plugins_apache? ( net-misc/curl:0= )
collectd_plugins_ascent? ( net-misc/curl:0= dev-libs/libxml2:2= )
collectd_plugins_bind? ( net-misc/curl:0= dev-libs/libxml2:2= )
collectd_plugins_ceph? ( dev-libs/yajl:= )
collectd_plugins_curl? ( net-misc/curl:0= )
collectd_plugins_curl_json? ( net-misc/curl:0= dev-libs/yajl:= )
collectd_plugins_curl_xml? ( net-misc/curl:0= dev-libs/libxml2:2= )
collectd_plugins_dbi? ( dev-db/libdbi )
collectd_plugins_dns? ( net-libs/libpcap )
collectd_plugins_gmond? ( sys-cluster/ganglia )
collectd_plugins_gps? ( sci-geosciences/gpsd )
collectd_plugins_ipmi? ( >=sys-libs/openipmi-2.0.16-r1 )
collectd_plugins_iptables? ( >=net-firewall/iptables-1.4.13:0= )
collectd_plugins_log_logstash? ( dev-libs/yajl:= )
collectd_plugins_lua? ( dev-lang/lua:0= )
collectd_plugins_lvm? ( sys-fs/lvm2 )
collectd_plugins_memcachec? ( dev-libs/libmemcached )
collectd_plugins_modbus? ( dev-libs/libmodbus )
collectd_plugins_mqtt? ( app-misc/mosquitto )
collectd_plugins_mysql? ( >=virtual/mysql-5.0 )
collectd_plugins_netlink? ( net-libs/libmnl )
collectd_plugins_nginx? ( net-misc/curl:0= )
collectd_plugins_notify_desktop? ( x11-libs/libnotify )
collectd_plugins_notify_email? ( net-libs/libesmtp )
collectd_plugins_nut? ( >=sys-power/nut-2.7.2-r2 )
collectd_plugins_openldap? ( net-nds/openldap )
collectd_plugins_onewire? ( >=sys-fs/owfs-3.1:= )
collectd_plugins_oracle? ( dev-db/oracle-instantclient-basic )
collectd_plugins_perl? ( dev-lang/perl:=[ithreads] )
collectd_plugins_ping? ( net-libs/liboping )
collectd_plugins_postgresql? ( dev-db/postgresql:= )
collectd_plugins_python? ( ${PYTHON_DEPS} )
collectd_plugins_redis? ( dev-libs/hiredis:= )
collectd_plugins_routeros? ( net-libs/librouteros )
collectd_plugins_rrdcached? ( net-analyzer/rrdtool:= )
collectd_plugins_rrdtool? ( net-analyzer/rrdtool:= )
collectd_plugins_sensors? ( sys-apps/lm_sensors )
collectd_plugins_sigrok? ( <sci-libs/libsigrok-0.4 dev-libs/glib:2 )
collectd_plugins_smart? ( dev-libs/libatasmart )
collectd_plugins_snmp? ( net-analyzer/net-snmp )
collectd_plugins_tokyotyrant? ( net-misc/tokyotyrant )
collectd_plugins_varnish? ( www-servers/varnish )
collectd_plugins_virt? ( app-emulation/libvirt:= dev-libs/libxml2:2= )
collectd_plugins_write_http? ( net-misc/curl:0= dev-libs/yajl:= )
collectd_plugins_write_kafka? ( >=dev-libs/librdkafka-0.9.0.99:= dev-libs/yajl:= )
collectd_plugins_write_redis? ( dev-libs/hiredis:= )
collectd_plugins_xencpu? ( app-emulation/xen-tools )
kernel_FreeBSD? (
collectd_plugins_disk? ( sys-libs/libstatgrab:= )
collectd_plugins_interface? ( sys-libs/libstatgrab:= )
collectd_plugins_load? ( sys-libs/libstatgrab:= )
collectd_plugins_memory? ( sys-libs/libstatgrab:= )
collectd_plugins_swap? ( sys-libs/libstatgrab:= )
collectd_plugins_users? ( sys-libs/libstatgrab:= )
)"
# Enforcing <=sys-kernel/linux-headers-4.4 due to #577846
DEPEND="${COMMON_DEPEND}
collectd_plugins_iptables? ( <=sys-kernel/linux-headers-4.4 )
collectd_plugins_java? ( >=virtual/jdk-1.6 )
virtual/pkgconfig"
RDEPEND="${COMMON_DEPEND}
collectd_plugins_java? ( >=virtual/jre-1.6 )
collectd_plugins_syslog? ( virtual/logger )
selinux? ( sec-policy/selinux-collectd )"
REQUIRED_USE="
collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} )
collectd_plugins_smart? ( udev )"
PATCHES=(
"${FILESDIR}"/${PN}-5.6.0-gentoo.patch
)
# @FUNCTION: collectd_plugin_kernel_linux
# @DESCRIPTION:
# USAGE: <plugin name> <kernel_options> <severity>
# kernel_options is a list of kernel configurations options; the check tests whether at least
# one of them is enabled. If no, depending on the third argument an elog, ewarn, or eerror message
# is emitted.
collectd_plugin_kernel_linux() {
local multi_opt opt
if has ${1} ${COLLECTD_ALL_PLUGINS}; then
if use collectd_plugins_${1}; then
for opt in ${2}; do
if linux_chkconfig_present ${opt}; then
return 0;
fi
done
multi_opt=${2//\ /\ or\ }
case ${3} in
(info)
elog "The ${1} plugin can use kernel features that are disabled now; enable ${multi_opt} in your kernel"
;;
(warn)
ewarn "The ${1} plugin uses kernel features that are disabled now; enable ${multi_opt} in your kernel"
;;
(error)
eerror "The ${1} plugin needs kernel features that are disabled now; enable ${multi_opt} in your kernel"
;;
(*)
die "function collectd_plugin_kernel_linux called with invalid third argument"
;;
esac
fi
fi
}
collectd_linux_kernel_checks() {
if ! linux_chkconfig_present PROC_FS; then
ewarn "/proc file system support is disabled, many plugins will not be able to read any statistics from your system unless you enable PROC_FS in your kernel"
fi
if ! linux_chkconfig_present SYSFS; then
ewarn "/sys file system support is disabled, many plugins will not be able to read any statistics from your system unless you enable SYSFS in your kernel"
fi
# battery.c: /proc/pmu/battery_%i
# battery.c: /proc/acpi/battery
collectd_plugin_kernel_linux battery ACPI_BATTERY warn
# cgroups.c: /sys/fs/cgroup/
collectd_plugin_kernel_linux cgroups CGROUPS warn
# cpufreq.c: /sys/devices/system/cpu/cpu%d/cpufreq/
collectd_plugin_kernel_linux cpufreq SYSFS warn
collectd_plugin_kernel_linux cpufreq CPU_FREQ_STAT warn
# drbd.c: /proc/drbd
collectd_plugin_kernel_linux drbd BLK_DEV_DRBD warn
# conntrack.c: /proc/sys/net/netfilter/*
collectd_plugin_kernel_linux conntrack NETFILTER warn
# fscache.c: /proc/fs/fscache/stats
collectd_plugin_kernel_linux fscache FSCACHE warn
# nfs.c: /proc/net/rpc/nfs
# nfs.c: /proc/net/rpc/nfsd
collectd_plugin_kernel_linux nfs NFS_COMMON warn
# serial.c: /proc/tty/driver/serial
# serial.c: /proc/tty/driver/ttyS
collectd_plugin_kernel_linux serial SERIAL_CORE warn
# swap.c: /proc/meminfo
collectd_plugin_kernel_linux swap SWAP warn
# thermal.c: /proc/acpi/thermal_zone
# thermal.c: /sys/class/thermal
collectd_plugin_kernel_linux thermal ACPI_THERMAL warn
# turbostat.c: /dev/cpu/%d/msr
collectd_plugin_kernel_linux turbostat X86_MSR warn
# vmem.c: /proc/vmstat
collectd_plugin_kernel_linux vmem VM_EVENT_COUNTERS warn
# vserver.c: /proc/virtual
collectd_plugin_kernel_linux vserver VSERVER warn
# uuid.c: /sys/hypervisor/uuid
collectd_plugin_kernel_linux uuid SYSFS info
# wireless.c: /proc/net/wireless
collectd_plugin_kernel_linux wireless "WIRELESS MAC80211 IEEE80211" warn
# zfs_arc.c: /proc/spl/kstat/zfs/arcstats
collectd_plugin_kernel_linux zfs_arc "SPL ZFS" warn
}
pkg_setup() {
if use kernel_linux; then
linux-info_pkg_setup
if linux_config_exists; then
einfo "Checking your linux kernel configuration:"
collectd_linux_kernel_checks
else
elog "Cannot find a linux kernel configuration. Continuing anyway."
fi
fi
if use collectd_plugins_java; then
java-pkg-opt-2_pkg_setup
fi
use collectd_plugins_python && python-single-r1_pkg_setup
enewgroup collectd
enewuser collectd -1 -1 /var/lib/collectd collectd
}
src_prepare() {
default
# There's some strange prefix handling in the default config file, resulting in
# paths like "/usr/var/..."
sed -i -e "s:@prefix@/var:/var:g" src/collectd.conf.in || die
# fix installdirs for perl, bug 444360
sed -i -e 's/INSTALL_BASE=$(DESTDIR)$(prefix) //' bindings/Makefile.am || die
if use collectd_plugins_java; then
# Set javac -source and -target flags according to (R)DEPEND.
sed -i -e "s/\$(JAVAC)/\0 $(java-pkg_javac-args)/g" bindings/java/Makefile.am || die
fi
ebegin "Removing bundled libltdl"
rm -rf libltdl || die
eend 0
eautoreconf
}
src_configure() {
# Now come the lists of os-dependent plugins. Any plugin that is not listed anywhere here
# should work independent of the operating system.
local linux_plugins="barometer battery cpu cpufreq disk drbd entropy
ethstat interface iptables ipvs irq ipc load memory md netlink nfs
numa processes serial swap tcpconns thermal turbostat users vmem
wireless zfc_arc"
local need_libstatgrab=0
local libstatgrab_plugins="cpu disk interface load memory swap users"
local bsd_plugins="cpu tcpconns ${libstatgrab_plugins} zfc_arc"
local darwin_plugins="apple_sensors battery cpu disk interface memory processes tcpconns"
local osdependent_plugins="${linux_plugins} ${bsd_plugins} ${darwin_plugins}"
local myos_plugins=""
if use kernel_linux; then
einfo "Enabling Linux plugins."
myos_plugins=${linux_plugins}
elif use kernel_FreeBSD; then
einfo "Enabling FreeBSD plugins."
myos_plugins=${bsd_plugins}
elif use kernel_Darwin; then
einfo "Enabling Darwin plugins."
myos_plugins=${darwin_plugins}
fi
local myconf="--disable-werror"
# Do we debug?
myconf+=" $(use_enable debug)"
# udev support?
# Required for smart plugin via REQUIRED_USE; Optional for disk plugin
if use udev; then
myconf+=" --with-libudev"
else
myconf+=" --without-libudev"
fi
local plugin
# Disable what needs to be disabled.
for plugin in ${COLLECTD_DISABLED_PLUGINS}; do
myconf+=" --disable-${plugin}"
done
# Set enable/disable for each single plugin.
for plugin in ${COLLECTD_ALL_PLUGINS}; do
if has ${plugin} ${osdependent_plugins}; then
# plugin is os-dependent ...
if has ${plugin} ${myos_plugins}; then
# ... and available in this os
myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
# ... must we link against libstatgrab? Bug #541518
if use kernel_FreeBSD && has ${plugin} ${libstatgrab_plugins}; then
einfo "We must link against libstatgrab due to plugin \"${plugin}\" ..."
need_libstatgrab=1
fi
else
# ... and NOT available in this os
if use collectd_plugins_${plugin}; then
ewarn "You try to enable the ${plugin} plugin, but it is not available for this"
ewarn "kernel. Disabling it automatically."
fi
myconf+=" --disable-${plugin}"
fi
elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then
if use collectd_plugins_perl && ! use perl; then
ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag"
myconf+= --disable-perl
else
myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
fi
else
myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
fi
done
if [ "${need_libstatgrab}" -eq 1 ]; then
myconf+=" --with-libstatgrab"
else
myconf+=" --without-libstatgrab"
fi
# JAVA_HOME is set by eclasses.
if use collectd_plugins_java; then
myconf+=" --with-java"
fi
# Need libiptc ONLY for iptables. If we try to use it otherwise bug 340109 happens.
# lots of libs are only needed for plugins, if they are disabled, also disable the lib
use collectd_plugins_iptables || myconf+=" --with-libiptc=no"
use collectd_plugins_openldap || myconf+=" --with-libldap=no"
use collectd_plugins_redis || use collectd_plugins_write_redis || myconf+=" --with-libhiredis=no"
use collectd_plugins_smart || myconf+=" --with-libatasmart=no"
use collectd_plugins_gps || myconf+=" --with-libgps=no"
if use perl; then
myconf+=" --with-perl-bindings=INSTALLDIRS=vendor"
else
myconf+=" --without-perl-bindings"
fi
# No need for v5upgrade
myconf+=" --disable-target_v5upgrade"
# Python
if use collectd_plugins_python; then
myconf+=" --with-libpython=yes"
export PYTHON_CONFIG=$(python_get_PYTHON_CONFIG)
else
myconf+=" --with-libpython=no"
fi
# XFS support
myconf+=" $(use_enable xfs)"
# Finally, run econf.
KERNEL_DIR="${KERNEL_DIR}" econf --config-cache \
$(use_enable static-libs static) \
--localstatedir=/var ${myconf}
}
src_install() {
emake DESTDIR="${D%/}" install
perl_delete_localpod
find "${ED}"usr/ -name "*.la" -delete || die
if use collectd_plugins_java; then
java-pkg_regjar "${ED}"usr/share/${PN}/java/*.jar
fi
fowners root:collectd /etc/collectd.conf
fperms u=rw,g=r,o= /etc/collectd.conf
dodoc AUTHORS ChangeLog NEWS README TODO
if use contrib ; then
insinto /usr/share/doc/${PF}
doins -r contrib
fi
keepdir /var/lib/${PN}
fowners collectd:collectd /var/lib/${PN}
newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotate" ${PN}
sed -i -e 's:^.*PIDFile "/var/run/collectd.pid":PIDFile "/run/collectd/collectd.pid":' "${ED}"etc/collectd.conf || die
sed -i -e 's:^# SocketFile "/var/run/collectd-unixsock":# SocketFile "/run/collectd/collectd.socket":' "${ED}"etc/collectd.conf || die
sed -i -e 's:^.*LoadPlugin perl$:# The new, correct way to load the perl plugin -- \n# <LoadPlugin perl>\n# Globals true\n# </LoadPlugin>:' "${ED}"etc/collectd.conf || die
sed -i -e 's:^.*LoadPlugin python$:# The new, correct way to load the python plugin -- \n# <LoadPlugin python>\n# Globals true\n# </LoadPlugin>:' "${ED}"etc/collectd.conf || die
}
pkg_postinst() {
local caps=()
use collectd_plugins_ping && caps+=('cap_net_raw')
use collectd_plugins_iptables && caps+=('cap_net_admin')
use collectd_plugins_filecount && caps+=('cap_dac_read_search')
if [ ${#caps[@]} -gt 0 ]; then
local caps_str=$(IFS=","; echo "${caps[*]}")
fcaps ${caps_str} usr/sbin/collectd
elog "Capabilities for ${EROOT}usr/sbin/collectd set to:"
elog " ${caps_str}+ep"
elog
fi
elog "Note: Collectd is only the collector."
elog " You need to install 'data' sources (applications) locally or"
elog " remotely on your own."
elog
elog "Collectd is configured to run as unprivileged user by default."
elog "You may want to revisit the configuration."
elog
if use collectd_plugins_email; then
ewarn "The email plug-in is deprecated. To submit statistics please use the unixsock plugin."
fi
if use contrib; then
elog "The scripts in /usr/share/doc/${PF}/collection3 for generating graphs need dev-perl/HTML-Parser,"
elog "dev-perl/config-general, dev-perl/regexp-common, and net-analyzer/rrdtool[perl] to be installed."
fi
}

@ -84,3 +84,10 @@ python_install_all() {
systemd_dounit "${S}"/systemd/cloud-init-local.service
systemd_dounit "${S}"/systemd/cloud-init.service
}
pkg_postinst() {
elog "cloud-init-local needs to be run in the boot runlevel because it"
elog "modifies services in the default runlevel. When a runlevel is started"
elog "it is cached, so modifications that happen to the current runlevel"
elog "while you are in it are not acted upon."
}

@ -11,3 +11,28 @@ index bbadd7b..1578a3d 100755
scripts=['tools/cloud-init-per'],
license='GPLv3',
data_files=data_files,
diff --git a/sysvinit/gentoo/cloud-init b/sysvinit/gentoo/cloud-init
index 5afc0f2..531a715 100644
--- a/sysvinit/gentoo/cloud-init
+++ b/sysvinit/gentoo/cloud-init
@@ -2,6 +2,7 @@
# add depends for network, dns, fs etc
depend() {
after cloud-init-local
+ after net
before cloud-config
provide cloud-init
}
diff --git a/sysvinit/gentoo/cloud-init-local b/sysvinit/gentoo/cloud-init-local
index 9bd0b56..0f8cf65 100644
--- a/sysvinit/gentoo/cloud-init-local
+++ b/sysvinit/gentoo/cloud-init-local
@@ -2,7 +2,7 @@
depend() {
after localmount
- after netmount
+ before net
before cloud-init
provide cloud-init-local
}

@ -6,7 +6,6 @@ DIST bash-4.0.tar.gz 6230779 SHA256 9793d394f640a95030c77d5ac989724afe196921956d
DIST bash-4.1.tar.gz 6598300 SHA256 3f627124a83c6d34db503a923e20710d370573a29dd5d11d6f116d1aee7be1da SHA512 2f2a053d98be9a31cd089e1293e3369ad05406f6543d1d1662d8b5807fdcfebc1dda79db9bf2c596a6351ea463fb9bd9c8943c1d45da9b82f2fd3bab0b8a581a WHIRLPOOL 0259149d6f0d8f8a19e4b5a88e127c55efae0df4459063295aa6a9de69450b5f4b4b579894e4410ddfc0119eeb0356865b7cc4dbc7e4a75ad98acce0dfe2d46f
DIST bash-4.2.tar.gz 7009201 SHA256 a27a1179ec9c0830c65c6aa5d7dab60f7ce1a2a608618570f96bfa72e95ab3d8 SHA512 fdd3c230f4f7a687d36db1b8f7baab5e553cf55756e2d49a88ffaa4260c8cb949897dec9f48655e96608ef0093ac101b60c132060f06c711c0ab81aa3f148b5c WHIRLPOOL fd5f321a8a89381904b1dd1f5acb5100186ce48cccc9b248cf68b35a1c1932177df1fc2b0215131999ee6018decf3264c45e54d407bf4b74ff8e4cc8215c630a
DIST bash-4.3.tar.gz 7955839 SHA256 afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4 SHA512 a852b8e46ee55568dce9d23a30a9dbd1c770c2d2a4bc91e1c3177d723b31b32c5d69d19704a93f165891b409b9dd2cc65723372044e2bd0ee49ed59a11512651 WHIRLPOOL d82eb296b1bdee517b20e40d2231697dc41e2040d34e2da24c4fa40755c723d732929805ebef6f6923cd8ffecfb0db7063ec1dc3ab4e695a93916f2d872e236f
DIST bash-4.4-rc2.tar.gz 8937485 SHA256 199ec0166d50a765eec74dc258b006b06cf6b59901d7ff40510c82aae37ad994 SHA512 e47cf16c98d2a22373d61ed4e8bae9951c10e04d9aefbcf3b2b8189db6f71314025ad73b6a93a1135a9714011f0e3517911c8e68a39e4a92bda4811441062b2f WHIRLPOOL ead4840dc6313be760f51be7fe611673c9a0e5ddcd76c3817fd173bfe41e213a4d73f4a41f2556023974a7880738f98c30f8f7bb4fd520f10d62a838aef6b650
DIST bash-4.4.tar.gz 9377313 SHA256 d86b3392c1202e8ff5a423b302e6284db7f8f435ea9f39b5b1b20fd3ac36dfcb SHA512 73de3b425faaac55e45456b0f6f6d8077b5dfa7bb76e0d1894a19361b4a2b6bd4fbbe182117ddbfe9b07b4d898fba03537c261badc9533dd3c0da891764c7f29 WHIRLPOOL cb88bb6f565d66346f5eb358a179e52637a2ede2fda3358899730795f1ac6f9540d116202f2d0d1ebb9d983ad7054c5fbf9be8b06a1ca0b4fe1eb62bb30a15ce
DIST bash205b-001 1132 SHA256 bf7a055e0916b7899e7429e36e35d009db445b942b34520a601ea5a8fa634fdd SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071 WHIRLPOOL 90ba36843bbf2e0b7279d3bd197ddaa04e03e113be32051e5a77280cda6d43dcbf339780c57322fc0835a54c82e0095f0d3f2a13f13fec8c0b8da38e7e9b253a
DIST bash205b-002 755 SHA256 affdd1808a6262fbfe291ebffa2133b05e4bb46067a90e3329d5741e10f0587b SHA512 46947b0229478d5c2cfeff68b8ebc00e4ef0c8b94e336ca12f72b4490ba3622c0240c01c17c1641c3b07adc2c64ec94d6d780365e8990768ec8888f3a9526883 WHIRLPOOL 7333910e98e517306077937881d4c5569ddd85552203b3ec833f0fda13822e388ce85f007d60e4ab4b1ef15abb66fa40dc4356ca01367463d179a6a23bcff8e7
@ -283,3 +282,5 @@ DIST bash43-043 1942 SHA256 47a8a3c005b46e25821f4d8f5ccb04c1d653b1c829cb40568d55
DIST bash43-044 1658 SHA256 9338820630bf67373b44d8ea68409f65162ea7a47b9b29ace06a0aed12567f99 SHA512 2937ef80c99e93094e4aaa6a93d077efc3e433a4712c17e30590a0abeb5488293365cb8aa19e37d25b7d5c38d3ad26cdea12b904e5ffb2cdb16f18ab12f422fd WHIRLPOOL 488f567b900e49a9de9b92e9a8e29a92a087d390e9f24c3986bf1d89524878c88c7a3c2cae959844427fb20e6858a7b8eae112aac640f3d97ba1f79888f9f25d
DIST bash43-045 1312 SHA256 ba6ec3978e9eaa1eb3fabdaf3cc6fdf8c4606ac1c599faaeb4e2d69864150023 SHA512 7b79dacff44e5358da736334d2277a2879ca1389e22e9dac50e139f30dab623bc89a56930d89e74efc468a00d051f6747ccaffcd1a30d7c737d49780b9830e3d WHIRLPOOL f361e523879ff1898574ac5eca480661bd787dc278fff204e7f27da89e85439b4e9d36a5f556046b760f3beb115302e745b5196bfa081b402d3f76fb44463558
DIST bash43-046 1494 SHA256 b3b456a6b690cd293353f17e22d92a202b3c8bce587ae5f2667c20c9ab6f688f SHA512 c036b659fa681f8129110356bec33fad00fb8e469f3b4bcefd0b7ddf5e20030977716adf5c65f58f3ff68cd7af0bdd42392ee077100bc7f45ee123749d082f7d WHIRLPOOL d58384a2ca77f9a80a69a117221da51a701539cf5497d8e0fc634cd1cc0cb0024e02675bea810a0f42b873b557d479ba1b7aee6e6f73bd1422df2dbb29396477
DIST bash43-047 4437 SHA256 c69248de7e78ba6b92f118fe1ef47bc86479d5040fe0b1f908ace1c9e3c67c4a SHA512 9332d680ac226491cf8e5986a3261eb76b53ef4b0b2a43405564b088afc0e8658077812c9177bdab7900e05394e69f3047d82ddb59553fc01ef721acfa9d5553 WHIRLPOOL 719fa31d0fb09a75d5abbb63ee5a485802c5eadd06720d6074c2282d117aa6e234f5f75cabd340643710bd14e99260047183386bd1df278c9715aed7b98232d7
DIST bash43-048 1612 SHA256 5b8215451c5d096ca1e115307ffe6613553551a70369525a0778f216c3a4dfa2 SHA512 7c3963bfbc730b4592668460e86c166e727e9897c1a9235a6860a01bc90d365ef0707f0fac7ed62780dcc84e80dbe8484ec59e9e948def22f44ae03e8a169780 WHIRLPOOL e1a435c3b9fbc0deca80dd89bfd3adcbff1d5a3af50884d2aef54635b8ba1063903e2d99a5a23bd1c64c19c5e9c19de6b479ac777cecdb812555dc5683b8cf71

@ -1,249 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="4"
inherit eutils flag-o-matic toolchain-funcs multilib
# Official patchlevel
# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
PLEVEL=${PV##*_p}
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MY_P=${PN}-${MY_PV}
[[ ${PV} != *_p* ]] && PLEVEL=0
patches() {
local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
[[ ${plevel} -eq 0 ]] && return 1
eval set -- {1..${plevel}}
set -- $(printf "${pn}${pv/\.}-%03d " "$@")
if [[ ${opt} == -s ]] ; then
echo "${@/#/${DISTDIR}/}"
else
local u
for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
printf "${u}/${pn}-${pv}-patches/%s " "$@"
done
fi
}
# The version of readline this bash normally ships with.
READLINE_VER="6.3"
DESCRIPTION="The standard GNU Bourne again shell"
HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
DEPEND=">=sys-libs/ncurses-5.2-r2
readline? ( >=sys-libs/readline-${READLINE_VER} )
nls? ( virtual/libintl )"
RDEPEND="${DEPEND}
!<sys-apps/portage-2.1.6.7_p1
!<sys-apps/paludis-0.26.0_alpha5"
# we only need yacc when the .y files get patched (bash42-005)
DEPEND+=" virtual/yacc"
S=${WORKDIR}/${MY_P}
pkg_setup() {
if is-flag -malign-double ; then #7332
eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
eerror "as it breaks LFS (struct stat64) on x86."
die "remove -malign-double from your CFLAGS mr ricer"
fi
if use bashlogger ; then
ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
ewarn "This will log ALL output you enter into the shell, you have been warned."
fi
}
src_unpack() {
unpack ${MY_P}.tar.gz
}
src_prepare() {
# Include official patches
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
# Clean out local libs so we know we use system ones w/releases.
if [[ ${PV} != *_rc* ]] ; then
rm -rf lib/{readline,termcap}/*
touch lib/{readline,termcap}/Makefile.in # for config.status
sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
fi
# Avoid regenerating docs after patches #407985
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
touch -r . doc/*
epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
epatch_user
}
src_configure() {
local myconf=()
# For descriptions of these, see config-top.h
# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
append-cppflags \
-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
-DNON_INTERACTIVE_LOGIN_SHELLS \
-DSSH_SOURCE_BASHRC \
-DUSE_MKTEMP -DUSE_MKSTEMP \
$(use bashlogger && echo -DSYSLOG_HISTORY)
# Don't even think about building this statically without
# reading Bug 7714 first. If you still build it statically,
# don't come crying to us with bugs ;).
#use static && export LDFLAGS="${LDFLAGS} -static"
use nls || myconf+=( --disable-nls )
# Historically, we always used the builtin readline, but since
# our handling of SONAME upgrades has gotten much more stable
# in the PM (and the readline ebuild itself preserves the old
# libs during upgrades), linking against the system copy should
# be safe.
# Exact cached version here doesn't really matter as long as it
# is at least what's in the DEPEND up above.
export ac_cv_rl_version=${READLINE_VER}
# Force linking with system curses ... the bundled termcap lib
# sucks bad compared to ncurses. For the most part, ncurses
# is here because readline needs it. But bash itself calls
# ncurses in one or two small places :(.
if [[ ${PV} != *_rc* ]] ; then
# Use system readline only with released versions.
myconf+=( --with-installed-readline=. )
fi
if use plugins; then
append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
else
# Disable the plugins logic by hand since bash doesn't
# provide a way of doing it.
export ac_cv_func_dl{close,open,sym}=no \
ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
sed -i \
-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
configure || die
fi
tc-export AR #444070
econf \
--docdir='$(datarootdir)'/doc/${PF} \
--htmldir='$(docdir)/html' \
--with-curses \
$(use_with afs) \
$(use_enable net net-redirections) \
--disable-profiling \
$(use_enable mem-scramble) \
$(use_with mem-scramble bash-malloc) \
$(use_enable readline) \
$(use_enable readline history) \
$(use_enable readline bang-history) \
"${myconf[@]}"
}
src_compile() {
emake
if use plugins ; then
emake -C examples/loadables all others
fi
}
src_install() {
local d f
default
dodir /bin
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
dosym bash /bin/rbash
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
doins "${FILESDIR}"/bashrc
keepdir /etc/bash/bashrc.d
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do
newins "${FILESDIR}"/dot-${f} .${f}
done
local sed_args=(
-e "s:#${USERLAND}#@::"
-e '/#@/d'
)
if ! use readline ; then
sed_args+=( #432338
-e '/^shopt -s histappend/s:^:#:'
-e 's:use_color=true:use_color=false:'
)
fi
sed -i \
"${sed_args[@]}" \
"${ED}"/etc/skel/.bashrc \
"${ED}"/etc/bash/bashrc || die
if use plugins ; then
exeinto /usr/$(get_libdir)/bash
doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
insinto /usr/include/bash-plugins
doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
fi
if use examples ; then
for d in examples/{functions,misc,scripts,startup-files} ; do
exeinto /usr/share/doc/${PF}/${d}
insinto /usr/share/doc/${PF}/${d}
for f in ${d}/* ; do
if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
doexe ${f}
else
doins ${f}
fi
done
done
fi
doman doc/*.1
newdoc CWRU/changelog ChangeLog
dosym bash.info /usr/share/info/bashref.info
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
mkdir -p "${EROOT}"/etc/bash
mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
fi
if [[ -L ${EROOT}/bin/sh ]] ; then
# rewrite the symlink to ensure that its mtime changes. having /bin/sh
# missing even temporarily causes a fatal error with paludis.
local target=$(readlink "${EROOT}"/bin/sh)
local tmp=$(emktemp "${EROOT}"/bin)
ln -sf "${target}" "${tmp}"
mv -f "${tmp}" "${EROOT}"/bin/sh
fi
}
pkg_postinst() {
# If /bin/sh does not exist, provide it
if [[ ! -e ${EROOT}/bin/sh ]] ; then
ln -sf bash "${EROOT}"/bin/sh
fi
}

@ -1,249 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="4"
inherit eutils flag-o-matic toolchain-funcs multilib
# Official patchlevel
# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
PLEVEL=${PV##*_p}
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MY_P=${PN}-${MY_PV}
[[ ${PV} != *_p* ]] && PLEVEL=0
patches() {
local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
[[ ${plevel} -eq 0 ]] && return 1
eval set -- {1..${plevel}}
set -- $(printf "${pn}${pv/\.}-%03d " "$@")
if [[ ${opt} == -s ]] ; then
echo "${@/#/${DISTDIR}/}"
else
local u
for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
printf "${u}/${pn}-${pv}-patches/%s " "$@"
done
fi
}
# The version of readline this bash normally ships with.
READLINE_VER="6.3"
DESCRIPTION="The standard GNU Bourne again shell"
HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
DEPEND=">=sys-libs/ncurses-5.2-r2
readline? ( >=sys-libs/readline-${READLINE_VER} )
nls? ( virtual/libintl )"
RDEPEND="${DEPEND}
!<sys-apps/portage-2.1.6.7_p1
!<sys-apps/paludis-0.26.0_alpha5"
# we only need yacc when the .y files get patched (bash42-005)
DEPEND+=" virtual/yacc"
S=${WORKDIR}/${MY_P}
pkg_setup() {
if is-flag -malign-double ; then #7332
eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
eerror "as it breaks LFS (struct stat64) on x86."
die "remove -malign-double from your CFLAGS mr ricer"
fi
if use bashlogger ; then
ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
ewarn "This will log ALL output you enter into the shell, you have been warned."
fi
}
src_unpack() {
unpack ${MY_P}.tar.gz
}
src_prepare() {
# Include official patches
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
# Clean out local libs so we know we use system ones w/releases.
if [[ ${PV} != *_rc* ]] ; then
rm -rf lib/{readline,termcap}/*
touch lib/{readline,termcap}/Makefile.in # for config.status
sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
fi
# Avoid regenerating docs after patches #407985
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
touch -r . doc/*
epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
epatch_user
}
src_configure() {
local myconf=()
# For descriptions of these, see config-top.h
# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
append-cppflags \
-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-DNON_INTERACTIVE_LOGIN_SHELLS \
-DSSH_SOURCE_BASHRC \
-DUSE_MKTEMP -DUSE_MKSTEMP \
$(use bashlogger && echo -DSYSLOG_HISTORY)
# Don't even think about building this statically without
# reading Bug 7714 first. If you still build it statically,
# don't come crying to us with bugs ;).
#use static && export LDFLAGS="${LDFLAGS} -static"
use nls || myconf+=( --disable-nls )
# Historically, we always used the builtin readline, but since
# our handling of SONAME upgrades has gotten much more stable
# in the PM (and the readline ebuild itself preserves the old
# libs during upgrades), linking against the system copy should
# be safe.
# Exact cached version here doesn't really matter as long as it
# is at least what's in the DEPEND up above.
export ac_cv_rl_version=${READLINE_VER}
# Force linking with system curses ... the bundled termcap lib
# sucks bad compared to ncurses. For the most part, ncurses
# is here because readline needs it. But bash itself calls
# ncurses in one or two small places :(.
if [[ ${PV} != *_rc* ]] ; then
# Use system readline only with released versions.
myconf+=( --with-installed-readline=. )
fi
if use plugins; then
append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
else
# Disable the plugins logic by hand since bash doesn't
# provide a way of doing it.
export ac_cv_func_dl{close,open,sym}=no \
ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
sed -i \
-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
configure || die
fi
tc-export AR #444070
econf \
--docdir='$(datarootdir)'/doc/${PF} \
--htmldir='$(docdir)/html' \
--with-curses \
$(use_with afs) \
$(use_enable net net-redirections) \
--disable-profiling \
$(use_enable mem-scramble) \
$(use_with mem-scramble bash-malloc) \
$(use_enable readline) \
$(use_enable readline history) \
$(use_enable readline bang-history) \
"${myconf[@]}"
}
src_compile() {
emake
if use plugins ; then
emake -C examples/loadables all others
fi
}
src_install() {
local d f
default
dodir /bin
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
dosym bash /bin/rbash
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
doins "${FILESDIR}"/bashrc
keepdir /etc/bash/bashrc.d
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do
newins "${FILESDIR}"/dot-${f} .${f}
done
local sed_args=(
-e "s:#${USERLAND}#@::"
-e '/#@/d'
)
if ! use readline ; then
sed_args+=( #432338
-e '/^shopt -s histappend/s:^:#:'
-e 's:use_color=true:use_color=false:'
)
fi
sed -i \
"${sed_args[@]}" \
"${ED}"/etc/skel/.bashrc \
"${ED}"/etc/bash/bashrc || die
if use plugins ; then
exeinto /usr/$(get_libdir)/bash
doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
insinto /usr/include/bash-plugins
doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
fi
if use examples ; then
for d in examples/{functions,misc,scripts,startup-files} ; do
exeinto /usr/share/doc/${PF}/${d}
insinto /usr/share/doc/${PF}/${d}
for f in ${d}/* ; do
if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
doexe ${f}
else
doins ${f}
fi
done
done
fi
doman doc/*.1
newdoc CWRU/changelog ChangeLog
dosym bash.info /usr/share/info/bashref.info
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
mkdir -p "${EROOT}"/etc/bash
mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
fi
if [[ -L ${EROOT}/bin/sh ]] ; then
# rewrite the symlink to ensure that its mtime changes. having /bin/sh
# missing even temporarily causes a fatal error with paludis.
local target=$(readlink "${EROOT}"/bin/sh)
local tmp=$(emktemp "${EROOT}"/bin)
ln -sf "${target}" "${tmp}"
mv -f "${tmp}" "${EROOT}"/bin/sh
fi
}
pkg_postinst() {
# If /bin/sh does not exist, provide it
if [[ ! -e ${EROOT}/bin/sh ]] ; then
ln -sf bash "${EROOT}"/bin/sh
fi
}

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="4"
EAPI="5"
inherit eutils flag-o-matic toolchain-funcs multilib
@ -38,11 +38,11 @@ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
DEPEND=">=sys-libs/ncurses-5.2-r2
readline? ( >=sys-libs/readline-${READLINE_VER} )
DEPEND=">=sys-libs/ncurses-5.2-r2:0=
readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
nls? ( virtual/libintl )"
RDEPEND="${DEPEND}
!<sys-apps/portage-2.1.6.7_p1
@ -50,6 +50,12 @@ RDEPEND="${DEPEND}
# we only need yacc when the .y files get patched (bash42-005)
DEPEND+=" virtual/yacc"
PATCHES=(
"${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
"${FILESDIR}"/${PN}-4.3-arrayfunc.patch
"${FILESDIR}"/${PN}-4.3-protos.patch
)
S=${WORKDIR}/${MY_P}
pkg_setup() {
@ -83,9 +89,7 @@ src_prepare() {
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
touch -r . doc/*
epatch "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
epatch "${FILESDIR}"/${PN}-4.3-protos.patch
epatch "${PATCHES[@]}"
epatch_user
}

@ -1,245 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
inherit eutils flag-o-matic toolchain-funcs multilib
# Official patchlevel
# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
PLEVEL=${PV##*_p}
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MY_P=${PN}-${MY_PV}
[[ ${PV} != *_p* ]] && PLEVEL=0
patches() {
local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
[[ ${plevel} -eq 0 ]] && return 1
eval set -- {1..${plevel}}
set -- $(printf "${pn}${pv/\.}-%03d " "$@")
if [[ ${opt} == -s ]] ; then
echo "${@/#/${DISTDIR}/}"
else
local u
for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
printf "${u}/${pn}-${pv}-patches/%s " "$@"
done
fi
}
# The version of readline this bash normally ships with.
READLINE_VER="7.0_rc2"
DESCRIPTION="The standard GNU Bourne again shell"
HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
case ${PV} in
*_alpha*|*_beta*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;;
*) SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" ;;
esac
LICENSE="GPL-3"
SLOT="0"
#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
DEPEND=">=sys-libs/ncurses-5.2-r2:0=
readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
nls? ( virtual/libintl )"
RDEPEND="${DEPEND}
!<sys-apps/portage-2.1.6.7_p1
!<sys-apps/paludis-0.26.0_alpha5"
# we only need yacc when the .y files get patched (bash42-005)
DEPEND+=" virtual/yacc"
S=${WORKDIR}/${MY_P}
pkg_setup() {
if is-flag -malign-double ; then #7332
eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
eerror "as it breaks LFS (struct stat64) on x86."
die "remove -malign-double from your CFLAGS mr ricer"
fi
if use bashlogger ; then
ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
ewarn "This will log ALL output you enter into the shell, you have been warned."
fi
}
src_unpack() {
unpack ${MY_P}.tar.gz
}
src_prepare() {
# Include official patches
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
# Clean out local libs so we know we use system ones w/releases.
if [[ ${PV} != *_rc* ]] ; then
rm -rf lib/{readline,termcap}/*
touch lib/{readline,termcap}/Makefile.in # for config.status
sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
fi
# Avoid regenerating docs after patches #407985
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
touch -r . doc/*
epatch_user
}
src_configure() {
local myconf=()
# For descriptions of these, see config-top.h
# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
append-cppflags \
-DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
-DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
-DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
-DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
-DNON_INTERACTIVE_LOGIN_SHELLS \
-DSSH_SOURCE_BASHRC \
$(use bashlogger && echo -DSYSLOG_HISTORY)
# Don't even think about building this statically without
# reading Bug 7714 first. If you still build it statically,
# don't come crying to us with bugs ;).
#use static && export LDFLAGS="${LDFLAGS} -static"
use nls || myconf+=( --disable-nls )
# Historically, we always used the builtin readline, but since
# our handling of SONAME upgrades has gotten much more stable
# in the PM (and the readline ebuild itself preserves the old
# libs during upgrades), linking against the system copy should
# be safe.
# Exact cached version here doesn't really matter as long as it
# is at least what's in the DEPEND up above.
export ac_cv_rl_version=${READLINE_VER%%_*}
# Force linking with system curses ... the bundled termcap lib
# sucks bad compared to ncurses. For the most part, ncurses
# is here because readline needs it. But bash itself calls
# ncurses in one or two small places :(.
if [[ ${PV} != *_rc* ]] ; then
# Use system readline only with released versions.
myconf+=( --with-installed-readline=. )
fi
if use plugins; then
append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
else
# Disable the plugins logic by hand since bash doesn't
# provide a way of doing it.
export ac_cv_func_dl{close,open,sym}=no \
ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
sed -i \
-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
configure || die
fi
tc-export AR #444070
econf \
--docdir='$(datarootdir)'/doc/${PF} \
--htmldir='$(docdir)/html' \
--with-curses \
$(use_with afs) \
$(use_enable net net-redirections) \
--disable-profiling \
$(use_enable mem-scramble) \
$(use_with mem-scramble bash-malloc) \
$(use_enable readline) \
$(use_enable readline history) \
$(use_enable readline bang-history) \
"${myconf[@]}"
}
src_compile() {
emake
if use plugins ; then
emake -C examples/loadables all others
fi
}
src_install() {
local d f
default
dodir /bin
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
dosym bash /bin/rbash
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
doins "${FILESDIR}"/bashrc
keepdir /etc/bash/bashrc.d
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do
newins "${FILESDIR}"/dot-${f} .${f}
done
local sed_args=(
-e "s:#${USERLAND}#@::"
-e '/#@/d'
)
if ! use readline ; then
sed_args+=( #432338
-e '/^shopt -s histappend/s:^:#:'
-e 's:use_color=true:use_color=false:'
)
fi
sed -i \
"${sed_args[@]}" \
"${ED}"/etc/skel/.bashrc \
"${ED}"/etc/bash/bashrc || die
if use plugins ; then
exeinto /usr/$(get_libdir)/bash
doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
insinto /usr/include/bash-plugins
doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
fi
if use examples ; then
for d in examples/{functions,misc,scripts,startup-files} ; do
exeinto /usr/share/doc/${PF}/${d}
insinto /usr/share/doc/${PF}/${d}
for f in ${d}/* ; do
if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
doexe ${f}
else
doins ${f}
fi
done
done
fi
doman doc/*.1
newdoc CWRU/changelog ChangeLog
dosym bash.info /usr/share/info/bashref.info
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
mkdir -p "${EROOT}"/etc/bash
mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
fi
if [[ -L ${EROOT}/bin/sh ]] ; then
# rewrite the symlink to ensure that its mtime changes. having /bin/sh
# missing even temporarily causes a fatal error with paludis.
local target=$(readlink "${EROOT}"/bin/sh)
local tmp=$(emktemp "${EROOT}"/bin)
ln -sf "${target}" "${tmp}"
mv -f "${tmp}" "${EROOT}"/bin/sh
fi
}
pkg_postinst() {
# If /bin/sh does not exist, provide it
if [[ ! -e ${EROOT}/bin/sh ]] ; then
ln -sf bash "${EROOT}"/bin/sh
fi
}

@ -1,36 +0,0 @@
http://lists.gnu.org/archive/html/bug-bash/2016-07/msg00066.html
From: Andreas Schwab <schwab@suse.de>
To: bug-bash@gnu.org
Subject: a=$* -> crash
Date: Wed, 27 Jul 2016 13:59:22 +0200
Message-ID: <mvmbn1j2sx1.fsf@hawking.suse.de>
(gdb) r
Starting program: /bin/bash -c a=\$\*
Program received signal SIGSEGV, Segmentation fault.
quote_string (string=string@entry=0x0) at subst.c:3940
3940 if (*string == 0)
diff --git a/subst.c b/subst.c
index 37d96f9..16ae3f0 100644
--- a/subst.c
+++ b/subst.c
@@ -8575,7 +8575,7 @@ param_expand (string, sindex, quoted, expanded_something,
/* If we're not quoted but we still don't want word splitting, make
we quote the IFS characters to protect them from splitting (e.g.,
when $@ is in the string as well). */
- else if (quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
+ else if (temp != 0 && quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS))
{
temp1 = quote_string (temp);
free (temp);
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

@ -1,26 +1,11 @@
DIST postgresql-9.0.23.tar.bz2 15045569 SHA256 3dbcbe19c814139a3f4be8bc6b49db804753cbc49979f345083e835c52b4d7de SHA512 db8fe64a5a5a1caae97e792ee5b8bcc375c6d6e10ef9c35f1003f174745568854dc5a7a58dbaf46794dcd35dee5a13f6eb1ba356f9618134b601b7759c753c9f WHIRLPOOL 5177facff628271a0d57d1f2925cfc04796020492c4102f0b0c6fa34149da9ddd9ccb0a38629e320521fe82163bdd4aa56f74af3a887ff4389cd9f62e921c53a
DIST postgresql-9.1.19.tar.bz2 15843978 SHA256 cbd5057451147dd63a1e764176a4e17a7795773be1e4266ea9faa951064c0ec6 SHA512 23dd4108556edcc667f599c5663356a1106bc239a1c5337d153c13a1e1871d52316825b84802bbc1d79612dfa4c9c77f4c4b96d59d23d7338988bdf370e956d4 WHIRLPOOL 6845fd8071032e987ab65a642ca04adbc8b464332bac8c346f01e011411947aa4341ea596fd910342124fcbae4cc25410c25ab695894b0b68d20441df5424722
DIST postgresql-9.1.20.tar.bz2 15844360 SHA256 6d1e6c4334c265a85f0f96407b7a9aafff0f26cb62db2d8d03a32ba0c2872937 SHA512 ebec6aae593058276dda2404812d89f3df637ceac24d96de1a774da03cf58ea9ce44819e18549040b6f6d811f2c8203462e13788df7158d45a0fe9dfb72d0fd9 WHIRLPOOL de990c029949c8ef372d3440c4cbb870739bf5b83c438ba2b012004cabcb077bab1258b2115ceb239eafefe73f282ea729384085e3f682240cb40ed662f350e5
DIST postgresql-9.1.21.tar.bz2 15850128 SHA256 d66ee9076f3149a4cab4be3c6f47e13bc047138d17dfcb531ad01f78cfdeb393 SHA512 75a96ce2c080b2e657b6f591e18c4778635a9f8c74870bbe7c99cb82bf1dfaad124942214ab6e3079b565c41b7fc77af1a4a49672e7ddba075374402c8832a5b WHIRLPOOL 4de012763b985d1fa675e151d68988f4dd4de4ae8860d67fab3818666b3e135849465a0a41bc1f073eb4d679415fb18871f8156c99376c7860c51258e607771e
DIST postgresql-9.1.22.tar.bz2 15860904 SHA256 f619664b0dde4e1a75fdc00c35afb4517002984a462d70967ffcdedfeee5e16e SHA512 a2ed0a1f0d0920f6151d128a206c557b14832ab296dbf51c665309434a851b83eefd12a5a36c870ee0281371350b6b86ac6e81188c164c72407847cf9e70d691 WHIRLPOOL d95f142e149fec8311502bff6cfabf33aadc1ccc400d9b0d77e4b5000beec88b60ff6de59fbc625b4696626e9b626dc887dd8c96a3c02a66019dc6d0e214994c
DIST postgresql-9.1.23.tar.bz2 15856178 SHA256 7f7471e8b3b369726f1c1df0e6a163dde63b6546c4bba985c1f36a574c75f6d5 SHA512 192f48ed8db510663c85c217afee8eff732d467fe10f600c9be834371ccb6a788acd380c582d80f0096a0b7d7ee0daa378d1fb8177281bf4e6e2fcc39fffdc67 WHIRLPOOL 55a60cdc6a0c1e570d2a1f7fce9c160637101cf77c7dda3d1a2ccd31350d16678f07949c8bd7519f54bc6008e18074d0d57f1201c870b044e765c8057a358441
DIST postgresql-9.2.14.tar.bz2 16451398 SHA256 54c20b3f320a48c38487f2711e98b2fa3f9ce4305905a294ad0449e8b4fb292e SHA512 268015d9e397ee62eebbbc9abf1ee25d0d4aa6bf5943b404009b3aab31f485b8523353c679beed34cc00304b9d4c7aca9de0ba841d9841dbf885d05d1a5692a1 WHIRLPOOL 4f6d5d6989a67d14082ddb215411b55d0dc0be29772e6a593b4df133489ff4a7e6c265d0830adba64d4c6be47e17a949cbc21d6570dceb9362399649af2be88e
DIST postgresql-9.2.15.tar.bz2 16480973 SHA256 7ced4807589899e83c64dd0803cf1f9782b6a20077ab545c66e868ef26543e60 SHA512 4a0e52beaffc9f0b004c761a5ca107a019d6265877d36cd7be46912807da6fa6824ce469c8d59fb24092440646d3f0872b8aa62941b4b3ba657edc2f5678b2b1 WHIRLPOOL 58607fcd1adc474f6a78741527b4192e30ac8e87d83a80fa71b6660ac1665a9ab5ee062ae19c919b288df607854ab55866e00e0228ffc6bd1b71dd59c18d83bd
DIST postgresql-9.2.16.tar.bz2 16490199 SHA256 d2164cb8706bf828161871c195299841c5be1fbd9bc85d7866704e54f0741b11 SHA512 0f0b317473b4b42ae4261993c704a7c6cd28c7e6bd83e77a81850695655baa473d7d52e97441ee5500d646d405c84145a54f42b9bae89a0ddfebb0418d608820 WHIRLPOOL 8dfdca52555889d20e857ecc01ee75a14fd18bb7fa1ac50f5d54415a423d62223d0d389d43b143ae927446946aaff06b68cbf8214e26e2f432c39a50c0296b08
DIST postgresql-9.2.17.tar.bz2 16497200 SHA256 c660cc0ee42c221ebedc2c75ad0d4b30ec8da488a954df9987a3fc83bcb7363f SHA512 a771c98c0de4e6c5790b9ee698ee8d259533d372b82ff3c9900c00cf79706ef29af6204de4292ff8ca4a3f3a13fec1991c4441c352c309bbf9cdd397579677b4 WHIRLPOOL c522b5bb4baa06624d67dac5c50e7d33bdd03a78a34e9c96df850285ab3b491f3502a94abb7604abf0716672c207340f05c23d4b110f8f51c8bd278c848dd389
DIST postgresql-9.2.18.tar.bz2 16448429 SHA256 d7aa37d586ae4d46d07a4fac417ff966e45a9dd99bac8b3cd149be8df9ea35f4 SHA512 c311f621ac38e2dfaf5fd57a4500430333dcbb2d7f1719bc7d99fef54e06a22f93aea595391c3607d44c89c372d0e89daf18f8f295b33e3b21e5285fbbb87d5b WHIRLPOOL 08664a3378eca1a509066a6a841c1489d7cf8cbda60cd836ad67b0cb2bf112b58191d0a1170f97aec09ef5a0984916263c754bc108de2cec6945417e97ce0e66
DIST postgresql-9.3.10.tar.bz2 16995860 SHA256 e5444f0f76aff98a251400b7c28bc361d65e3d72d8d6cb9bb5d8361a69541531 SHA512 6b048fd1d0b38f72bab6ea70e40f10e7b805b94fc4c6fd865e0ec5e86da3c54043f20059dbf716d29eb4ca787dc50da561b1c7b48ab9f3096ebc651300855672 WHIRLPOOL b8ea15a04d18535662832d444b556aedffaa8c954b52dcd42d548f53f93b8a9dbfbe9298f63c26d44c8b757e8c10d76711c303cd83c84d9c86bf23c2837e74ce
DIST postgresql-9.3.11.tar.bz2 17047707 SHA256 3d222a90c941d3a6c02c7c749fc9eb54ff20a1166570459d09c5476743496a21 SHA512 8da91e11e0a6502c185931b6e47ba8e583d3360009f26ad703552be9a216b2c37a688894d4ea867c529c4135b6c36da26e9d7ef52a411b0c68ad50a53ff3cdb3 WHIRLPOOL cc1251553ec902dc1998c2bad11460206064c0d55140601b96293d98774f9622d38fa49f758e2f69ed6cb27ee14dd0a20f6ec41f655a4793b255168dfd430815
DIST postgresql-9.3.12.tar.bz2 17052755 SHA256 f3339ea23f86d07f3730adc878b2e5d433087ff44aad65a5ec9c22c32b112e67 SHA512 d88cb167ca78bd8588e3ff9b3f13b77f661e3ddec7e5b726cc0a46512db2584b15ce5f691fe7e4ab84855f102cb88014245921a38f5da41ad19e762a88968883 WHIRLPOOL 8738e18f8534f70ddbfa7c0c0ae1ab585330cb9df2d2da3a3e5f5c15a2e5070aebd38124b7295214e0105c482a79011d00c8cbe2a9061edc90bfd5ed07000dcb
DIST postgresql-9.3.13.tar.bz2 17061824 SHA256 5544e1d29bfdb9a815d3533400ae242b8763c399285e5d4020ffdb49c362a72b SHA512 04658f95d723563c08249faf674f2119358059808c42045e05adaa28264b9ae054d4e81ae2bb6639995e007caa65d21d935ff988d5b0473dc517107ddd8c6ca3 WHIRLPOOL 4d3e05220fea08111d75f613d3af93b8a6dd320861c99ecf993ab515447077d4991e36d02fb5a3f2963f7d1d2f0ac48cb000b5922156ad7af10482f929ca8694
DIST postgresql-9.3.14.tar.bz2 17042199 SHA256 5c4322f1c42ba1ff4b28383069c56663b46160bb08e85d41fa2ab9a5009d039d SHA512 97bd92ffdd661f7428c47a8bc87fde88a2b150e7d08bd577a7159ac65aec319d358495b883b95dff2069d24a8d15d1e7c10c3fae81fc76186bfef0127f257ac4 WHIRLPOOL d603e2016cba37fd0ea68b00c1493d23588aeeb334cceeb7fce521ed66618ffa70b4eb281e8a37650e30151cd4f1353879c63fe4076caa144d085ac96e8b5a79
DIST postgresql-9.4.5.tar.bz2 17660960 SHA256 b87c50c66b6ea42a9712b5f6284794fabad0616e6ae420cf0f10523be6d94a39 SHA512 01ad4b5a097efa70f74a9e96b764c32953a9df57d6bf81b893a1e552475f6aba0381580dcd1f27b2c443ce89fecc429eeeb0219af60a0b2f84798f76eb1757f5 WHIRLPOOL 8ea0e9a40cefa53568071f2137bac996898f9bd486cfb5cfcf8bb49590816833f37878f10caabffb9d3127e047f00c916b8830594a485ebe16fb9fe6fc834c95
DIST postgresql-9.4.6.tar.bz2 17734946 SHA256 cbce1f4d01a6142c5d8bebe125623c5198ec04f363da7dd3d3b3a4100b4140a6 SHA512 03e2c68ec7fb40b4886885136692e96ed5d7e50ead8ebd094ede402eeb8ed94a791357e8eff2776a2e4a537ced3d900e032779a33c1fbd920588d89f8b6705ee WHIRLPOOL d25073985dc9974064175bf8b90f7a18368882c8d62fdb403183121452624bfb50c10c181bdc4b6a076d515dc29e081cf913793653f04ced98a48640dab9b3ff
DIST postgresql-9.4.7.tar.bz2 17746987 SHA256 cc795e6c35b30e697e5891e3056376af685f848a4e67fab1702e74a2385f81e0 SHA512 e61d74a4a9caeb7d4a3fb9509b37aaeb5bd563d61d20739edd777ec990c92011286a7485f275178f9f8c1ebb8c84a98290e2b5351b11e0f9a1baa781f323e374 WHIRLPOOL 2ae25affc35e12fd250161585bc5cf318930d9864c9fccbf44c9bd697933aa75860467256b811501947c0fad8c6cdc0622889e9991904a4db9fda2d19efa2b37
DIST postgresql-9.4.8.tar.bz2 17740626 SHA256 4a10640e180e0d9adb587bc25a82dcce6bf507b033637e7fb9d4eeffa33a6b4c SHA512 d1cc8a02ed7eb0af365479cee43b3cd33fade69e07eb82343cd562efda5a460e405836e1fb2492a8cb22a71d14038216868cb48694400b3c31a56c4aee0bcac4 WHIRLPOOL f799c60ed6b753b0db197796718c4508669bf7cc64c34d97fe023c38e09c5e38801da5bac91c3392d690e0e8829beff6b4d3b3fa610119ce0a24a1e8fe9486f7
DIST postgresql-9.4.9.tar.bz2 17763281 SHA256 c120a62e90214c20d9160da3ca3fbaec97d5f1656f1dd033f60e7297b7a1e1c9 SHA512 980b1a8828d07151e67793367ea0ee08e4231cd76d9b20b4f4bca08a7976ee82a3aea51ce801a4107680c8203f8ebdb4cf5a0a6aaf93d580c9f337658d50819b WHIRLPOOL f5c9922bd12008a87a6ed0b8efaf8280d1a3ce8ef47fc853efd4d4d1a754e878f9cb27a4049cfb6d7c50968083e1286670a9b79588e29e127bd3f96b927f4999
DIST postgresql-9.5.1.tar.bz2 18441638 SHA256 6b309d8506a39773a752ff074f47656e5424576ea090b04a24fe1725958c5bd2 SHA512 fcb2b3bde51c4152b3a72764de1f9b4e607cb591571ed5bc1187b2c6938c33e21bdd512694a969a03c046e4889a129bb0e75fa676d55a1a1e77142da1e984192 WHIRLPOOL 2fdbae2c58ce4255b514055ada220b25269a01719c202e1d1ae86d408fd56b523f1a4e16ef5abd675b0fbf0675c1eabca7d0f5f2e8fdb9cdc3a3d98e7b755aeb
DIST postgresql-9.5.2.tar.bz2 18446616 SHA256 f8d132e464506b551ef498719f18cfe9d777709c7a1589dc360afc0b20e47c41 SHA512 ba31dddee8a960a4b1a97394eae5ea7efaa5e74e21c755882efcef90404676c6052dff55f40b585932e4f752cbcda5ceac0e29d601ea6651cfbab7a49190381a WHIRLPOOL 0b9abe3a5b3933485e5d0b2c08daa20d421e5920ae5b4640b36971463915d7e7b2767575564d80bb5dfa3a353c646c9c4ca8e483dfd64df39370774e76fa1cee
DIST postgresql-9.5.3.tar.bz2 18455394 SHA256 7385c01dc58acba8d7ac4e6ad42782bd7c0b59272862a3a3d5fe378d4503a0b4 SHA512 7275dbde0c1b795f3a491d45464c69a97fbfd0e66a7fe62ba00e97747908df0df19bf65e104e10e049e31a8cf484c9d9f29eb75ff6a3875cb087559e25744c29 WHIRLPOOL 60536e8e244ecdd1e307a8daa1bcd5728bd070b5c08063bf48fbcb93673c012497e257fe3c4f15019b0674e82724e48105d2799926572910370efb17dbbd6e21
DIST postgresql-9.5.4.tar.bz2 18496299 SHA256 cf5e571164ad66028ecd7dd8819e3765470d45bcd440d258b686be7e69c76ed0 SHA512 e5220bc967443d54b9dcff7ba5aefccedbe1c219f953eb0d67254c709d52b0e647d1dc473446640804165b596fc5b75fa4ff8d63696123b87d8096c3a7795c34 WHIRLPOOL d429d853062b2d2f8e999db1733b3206020f2d521401e0510376213ecaa2049b6d87987b9ee999ab81faacf6ce65ddfdcf43b0922fc23e91961594956c556e0d
DIST postgresql-9.6.0.tar.bz2 19157472 SHA256 3b5fe9634b80a4511aac1832a087586a7caa8c3413619562bdda009a015863ce SHA512 46ec903eed13bf5fb5510d56e4814405ba4510c9e5f43c533189b6ed07c7955dba326107ae0dbeebb5abdd00b7007971ca5d7213274bd653d8d4295f93e6cbf8 WHIRLPOOL aa5d30d41aca14eee3a00d5f3805b28187278a538c0f00b9cb70fad9e2c401dedc797512b9851a04c67f21e7b8cfbcf6d2f85c1486795803840b7111cccb2b19

@ -1,380 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
# Testing within Portage's environment is broken, and the patch no
# longer applies cleanly.
RESTRICT="test"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
epatch "${FILESDIR}/pg_ctl-exit-status.patch"
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}

@ -1,384 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
# Testing within Portage's environment is broken, and the patch no
# longer applies cleanly.
RESTRICT="test"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
epatch "${FILESDIR}/pg_ctl-exit-status.patch"
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}

@ -1,384 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
# Testing within Portage's environment is broken, and the patch no
# longer applies cleanly.
RESTRICT="test"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
epatch "${FILESDIR}/pg_ctl-exit-status.patch"
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}

@ -1,384 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
# Testing within Portage's environment is broken, and the patch no
# longer applies cleanly.
RESTRICT="test"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
epatch "${FILESDIR}/pg_ctl-exit-status.patch"
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.1-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-pre_9.2" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}

@ -1,394 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,394 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,394 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,394 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,399 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,399 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,399 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
uuid? ( dev-libs/ossp-uuid )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with kerberos krb5) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
$(use_with uuid ossp-uuid) \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,426 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
BSD_LIBC=( elibc_{Free,Net,Open}BSD )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
for i in ${BSD_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=bsd"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,431 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
BSD_LIBC=( elibc_{Free,Net,Open}BSD )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
for i in ${BSD_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=bsd"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,431 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
BSD_LIBC=( elibc_{Free,Net,Open}BSD )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
for i in ${BSD_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=bsd"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,431 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
BSD_LIBC=( elibc_{Free,Net,Open}BSD )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
for i in ${BSD_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=bsd"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,431 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
BSD_LIBC=( elibc_{Free,Net,Open}BSD )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
for i in ${BSD_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=bsd"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,437 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4,3_5} )
inherit eutils flag-o-matic linux-info multilib pam prefix python-single-r1 \
systemd user versionator
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
SLOT="$(get_version_component_range 1-2)"
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="http://www.postgresql.org/"
LINGUAS="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr
zh_CN zh_TW"
IUSE="doc kerberos kernel_linux ldap libressl nls pam perl -pg_legacytimestamp python
+readline selinux +server ssl static-libs tcl threads uuid xml zlib"
for lingua in ${LINGUAS}; do
IUSE+=" linguas_${lingua}"
done
wanted_languages() {
local enable_langs
for lingua in ${LINGUAS} ; do
use linguas_${lingua} && enable_langs+="${lingua} "
done
echo -n ${enable_langs}
}
CDEPEND="
>=app-eselect/eselect-postgresql-1.2.0
sys-apps/less
virtual/libintl
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap )
pam? ( virtual/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
ssl? (
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
libressl? ( dev-libs/libressl:= )
)
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,uclibc,musl} )
BSD_LIBC=( elibc_{Free,Net,Open}BSD )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}"
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
!!<sys-apps/sandbox-2.0
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
!dev-db/postgresql-docs:${SLOT}
!dev-db/postgresql-base:${SLOT}
!dev-db/postgresql-server:${SLOT}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
enewgroup postgres 70
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || epatch "${FILESDIR}/${PN}-${SLOT}-no-server.patch"
# Fix bug 486556 where the server would crash at start up because of
# an infinite loop caused by a self-referencing symlink.
epatch "${FILESDIR}/postgresql-9.2-9.4-tz-dir-overflow.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
epatch_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX%/}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
for i in ${BSD_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=bsd"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--docdir="${PO}/usr/share/doc/${PF}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !alpha spinlocks) \
$(use_enable !pg_legacytimestamp integer-datetimes) \
$(use_enable threads thread-safety) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
"$(use_enable nls nls "$(wanted_languages)")"
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
dodir /etc/eselect/postgresql/slots/${SLOT}
echo "postgres_ebuilds=\"\${postgres_ebuilds} ${PF}\"" > \
"${ED}/etc/eselect/postgresql/slots/${SLOT}/base"
use static-libs || find "${ED}" -name '*.a' -delete
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
docinto sgml
dodoc doc/src/sgml/*.{sgml,dsl}
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3" | newinitd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 0775 /run/postgresql
fi
fi
}
pkg_postinst() {
postgresql-config update
if use alpha && use server ; then
ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms."
ewarn "As a result, performance will be extremely degraded."
fi
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT%/}/etc/postgresql-${SLOT}/"
if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog
elog "It looks like this is your first time installing PostgreSQL. Run the"
elog "following command in all active shells to pick up changes to the default"
elog "environment:"
elog " source /etc/profile"
fi
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "http://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT%/}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT%/}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT%/}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT%/}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT%/}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT%/}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT%/}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
while [ "$correct" != "true" ] ; do
einfo "Are you ready to continue? (y/n)"
read answer
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
correct="true"
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
die "Aborting initialization."
else
echo "Answer not recognized"
fi
done
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
else
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -12,3 +12,5 @@ DIST slony1-2.2.3-docs.tar.bz2 1448128 SHA256 de073555cd1d39ad7a9204eb21a7b7bced
DIST slony1-2.2.3.tar.bz2 1468030 SHA256 1321988b437bd3294a07dc5ed85dfa3c35d9413287a49e4503ec47763fa1d3a8 SHA512 6f762ec722eb844d0c0c2923e2c1bee48c6fbf973cf719553a9f40b090e2ba08885cd089818b17c56a662fe5f35eadb4b060554adcd5abab5a1a250356590519 WHIRLPOOL 71686448418a09566c1b5767a598f5ebe943b33cba9664ec7696e70e5d62adc2daa5e2618a6aced0faeac0a621527738cdf2e54553a74dd1c5e08c6850d90e7a
DIST slony1-2.2.4-docs.tar.bz2 1448892 SHA256 0417194a9245e615dedc00ef463e1357df09b110ecab860ba45fef7e80dcf2cf SHA512 4a9ae11aaaa79d710b3454068eb92915fa6b96df5e6b9f532f2f0ddc51f2865d8928b94d2a496374f87435751574062987d14568d30e38e7e28535d1b4e845d6 WHIRLPOOL 096820fa5276b04d305cdfc17abaf7daf28b95caaa75e15c0807712733c343e37b0d30577a826fc061fc659c170e11079f6bee0a2fffff3ba605d3e02a8d59c1
DIST slony1-2.2.4.tar.bz2 1467776 SHA256 846a878f50de520d151e7f76a66d9b9845e94beb8820727bf84ab522a73e65b5 SHA512 951ecb07ae9f8478affeeb5c968530f597c203b24341b600057107f53adcdc53afce7dd21893700bb8d0ebd26fceb0ebc60917c9f5992b315a2bce47a1d57867 WHIRLPOOL 8a29c24e735f140a915779b81a9f8b5aeaa7c75a4dc122fb8ba322c10aa8be8dfe38ec853f38a503f595b7685759241a169c430cf2a9ef6ddb7ebaa1b3f4448e
DIST slony1-2.2.5-docs.tar.bz2 1449297 SHA256 7afd749215ca63d5f808c2c199096d4d665923b277edaf75b01e4a8bfdf90472 SHA512 cdd08fcea56f29e8e944cd975b613747cfcab75e70d88afdec79b2ede96dc2d1b35b294cd12c522780e513b4cd26c43da401d9570ca67759dbb2271797a380ac WHIRLPOOL 18206b34d03cb685389398f00d681707471b0cbf9cb3dcefb4cc99b24c35f37c10acc32e573a1c255f85881700efde9e1c8c3948596ebc84fbf5254af866b147
DIST slony1-2.2.5.tar.bz2 1466439 SHA256 6f6dbd9619c615ed68bf6341a8158e42fc0adf6f5b609e6f8e4a0a0e37815241 SHA512 06c5d8c136b1560aa6a3b1b7bfbad09fb6bbff7e3c530ceaf0279d4564dd1518c69647368deac9eb19ea5059a2d78fef26f62bd34315f5f3415ca0f5cb0992aa WHIRLPOOL 3b9b96c41fbe9da03362a866d3bc81da38be82625a9d25378b69cf322ba6aba05fc15f0725ba3f878e4a9d2b5e6609e50ad6d602f480e6e1482d1953135ecb14

@ -0,0 +1,62 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
inherit eutils versionator
IUSE="doc perl"
DESCRIPTION="A replication system for the PostgreSQL Database Management System"
HOMEPAGE="http://slony.info/"
# ${P}-docs.tar.bz2 contains man pages as well as additional documentation
MAJ_PV=$(get_version_component_range 1-2)
SRC_URI="http://main.slony.info/downloads/${MAJ_PV}/source/${P}.tar.bz2
http://main.slony.info/downloads/${MAJ_PV}/source/${P}-docs.tar.bz2"
LICENSE="BSD GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
DEPEND="|| (
dev-db/postgresql:9.6
dev-db/postgresql:9.5
dev-db/postgresql:9.4
dev-db/postgresql:9.3
dev-db/postgresql:9.2
dev-db/postgresql:9.1
)
dev-db/postgresql[server,threads]
perl? ( dev-perl/DBD-Pg )
"
pkg_setup() {
local PGSLOT="$(postgresql-config show)"
if [[ ${PGSLOT//.} < 91 ]] ; then
eerror "You must build ${CATEGORY}/${PN} against PostgreSQL 9.1 or higher."
eerror "Set an appropriate slot with postgresql-config."
die "postgresql-config not set to 9.1 or higher."
fi
}
src_configure() {
local myconf
use perl && myconf='--with-perltools'
econf ${myconf}
}
src_install() {
emake DESTDIR="${D}" install
dodoc INSTALL README SAMPLE TODO UPGRADING share/slon.conf-sample
if use doc ; then
cd "${S}"/doc
dohtml -r *
fi
newinitd "${FILESDIR}"/slony1.init slony1
newconfd "${FILESDIR}"/slony1.conf slony1
}

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -9,7 +9,7 @@ EAPI=5
CABAL_FEATURES="lib profile haddock hoogle hscolour"
inherit haskell-cabal
DESCRIPTION="Bifunctors"
DESCRIPTION="Haskell 98 bifunctors, bifoldables and bitraversables"
HOMEPAGE="https://github.com/ekmett/bifunctors/"
SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz"

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -9,7 +9,7 @@ EAPI=5
CABAL_FEATURES="lib profile haddock hoogle hscolour"
inherit haskell-cabal
DESCRIPTION="Bifunctors"
DESCRIPTION="Haskell 98 bifunctors, bifoldables and bitraversables"
HOMEPAGE="https://github.com/ekmett/bifunctors/"
SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz"

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -9,7 +9,7 @@ EAPI=5
CABAL_FEATURES="lib profile haddock hoogle hscolour"
inherit haskell-cabal
DESCRIPTION="Bifunctors"
DESCRIPTION="Haskell 98 bifunctors, bifoldables and bitraversables"
HOMEPAGE="https://github.com/ekmett/bifunctors/"
SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz"

@ -1,2 +1,4 @@
DIST leiningen-2.7.0-standalone.jar 15366772 SHA256 b0a53fd9fa73e9d87c04ef25ba1ca174b0c062b803108648d7157176ccde7435 SHA512 d42288c696d5b4d86c41a0ca9b8e748cdb9200c3adc23161b9b97b8c2f3da9c5bd811e2ddae265bf11d323b1449291e9914bf1e222aaf403e73ceef4084ed082 WHIRLPOOL d37e5a17680f08f7fae63051b6be7f8d12ee89d42bab1a6cafde6a4579b6d0ea4a772393031e286a57fc5b5d534674b0a270a32b39e9767a4dece70986bc94a4
DIST leiningen-2.7.0.sh 4301 SHA256 3865ce138f0a5f175819d6929203bfbd84377d8d5b7720af59c8cfde2289a2b2 SHA512 241357de3f19dfe1c729c14d1540140fccdd6a6c7bae76d6ccfe7a28cdff95b01f52a671ccd2d6712e11ff33115c720906e34a5118ff6bb6d232520d77125f5d WHIRLPOOL 52fe0420a7f8da17a8e01504a515627b85383f6c28e31c9317d4cb51c80fb1236149d30f5b8b0dd73c10157a73e8877f3d7e235da1e95b3b78709c96016d2a8d
DIST leiningen-2.7.1-standalone.jar 15370238 SHA256 2ddc7e89bbb45cf1ca3d666a10dce0d3f154b77ad201aa58f430e84e71587c47 SHA512 6f0ac01917b273c063dd16d8a5e98cba0265ba19766ce6a2c1e160367e3514e637c969f831384845e752cde015e1357eecac7141259e279584577f4f527bc08a WHIRLPOOL cdea21c8fef2ba1d7e4397d32ca1c4d5c7ffcf52ca088b8b1148c970c463ba219adbc11b208379659f3c255afbffe1edc7d82d38d67945fa85cdeb1713c3e3b0
DIST leiningen-2.7.1.sh 4581 SHA256 c04efcae827ee0883bdf44abef87b5bfa7da6f4b9864b5395dc341d60985ba66 SHA512 88e52f843a9b3cc4ebe2d8ffef1bec5e52a9e1e492d69b75c1482f7a97f6bcb766360502a5f1270ced1f4c1419af8b0cccd79219dc333a7305d3e4b58082d1e6 WHIRLPOOL 577044d1cdc931a695677fdc748ecafba656fbc66d8137a32ccf8cbadfd7dc137e45c91efd953e4efe9d55fbdabfafabbbc5f14be09d5415971814f5257c7a73

@ -0,0 +1,63 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
inherit java-pkg-2
MY_PN="${PN%-bin}"
MY_PNV="${MY_PN}-${PV}"
DESCRIPTION="Automate Clojure projects without setting your hair on fire"
HOMEPAGE="https://leiningen.org/"
SRC_URI="
https://github.com/technomancy/${MY_PN}/releases/download/${PV}/${MY_PNV}-standalone.zip -> ${MY_PNV}-standalone.jar
https://raw.githubusercontent.com/technomancy/${MY_PN}/${PV}/bin/lein-pkg -> ${MY_PNV}.sh
"
LICENSE="EPL-1.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND=">=virtual/jdk-1.6:*"
DEPEND=">=virtual/jdk-1.6:*"
RESTRICT="test"
src_unpack() {
mkdir -p "${S}" || die "Can't mkdir ${S}"
cd "${S}" || die "Can't enter ${S}"
for file in ${A}; do
einfo "Copying ${file}"
cp "${DISTDIR}/${file}" "${S}/" || die "Can't copy ${file}"
done
}
src_prepare() {
einfo "Copying leinrc"
cp "${FILESDIR}/leinrc" "${S}/" || die "Can't copy leinrc"
einfo "Patching leinrc"
sed -i "s^@@PN@@^${PN}^" "${S}/leinrc" || die "Can't patch leinrc"
einfo "Renaming lein-pkg"
# Rename generically to help user patching
mv "${S}/${MY_PNV}.sh" "${S}/lein" || die "Can't rename to lein"
einfo "Patching lein"
java-pkg_init_paths_
sed -i "s|^LEIN_JAR=.*$|LEIN_JAR=${JAVA_PKG_JARDEST}/${PN}.jar|" "${S}/lein" \
|| die "Can't patch LEIN_JAR in lein"
default
}
src_compile() { :; }
src_install() {
dobin "${S}/lein"
java-pkg_newjar "${MY_PNV}-standalone.jar"
insinto /etc
doins "${S}/leinrc"
fperms 0644 "/etc/leinrc"
}

@ -89,7 +89,7 @@ S="${WORKDIR}"
CDEPEND="~dev-java/netbeans-harness-${PV}
~dev-java/netbeans-platform-${PV}
dev-java/antlr:4
>=dev-java/antlr-4.5:4
dev-java/commons-compress:0
dev-java/commons-httpclient:3
dev-java/commons-logging:0

@ -12,7 +12,7 @@ SRC_URI="mirror://gentoo/${P}.tar.gz"
LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 ~x86"
IUSE="doc examples test"
RDEPEND=">=virtual/jdk-1.7:=

@ -30,7 +30,7 @@ COMMON="${PYTHON_DEPS}
sys-devel/clang
>=sys-devel/llvm-3.5
<sys-devel/llvm-3.8
x11-libs/libdrm[video_cards_intel]
<x11-libs/libdrm-2.4.71[video_cards_intel]
x11-libs/libXext
x11-libs/libXfixes"
RDEPEND="${COMMON}

@ -30,7 +30,7 @@ COMMON="${PYTHON_DEPS}
sys-devel/clang
>=sys-devel/llvm-3.5
<sys-devel/llvm-3.9
x11-libs/libdrm[video_cards_intel]
<x11-libs/libdrm-2.4.71[video_cards_intel]
x11-libs/libXext
x11-libs/libXfixes"
RDEPEND="${COMMON}

@ -1,2 +1 @@
DIST js_of_ocaml-2.8.1.tar.gz 1329825 SHA256 954ed80b3f37e10666e36ffa3c1d846e1913b8c7be9f0af79889f829b1333e1e SHA512 bce4b173c29396ce7f28f12afd3185cdf402150a7390b9f5a21f14f71e72b3e5ae16234ed65e9d7b18ed2c0de524b658495d62d4673dfe3e61d5f0556b5a125c WHIRLPOOL ac66e7fa70e7365dc5a404d95b9f14186d727756df3aaebfa5d433237d33cb1f070ad74db12136b2a2b2db75b3eac127729343838f361000f962f2a5bc309d79
DIST js_of_ocaml-2.8.2.tar.gz 1334891 SHA256 93d55c7a4883783acb3eee4c6a126993f548f1467d1f08a8d72fa30385a673c4 SHA512 07550311b53a54ec55b5b1e63acbf8eee4757d643cf9639efb035faa029cde4b47c46d732dd2fa3ec0606edf1ef094d096a375c694b0b7255ada16e0c632c4ed WHIRLPOOL 6eac8dccd5217aaa91dc3f899a6ec949afff725dcd1d60276660b0c2e4ca71faf2d55c0a747a3cab05ca55cf7962aa4dbcd2679ec4f8639c7ccbdf414a105d56

@ -1,57 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
inherit findlib eutils
DESCRIPTION="A compiler from OCaml bytecode to javascript"
HOMEPAGE="http://ocsigen.org/js_of_ocaml/"
SRC_URI="https://github.com/ocsigen/js_of_ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2.1-with-linking-exception"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="+async +ocamlopt doc +deriving +ppx +ppx-deriving +react +xml X"
RDEPEND="
>=dev-lang/ocaml-3.12:=[ocamlopt?,X?]
>=dev-ml/lwt-2.4.4:=
async? ( dev-ml/async_kernel:= )
react? ( dev-ml/react:= dev-ml/reactiveData:= )
xml? ( >=dev-ml/tyxml-4:= )
ppx? ( dev-ml/ppx_tools:= )
ppx-deriving? ( dev-ml/ppx_deriving:= )
dev-ml/cmdliner:=
dev-ml/menhir:=
dev-ml/ocaml-base64:=
dev-ml/camlp4:=
dev-ml/cppo:=
deriving? ( >=dev-ml/deriving-0.6:= )"
DEPEND="${RDEPEND}
dev-ml/ocamlbuild"
src_configure() {
printf "\n\n" >> Makefile.conf
use ocamlopt || echo "BEST := byte" >> Makefile.conf
use ocamlopt || echo "NATDYNLINK := NO" >> Makefile.conf
use deriving || echo "WITH_DERIVING := NO" >> Makefile.conf
use X || echo "WITH_GRAPHICS := NO" >> Makefile.conf
use react || echo "WITH_REACT := NO" >> Makefile.conf
use ppx || echo "WITH_PPX := NO" >> Makefile.conf
use ppx-deriving || echo "WITH_PPX_PPX_DERIVING := NO" >> Makefile.conf
use async || echo "WITH_ASYNC := NO" >> Makefile.conf
}
src_compile() {
emake -j1
use doc && emake doc
}
src_install() {
findlib_src_preinst
emake BINDIR="${ED}/usr/bin/" install
dodoc CHANGES README.md
use doc && dohtml -r doc/api/html/
}

@ -37,9 +37,9 @@ RDEPEND="
dev-ml/camlp4:=
dev-ml/cppo:=
dev-ml/uchar:=
dev-ml/ocamlbuild:=
deriving? ( >=dev-ml/deriving-0.6:= )"
DEPEND="${RDEPEND}
dev-ml/ocamlbuild"
DEPEND="${RDEPEND}"
src_configure() {
printf "\n\n" >> Makefile.conf

@ -37,9 +37,9 @@ RDEPEND="
dev-ml/camlp4:=
dev-ml/cppo:=
dev-ml/uchar:=
dev-ml/ocamlbuild:=
deriving? ( >=dev-ml/deriving-0.6:= )"
DEPEND="${RDEPEND}
dev-ml/ocamlbuild"
DEPEND="${RDEPEND}"
src_configure() {
printf "\n\n" >> Makefile.conf

@ -1 +1,2 @@
DIST ocamlbuild-0.9.2.tar.gz 163014 SHA256 257a3961da1aa47deb3de8da238ebe1daf13a73efef2228f97a064a90f91c6bc SHA512 6f6fa2ca0030256b61a9f93275f26327a032594a1ddd288e1eb9f4c41dfc139e4cdb6cd66ae8e383dd2f8aabb435181abfbf6b4aa0892ef6fa420c29e33b391a WHIRLPOOL 4b1285a3177787c9d4d1e4581dec4079a1144568512c8871b2ed9436bea941c9447130af616c418d7c18157f0818de26f6344635c7e63e4ec13acaa5229cf77a
DIST ocamlbuild-0.9.3.tar.gz 191583 SHA256 32e4824906888c61244909eab0d2c22d31f18fc9579873a070a4cf7947c2c0a9 SHA512 49ab3a13d48f8f554c85ebc8ce9cbc5a5e63112c2d50215a6f4be78cc21c6e93bd5d657ea45584cfbfa00d182d99adad0fbb706e8121b71ea3ecf4830fd947dd WHIRLPOOL 50dcc7146ea0cc567c955d01fc4d5fad36d056c8b99f74b5ee3cbc69d9a68a37c4448b3215430a5f39272375ade3917b168778e36f5d2e9308e41cc6b7afeb33

@ -4,7 +4,7 @@
EAPI=5
DESCRIPTION="OCamlbuild"
DESCRIPTION="Generic build tool with built-in rules for building OCaml library and programs"
HOMEPAGE="https://github.com/ocaml/ocamlbuild"
SRC_URI="https://github.com/ocaml/ocamlbuild/archive/${PV}.tar.gz -> ${P}.tar.gz"

@ -0,0 +1,34 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
DESCRIPTION="Generic build tool with built-in rules for building OCaml library and programs"
HOMEPAGE="https://github.com/ocaml/ocamlbuild"
SRC_URI="https://github.com/ocaml/ocamlbuild/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2.1-with-linking-exception"
SLOT="0/${PV}"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
IUSE="+ocamlopt"
DEPEND=">=dev-lang/ocaml-4.02.3-r1:=[ocamlopt?]"
RDEPEND="${DEPEND}
!<dev-ml/findlib-1.6.1-r1
"
src_configure() {
emake -f configure.make Makefile.config \
PREFIX="${EPREFIX}/usr" \
BINDIR="${EPREFIX}/usr/bin" \
LIBDIR="$(ocamlc -where)" \
OCAML_NATIVE=$(usex ocamlopt true false) \
OCAML_NATIVE_TOOLS=$(usex ocamlopt true false) \
NATDYNLINK=$(usex ocamlopt true false)
}
src_install() {
emake CHECK_IF_PREINSTALLED=false DESTDIR="${D}" install
dodoc Changes
}

@ -1 +0,0 @@
DIST qcheck-0.4.0.1.tar.gz 55783 SHA256 4c90f4babc35ed9672b9a48d69c480812b030e7194c617614a8b2d11d023ad65 SHA512 9a8476749ee5d97708d3f074e3c948511231aef8a49029c8d284a9d1413f2f5bb3b6bd048ec0998e4e762171626613a81f9275224ad16900094e735f4c82f057 WHIRLPOOL be8dcef3e6b8761fac35df1c41b2adc49f8afeaf7d06c1ba92ebba7ce6ac4a7f0fab213e2360277c074051f5ac48cad0b45069a6a1b8b3b3a6edcac72b769e21

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>tomboy64@sina.cn</email>
<name>M.B.</name>
<description>Maintainer, assign bugs to him</description>
</maintainer>
<maintainer type="project">
<email>ml@gentoo.org</email>
<name>Gentoo ML Project</name>
</maintainer>
<maintainer type="project">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<use>
<flag name="ounit">Enable integration with ounit</flag>
</use>
<upstream>
<remote-id type="github">c-cube/qcheck</remote-id>
</upstream>
</pkgmetadata>

@ -1,32 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
OASIS_BUILD_DOCS=1
inherit oasis
DESCRIPTION="QuickCheck inspired property-based testing for OCaml"
HOMEPAGE="https://github.com/c-cube/qcheck"
SRC_URI="https://github.com/c-cube/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+ounit"
RDEPEND="
ounit? ( >=dev-ml/ounit-2:= )
"
DEPEND="
${RDEPEND}
"
src_configure() {
oasis_configure_opts="
$(use_enable ounit)
" oasis_src_configure
}
DOCS=( CHANGELOG.md README.md )

@ -1 +1 @@
DIST stringext-1.4.2.tar.gz 49194 SHA256 1f0c108785ab4d80650748779fea38837a80fcf89f2b1ce9ccbbcc300134fdec SHA512 dd35b90d68f156ec6845fbd1c9b2c479874559696ea2a964c2b78a7ded61f128066a4752670b8db3c4dc0bde82fb6bce02733615c4950256c7071ae1c43b4b69 WHIRLPOOL c338647b23d426777c07febbe8494871471ee400cd8cb543f5d18a15c817986bd72a8e9028341e049cd7eb56427e3ca38d82939dbe981c98ec05ea4444c375f3
DIST stringext-1.4.3.tar.gz 49255 SHA256 d0695d0d97663f3e841f0b01ecfbe463018ba307118604914b71c601aca3e6a5 SHA512 f6d6ad9e6cd89fb499f2ef449eede448fe9d67912644f44ffadf4e869326bc20fd839d7e725a133e4a81ca8ba98497fd02307efb9f9f62cbad4308e18123ffb5 WHIRLPOOL 796a0572f1202cac6415ec148272971e9eb6fdf512644a21b7545483b647f1fd1b722a7634d6f9624d4bde9774152491dbe9d7713c32f9a1970b16d1d2cf87e5

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -16,12 +16,12 @@ SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE=""
DEPEND="
test? ( dev-ml/qcheck[ounit(-)] )
>=dev-lang/ocaml-4:=
"
RDEPEND="
>=dev-lang/ocaml-4:=
"
DEPEND="
${RDEPEND}
test? ( dev-ml/iTeML )
"
DOCS=( README.md )

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -16,7 +16,9 @@ IUSE="embedded test"
RDEPEND="dev-perl/DBI
dev-perl/Test-Deep
virtual/mysql[embedded?]"
virtual/libmysqlclient:=
embedded? ( virtual/mysql[embedded] )
"
DEPEND="${RDEPEND}"
src_prepare() {

@ -19,7 +19,8 @@ REQUIRED_USE="?? ( embedded ssl )"
IUSE="embedded test +ssl"
RDEPEND=">=dev-perl/DBI-1.609.0
virtual/mysql[embedded?]
virtual/libmysqlclient:=
embedded? ( virtual/mysql[embedded] )
"
DEPEND="${RDEPEND}
virtual/perl-ExtUtils-MakeMaker

@ -0,0 +1,69 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
DIST_AUTHOR=MICHIELB
DIST_VERSION=4.037
inherit eutils perl-module
DESCRIPTION="MySQL driver for the Perl5 Database Interface (DBI)"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
# embedded=on disables ssl support
# https://metacpan.org/source/MICHIELB/DBD-mysql-4.036/dbdimp.c#L1886
REQUIRED_USE="?? ( embedded ssl )"
IUSE="embedded test +ssl"
RDEPEND=">=dev-perl/DBI-1.609.0
virtual/libmysqlclient:=
embedded? ( virtual/mysql[embedded] )
"
DEPEND="${RDEPEND}
virtual/perl-ExtUtils-MakeMaker
virtual/perl-Data-Dumper
test? (
dev-perl/Test-Deep
>=virtual/perl-Test-Simple-0.900.0
virtual/perl-Time-HiRes
)
"
PATCHES=(
"${FILESDIR}"/${PN}-print_embedded_options.patch
)
src_configure() {
if use test; then
myconf="${myconf} --testdb=test \
--testhost=localhost \
--testuser=test \
--testpassword=test"
fi
myconf="${myconf} --$(usex ssl ssl nossl)"
use embedded && myconf="${myconf} --force-embedded --embedded=mysql_config"
perl-module_src_configure
}
# Parallel testing is broken as 2 tests create the same table
# and mysql isn't acid compliant and can't limit visibility of tables
# to a transaction...
DIST_TEST="do"
src_test() {
einfo
einfo "If tests fail, you have to configure your MySQL instance to create"
einfo "and grant some privileges to the test user."
einfo "You can run the following commands at the MySQL prompt: "
einfo "> CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';"
einfo "> CREATE DATABASE test;"
einfo "> GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost';"
einfo
sleep 5
perl_rm_files t/pod.t t/manifest.t
# Don't be a hero and try to do EXTENDED_TESTING=1 unless you can figure
# out why 60leaks.t fails
perl-module_src_test
}

@ -1,2 +1,3 @@
DIST DBD-mysql-4.032.tar.gz 146476 SHA256 b8e681e719d8f2d1cecb9e8603e13483b09b56508629b079022778e7dfd7bfb6 SHA512 7e7ebaed07f0540079854294cc3ab4a4554fd0f850dd0927b2485cc985c2c9f5b70a650d971027c883cc4d8450020245656f6ff1f792a56d1a2d4b45402d73d0 WHIRLPOOL 79b94c7c85406e0f3a0469c8017594f81f6151eab3059d483c50326222fdb920d12db04a5382dbdc2862cf853e1c421fe0d7acc4a35b131a0f9d39c2d79f5d0b
DIST DBD-mysql-4.036.tar.gz 146513 SHA256 5c48a823f86b8110ccb6504c6176ca248b52f56829dd4548bc39c3509f4154cf SHA512 2bfc5151b54559277f5e1949abc702eb373323998c641d199e3b2ba30f4b4ca449fc728fbd4f5ed05af53602e8f8772c2de9b1dd6db36f5af85a3c7799daab19 WHIRLPOOL db173ca8ce560bdbf4120b992c7ebb40feb73a3bd12b1a4f773a5ae7f4daadb77f65111cd3b97329470eaf1f9b7702d0a501180bb12ad622892126cb8e1fcd3d
DIST DBD-mysql-4.037.tar.gz 146639 SHA256 df578acef28ed3f6aaae52dc98e6821a1407d3bfa88585255729bb0ebfed3cfc SHA512 3bda6ea18d29e32028b7eb93cd06fdbabbadafa66f982556298a68980c42a7b5236872113696e6d2df66a345049d1e63bc90ab358c8631f0cbea187780e514af WHIRLPOOL 2cd51fb258de4877010d6d5f88a27f8e251d86b311d5d7dc3b62a46e7d6ac87facaad7c2bbba6c7f306d91d106e7a713fb21c2f1b7d2934e989aa30794d38a7f

@ -0,0 +1 @@
DIST hpack-2.3.0.tar.gz 41610 SHA256 51bd9aa8151efd190d70fe87991b1e3b79be0f93f0e34088fba2a8d34877a0a9 SHA512 a3d13da105482bb258ee3a2314b2629215028777f84127f71359f08819c96af088a3952bb0a74435472035d10ee6e3943cdad689a28f04cbc12cddcc4af9a8a7 WHIRLPOOL 8f47b6c2a78f915b009c35ecefa517486c27eb45f0b99834718152e14f9e934c23d52981c87b0c39af28fb9cb58d94e5eda07db2e999c37900b76b7aefd64b08

@ -0,0 +1,52 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy)
inherit distutils-r1
DESCRIPTION="Pure-Python HPACK header compression"
HOMEPAGE="http://python-hyper.org/hpack https://pypi.python.org/pypi/hpack"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc test"
RDEPEND=""
DEPEND="${RDEPEND}
doc? (
dev-python/sphinx[${PYTHON_USEDEP}]
)
test? (
>=dev-python/pytest-2.9.2[${PYTHON_USEDEP}]
>=dev-python/pytest-cov-2.3.0[${PYTHON_USEDEP}]
>=dev-python/pytest-xdist-1.14.0[${PYTHON_USEDEP}]
>=dev-python/hypothesis-3.4.2[${PYTHON_USEDEP}]
)
"
python_prepare_all() {
# Remove a test that is not part of the mainstream tests
# Also, it's data directory is not included in the release
rm test/test_hpack_integration.py || die
distutils-r1_python_prepare_all
}
python_compile_all(){
use doc && emake -C docs html
}
python_test() {
PYTHONPATH="${S}/test:${BUILD_DIR}/lib" \
py.test -v hpack test/|| die
cd test
}
python_install_all() {
use doc && HTML_DOCS=( docs/_build/html/. )
distutils-r1_python_install_all
}

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>Primary maintainer</description>
</maintainer>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<maintainer>
<email>cory@lukasa.co.uk</email>
<name>Cory Benfield</name>
</maintainer>
<remote-id type="pypi">hpack</remote-id>
</upstream>
<longdescription>This module contains a pure-Python HTTP/2 header encoding
(HPACK) logic for use in Python programs that implement HTTP/2. It
also contains a compatibility layer that automatically enables the use
of nghttp2 if its available.
</longdescription>
</pkgmetadata>

@ -0,0 +1 @@
DIST hyper-h2-2.4.0.tar.gz 77440 SHA256 c673efad0b8ee3c3c604375dd5e0c3dbc74f3c4e0385dae120d22b7d6f6ec301 SHA512 76835d6c97d4aed515b460bdbbcb8aea1ea061a416386cadf66a0e9b3c213a9ffe67948ce49b922d99e1895615a03159aa6aed198857e1ce73eb734b8bd9a016 WHIRLPOOL 9a5c1d313f53ee842403c77a8324aa432ff3d04d3d3737f6f7da83e5ff85e51ea6794419fa8886368cf34d4a7be3ff3b7ed19eb13a74ef8318fad738a71b9ef4

@ -0,0 +1,31 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy)
inherit distutils-r1
MY_PN="h2"
DESCRIPTION="HTTP/2 State-Machine based protocol implementation"
HOMEPAGE="http://python-hyper.org/h2 https://pypi.python.org/pypi/h2"
SRC_URI="mirror://pypi/${P:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="
>=dev-python/hyperframe-4.0.1[${PYTHON_USEDEP}]
<dev-python/hyperframe-5.0.0[${PYTHON_USEDEP}]
>=dev-python/hpack-2.2.0[${PYTHON_USEDEP}]
<dev-python/hpack-3.0.0[${PYTHON_USEDEP}]
$(python_gen_cond_dep '>=dev-python/enum34-1.0.4[${PYTHON_USEDEP}]' python2_7)
$(python_gen_cond_dep '<dev-python/enum34-2.0.0[${PYTHON_USEDEP}]' python2_7)
"
RDEPEND="${DEPEND}"
S=${WORKDIR}/${MY_PN}-${PV}

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>Primary maintainer</description>
</maintainer>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<maintainer>
<email>cory@lukasa.co.uk</email>
<name>Cory Benfield</name>
</maintainer>
<remote-id type="pypi">h2</remote-id>
</upstream>
<longdescription>A pure-Python implementation of a HTTP/2 protocol stack.
Its written from the ground up to be embeddable in whatever program
you choose to use, ensuring that you can speak HTTP/2 regardless of
your programming paradigm.
</longdescription>
</pkgmetadata>

@ -0,0 +1 @@
DIST hyperframe-4.0.1.tar.gz 16110 SHA256 8a57365b9c5046819fb7bb9c47eb4b44fd4385b976edf3518940f11725c04e43 SHA512 0970faf8711b12b4be2cb4a41b4be6d067eea57c40ee063e2ea0c15b148f1eed0214b29c9e8a4341ed453edd8679b55f290c3818157d66f247dc4ab8e3d369b9 WHIRLPOOL ad7283e6f70dabaf932ba77600ededeca357b6fb97ea3e32e2a9d687474bea15618dfc69b3ce8b4864563d05813472e0ddb6000c59f890b3c2fff4b2d8a4a500

@ -0,0 +1,20 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy)
inherit distutils-r1
DESCRIPTION="HTTP/2 framing layer for Python"
HOMEPAGE="http://python-hyper.org/hyperframe https://pypi.python.org/pypi/hyperframe"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=""
RDEPEND="${DEPEND}"

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>Primary maintainer</description>
</maintainer>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<maintainer>
<email>cory@lukasa.co.uk</email>
<name>Cory Benfield</name>
</maintainer>
<remote-id type="pypi">hyperframe</remote-id>
</upstream>
<longdescription>This library contains the HTTP/2 framing code used in the
hyper project. It provides a pure-Python codebase that is capable of
decoding a binary stream into HTTP/2 frames.
</longdescription>
</pkgmetadata>

@ -1,2 +1,3 @@
DIST hypothesis-1.19.0.tar.gz 86227 SHA256 0e977a3492f5488ed9dd4a872cefae0934ad4ccd0229a6c483ef5ca0aaaddd6d SHA512 3b2cd671498bd0bc88c93b2753f35b02f737533dd8dbc786420a37a417d145e4f1c579741966394f85b7df4939e61f77315e6158b29e22f9bde07d31e161e009 WHIRLPOOL 52b444e6e3fa0c514ebb9816cd489b2441b213581e241f76ab5aa5c410ca08bedef92f0b608c32c421f74ba84a0e26850a2aaf9f2d9f7229aa176d9e501175a0
DIST hypothesis-3.4.2.tar.gz 71270 SHA256 87a6b96670d52d9c30fff1342adec178822cd472775588d998bd860c05409688 SHA512 355815a11c57448a175a984d1ad6e87dcd9cc954acf312bfeff4ec499678166be6b9751173307748ff8b2d325b502cd31151e883e2a52f2d51a0395436bdb039 WHIRLPOOL 839bdc774f3889b0243119a81a9caa9eb29918dbf79ed7f5d7a1d15bab2e2ad6cfcd41948ab8b249c7bfecec3271aab99724b2eb2bde340136d9d9253f1fdeef
DIST hypothesis-3.5.3.tar.gz 73052 SHA256 25bdf9bd507f6c66b33c11c8c8ba31c3a6a6969e9b2035554fde69ceed84633d SHA512 1b22715e3ead84075d58c3e6ddfc074f542b2bce077e4e63fadd5910266bad81b3393b8a5c8d3b77e6f73e6987428fc92bd38a2d02003b5f490dd4ce08bca34c WHIRLPOOL 61ae670ca5167bdf5dae3fccb53bca9504d7470a6a5f159e5631b8a772da66f94ef5f0113029f189137757a70c261fb8ec2efdc2e92ab9060f19cdf4a1156698

@ -0,0 +1,33 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1
DESCRIPTION="A library for property based testing"
HOMEPAGE="https://github.com/DRMacIver/hypothesis https://pypi.python.org/pypi/hypothesis"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
$(python_gen_cond_dep 'dev-python/enum34[${PYTHON_USEDEP}]' python2_7)
dev-python/uncompyle6[${PYTHON_USEDEP}]
"
RDEPEND="${DEPEND}"
pkg_postinst() {
optfeature "datetime support" dev-python/pytz
optfeature "numpy support" dev-python/numpy
optfeature "django support" dev-python/django dev-python/pytz
optfeature "pytest support" dev-python/pytest
# optfeature "fake-factory support" dev-python/fake-factory
}

@ -0,0 +1 @@
DIST priority-1.2.0.tar.gz 12064 SHA256 70468e7f43c4bb19cd966d63f78367d8c5af68828611aa3f3e5d77b8948cd2d4 SHA512 00cac802a7d4a6960e71d6d5552c2649becb07e9bd124421b8a391f3681ecdfcc4928725cfffe1011143789b75b8660bd178dbef1f7ebfadd25057d9d7f22dee WHIRLPOOL b1a2d5d9f64e22f341d6ee8f0e0dc43e4fdd2cebb0330ff186be12dbf3e676a20e17b1e27dae1eb7679e6debffaed92eeb2cc88f45fc8180bbc13cca8df2b7e4

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>Primary maintainer</description>
</maintainer>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<maintainer>
<email>cory@lukasa.co.uk</email>
<name>Cory Benfield</name>
</maintainer>
<remote-id type="pypi">priority</remote-id>
</upstream>
<longdescription>Priority is a pure-Python implementation of the priority
logic for HTTP/2, set out in RFC 7540 Section 5.3 (Stream Priority).
This logic allows for clients to express a preference for how the
server allocates its (limited) resources to the many outstanding HTTP
requests that may be running over a single HTTP/2 connection.
</longdescription>
</pkgmetadata>

@ -0,0 +1,33 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy)
inherit distutils-r1
DESCRIPTION="A pure-Python implementation of the HTTP/2 priority tree"
HOMEPAGE="http://python-hyper.org/priority https://github.com/python-hyper/priority https://pypi.python.org/pypi/priority"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RDEPEND=""
DEPEND="
test? (
>=dev-python/pytest-2.9.2[${PYTHON_USEDEP}]
>=dev-python/pytest-cov-2.3.0[${PYTHON_USEDEP}]
>=dev-python/pytest-xdist-1.14.0[${PYTHON_USEDEP}]
>=dev-python/hypothesis-3.4.2[${PYTHON_USEDEP}]
)
"
python_test() {
PYTHONPATH="${S}/test:${BUILD_DIR}/lib" py.test -v || die "Tests failed under ${EPYTHON}"
cd test
}

@ -3,3 +3,4 @@ DIST pytest-cov-1.8.1.tar.gz 8649 SHA256 31e5198c06f290e1e813d30ddd063a0401d9e3a
DIST pytest-cov-2.1.0.tar.gz 25992 SHA256 6e86c3ae3be9930fa3f1402651819b00169fb5e963d29ed03d390d152a608506 SHA512 f763e611b19f6769183583d275e28467f7cc5cc8a8fe5a4d3eb798ddf8d4e008732ec8c29b757aaf0fba0f5a660d92729499f3d388693f631ba73cc7a570d738 WHIRLPOOL 1ece60dea2fc1ff2da342313a0e67ee63a63cf35ece930f92b59c2283522698df0be4c10fb6951d3afff9fb1acffd37d207dcc4f0400109cb4f8c830d69a5857
DIST pytest-cov-2.2.0.tar.gz 29965 SHA256 2231d43f07760d6904dadceabca53ab16ef95ba58fff393861b64c0cab96c9d1 SHA512 3e6a2b648b12eff3d8f0aad12dda35a05820f6073e7f87e9c92ed6cca00fe031750da8f6c37eb81cf6ca7b2e4975dafffd7e3e901cb7b91e5c53c83b6e6b8420 WHIRLPOOL 9feff5557af5f4101e9ae508febf3479472781544b54345d5f53f0f19df5f40eb5af4ada2b44037f590445761ee9d3bffe14d729c465f880951d714eeb6ae491
DIST pytest-cov-2.2.1.tar.gz 33154 SHA256 a8b22e53e7f3b971454c35df99dffe21f4749f539491e935c55d3ff7e1b284fa SHA512 8f20cf1c42b4415c7decf8407582e64045c599aedf1970160d02e35e723f56fa095af26ee4390eabf2d32e209898b0a3dae8b7212ac81ecda64d6dbc7c83f790 WHIRLPOOL 92386bd1ff532e0c98f1dc01b3583315a626a030fb4f38e39eb4f8755e83f3901873fdcd406f9c8bc6393040fa198cc416dae5e176e88084ed6fb16264d3c056
DIST pytest-cov-2.3.1.tar.gz 35378 SHA256 fa0a212283cdf52e2eecc24dd6459bb7687cc29adb60cb84258fab73be8dda0f SHA512 79770beb53fbb43b5d68311c2efd0accbfd890ab6dad299da8c1c0b3d26b54d984807313b1507900cda7004bfb50fedc0bd4341cfcfce47849a4f24fc8184f11 WHIRLPOOL 8b0fe223f0cbae0bb9c85b3d8d7f80456e164f3565bd7ba146b0eb34c1fd06c0447405dccd2642f0a4aec1819ff74277d2eb9b076e61438fbf69b35c472755e0

@ -0,0 +1,16 @@
diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py
index 6cbf341..614e53c 100644
--- a/tests/test_pytest_cov.py
+++ b/tests/test_pytest_cov.py
@@ -337,7 +337,10 @@ def test_central_nonspecific(testdir):
])
# multi-module coverage report
- assert any(line.startswith('TOTAL ') for line in result.stdout.lines[-4:])
+ # Fix test failure due to pytest deprecation warnings being
+ # added to the expected output. Look in entire output lines instead.
+ # assert any(line.startswith('TOTAL ') for line in result.stdout.lines[-4:])
+ assert any(line.startswith('TOTAL ') for line in result.stdout.lines[-10:])
assert result.ret == 0

@ -0,0 +1,61 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python{2_7,3_{4,5}} pypy )
inherit distutils-r1
DESCRIPTION="py.test plugin for coverage reporting"
HOMEPAGE="https://github.com/pytest-dev/pytest-cov https://pypi.python.org/pypi/pytest-cov"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc test"
RDEPEND="
>=dev-python/py-1.4.22[${PYTHON_USEDEP}]
>=dev-python/pytest-2.7.3[${PYTHON_USEDEP}]
>=dev-python/cov-core-1.14.0[${PYTHON_USEDEP}]
>=dev-python/coverage-3.7.1[${PYTHON_USEDEP}]
doc? (
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/sphinx-py3doc-enhanced-theme[${PYTHON_USEDEP}]
)
"
DEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/virtualenv[${PYTHON_USEDEP}]
dev-python/process-tests[${PYTHON_USEDEP}]
|| (
>=dev-python/pytest-2.8.0[${PYTHON_USEDEP}]
dev-python/pytest-cache[${PYTHON_USEDEP}]
)
=dev-python/pytest-xdist-1.15.0[${PYTHON_USEDEP}]
dev-python/pytest-capturelog[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/fix-for-deprecation-warnings.patch"
)
python_compile_all() {
use doc && sphinx-build -b html docs _build/html
}
python_test() {
PYTHONPATH="${S}/tests:${BUILD_DIR}/lib" \
PYTEST_PLUGINS=${PN/-/_} \
py.test -v -v -x || die "Tests failed under ${EPYTHON}"
}
python_install_all() {
use doc && HTML_DOCS=( _build/html/. )
distutils-r1_python_install_all
}

@ -1,2 +1,3 @@
DIST pytest-xdist-1.13.1.tar.gz 110007 SHA256 4382d7a944c1e2b1dc17fee3fd3575495fb10236a3b6e95cc6955db04984bc3c SHA512 3bb295c0afbcb0f238bdd41dfd1a395f0ba16b8151643aecc25aae13ac7c58d36d26ff4bab197673a9679d1f3436acd05b5ff50107b3128e647de892a6d04e3f WHIRLPOOL 643b23c755eb43c7b6965e588b58547c9ef63d3c225cddb97868c659ab3234bc6bc204575bc48c7f18a498cb0e595b8550928ba92ec5945a936e959f773504b3
DIST pytest-xdist-1.14.zip 106585 SHA256 4a5e1199122fa29e3017d8d189f59ccc5d82e841474ba2a1eec0e89606153623 SHA512 4cafae77736da6880e8dd42aaa91f68bbc959ff7dabcd231018b144b54f96ccf1b11abb09474e260876bbdf731053005fdbd348ac87461f303d8f8f7af643e36 WHIRLPOOL 7d1f57a6d5cbf08661254f3f47d72c3cfbe931f14985c4b24abb627bd10fdc3f2fa21d05085766c0ed425e74713f991b53bdde957bd64ea4f64a206c2f4feffc
DIST pytest-xdist-1.15.0.tar.gz 87799 SHA256 6238395f8bd050f9288a3b10f34330edece80f4424cf2b4204d6e7d622f0f00b SHA512 6429bd0c85024a2dcb453e4264f06d4a548637c4dcdeabf73d2b78a112ace70ff61cf0849a4845cc70a7650d10a99e5fe1087d3b7dba4b941ec0a771fc9338ed WHIRLPOOL 0454f615c24b14a86aba58c7bc9dbc2b43af82551ae3912358603450f0e3ac94e849eb2fc57bdda8bd1de5201111a3986d2c12c9f2923f4296718ffee84d661b

@ -0,0 +1,38 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy )
inherit distutils-r1
DESCRIPTION="Distributed testing and loop-on-failing modes"
HOMEPAGE="https://pypi.python.org/pypi/pytest-xdist https://github.com/pytest-dev/pytest-xdist2"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="MIT"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RDEPEND="
>=dev-python/execnet-1.1[${PYTHON_USEDEP}]
>=dev-python/pytest-2.4.2[${PYTHON_USEDEP}]
>=dev-python/py-1.4.22[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
dev-python/setuptools_scm[${PYTHON_USEDEP}]
test? (
dev-python/pexpect[${PYTHON_USEDEP}]
dev-python/pyflakes[${PYTHON_USEDEP}]
dev-python/readme[${PYTHON_USEDEP}]
)
"
python_test() {
find -name __pycache__ -exec rm -r '{}' + || die
py.test -vv -x || die "Tests failed under ${EPYTHON}"
}

@ -2,3 +2,4 @@ DIST pytest-2.7.2.tar.gz 532836 SHA256 b30457f735420d0000d10a44bbd478cf03f8bf20e
DIST pytest-2.8.2.tar.gz 563955 SHA256 da2fc57320dd11f621d166634c52b989aa2291af1296c32a27a11777aa4128b9 SHA512 0df6e0421d1575e1efc0bb0550c5993f802777cb616ab1514bf12ed11eb5ec35a142dd837ff65659989268c36e441e18108369991cd3d458d357aac6ba433991 WHIRLPOOL ea917f4aaec444d6edc830b4ec66f7adb305031f11328e47d12a609ec92368a5c56e9cf8e24bd1a9a4a6a0746b43133f0d9821cf27d74c15ed2a83a705ee6030
DIST pytest-2.8.7.tar.gz 564943 SHA256 fc4c86be54fce08e4b85b646a736efa18c6cde7599c1d2919f4f74629e018baf SHA512 c7f626ceb599811caeab4646389a2c489dd22d766c772d6ca686098cef9a11dca47ef41a4a4b811110f358bca1f1a678b549b2adfea48317ae70cf166289b371 WHIRLPOOL c3849f1a9f62c05c1ce20593f32ee513aee87853914be4099503cd47b068732df99605a0a4db9a3a7add4ef2a85f4d5376acf1a2e3f48f5d438433f200cb6196
DIST pytest-3.0.2.tar.gz 727551 SHA256 64d8937626dd2a4bc15ef0edd307d26636a72a3f3f9664c424d78e40efb1e339 SHA512 38485c73f9df3c76b7b920b6957ffe4fbfd32ca0c46b73a53375a40586a482d270bf71b4457b68d48815d50ad173824b269ece255692ae0d1b13f0b1885ce54f WHIRLPOOL b6954a95e5f7d9b904c7543a09c2ef237c76c3a35bcd3e24c402a02aec3b35a19cdb952ac38af4ce43ae516cb5ac52023a0d91f2c587343265edd6d493145e8a
DIST pytest-3.0.3.tar.gz 731934 SHA256 f213500a356800a483e8a146ff971ae14a8df3f2c0ae4145181aad96996abee7 SHA512 ec0b4a5f0d6673a339c5a70b402c004c23db7001005454329eeaea15d890f53b8f2740f6c6254499d0f915b9058bfdfa535d9f22847bb382a060d65204fce4af WHIRLPOOL 1883909fa23832e674cf912b1d88957dd435143dc124df5454c08ad02c8077473168f749ea94539c2c4b5cf08648a0bce7e90937bbdacd4bb69a4ccf15ecff23

@ -0,0 +1,72 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy )
inherit distutils-r1
DESCRIPTION="Simple powerful testing with Python"
HOMEPAGE="http://pytest.org/ https://pypi.python.org/pypi/pytest"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc test"
# When bumping, please check setup.py for the proper py version
PY_VER="1.4.29"
COMMON_DEPEND="
>=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]
doc? (
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/sphinx[${PYTHON_USEDEP}]
)
"
DEPEND="${COMMON_DEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
>=dev-python/hypothesis-3.5.2[${PYTHON_USEDEP}]
>dev-python/pytest-xdist-1.13[${PYTHON_USEDEP}]
dev-python/nose[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
)
"
RDEPEND="${COMMON_DEPEND}
!dev-python/logilab-common
"
python_prepare_all() {
chmod o-w *egg*/* || die
# Disable versioning of py.test script to avoid collision with
# versioning performed by the eclass.
sed -e "s/return points/return {'py.test': target}/" -i setup.py || die "sed failed"
grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
distutils-r1_python_prepare_all
}
python_test() {
# test_nose.py not written to suit py3.2 in pypy3
if [[ "${EPYTHON}" == pypy3 ]]; then
"${PYTHON}" "${BUILD_DIR}"/lib/pytest.py -x -v \
--ignore=testing/BUILD_nose.py \
|| die "tests failed with ${EPYTHON}"
else
"${PYTHON}" "${BUILD_DIR}"/lib/pytest.py -v testing || die "tests failed with ${EPYTHON}"
fi
}
python_compile_all(){
use doc && emake -C doc/en html
distutils-r1_python_compile_all
}
python_install_all() {
use doc && HTML_DOCS=( doc/en/_build/html/. )
distutils-r1_python_install_all
}

@ -0,0 +1,11 @@
Index: python_orocos_kdl/CMakeLists.txt
===================================================================
--- python_orocos_kdl.orig/CMakeLists.txt
+++ python_orocos_kdl/CMakeLists.txt
@@ -21,4 +21,4 @@ set(SIP_EXTRA_OPTIONS "-o")
set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_PACKAGES})
add_sip_python_module(PyKDL PyKDL/PyKDL.sip ${orocos_kdl_LIBRARIES})
-install(FILES package.xml DESTINATION share/python_orocos_kdl)
\ No newline at end of file
+install(FILES package.xml DESTINATION share/ros_packages/python_orocos_kdl)

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -32,7 +32,7 @@ RDEPEND="
dev-python/sip[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"
PATCHES=( "${FILESDIR}/py3.patch" )
PATCHES=( "${FILESDIR}/py3.patch" "${FILESDIR}/gentoo.patch" )
if [ "${PV#9999}" != "${PV}" ] ; then
S=${WORKDIR}/${P}/python_orocos_kdl

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -32,6 +32,7 @@ RDEPEND="
dev-python/sip[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"
PATCHES=( "${FILESDIR}/gentoo.patch" )
if [ "${PV#9999}" != "${PV}" ] ; then
S=${WORKDIR}/${P}/python_orocos_kdl

@ -1,4 +1 @@
DIST rospkg-1.0.38.tar.gz 89321 SHA256 1a1567d3e33c3910518dbfbb09760c499153b1c0ad6b8ddc5045488c11db43e4 SHA512 21cc9057a445b06db66b454e46c3ecdf8d83e54bbf4c204c63b13278dc93cdad60a80f4cab29eba7bc1811d43b406f91435499f7e58fa97814302dfb786f483e WHIRLPOOL 109e8d5ddc3f432c28959b7e6f15703aa2d67cd3ee524e4964e5388a7982b6aea144e5afcf0d22add230e33beb485ade0656025b77f2b56be75d313aa1e52870
DIST rospkg-1.0.39.tar.gz 89428 SHA256 36533bc98c57b0ee99b05b8e22160c1ee3393cd6aec7f87840b420ed7e8464cf SHA512 c68fe32479e6c800927c73bd6e35a9f644c550a79181525f16713683ad196f2ac0425e5f9eea8eff2ea919de39867b0f31c929f618804aaa93a234f28f16c579 WHIRLPOOL ad446b8f9d21443b7b3416065244964b94a9b0254dee119d7f70ddaaea8b2202401094d6c725629537d97f33429d0f63866dc4c5c7d098d2a8216382e946637a
DIST rospkg-1.0.40.tar.gz 39548 SHA256 ccd1d635319d41b79139b7336af64fc17a48a69ce0d728c1578c78f6350dbe1c SHA512 92a4760922b3d12850ab4a5ab8298048529d9cb427e85e3105b7b45e3c1f061351ee9611aa4b3ee29944e2d5185481b1d96593c04b25109156eb8e8aaafab0ea WHIRLPOOL e2b0b92228a03ed4d4e31d283f34708d99bb1f3d484a892a3d883110af9f63d78df46ef84c07c368250aba12955cd1f8cbea0db1d539fcf0b02951ec677159d2
DIST rospkg-1.0.41.tar.gz 89625 SHA256 19e0ebf751a716e312ad848ab2b545f6634d87573109b6164438db210f1f1c12 SHA512 d831ed5da8c5cf8d01cafcb83c879ef17647bdd8ec40f58e27766c5843bba118553daa932e18d9448120ce0be3e89f20a0ddd728c38ce47b2b3a41fb537123b5 WHIRLPOOL cb1e3a5dec83f0b1612df8dbbf46c845f970916259084fd9c2b8b80d0bb8ea0bc59bf064685461ec64637259c36cedb45f4f431656627beedfddf0c915ad4762

@ -1,64 +0,0 @@
commit c2e06e0ea0b4a1cbb67049ab77a80f53646fb0b2
Author: Alexis Ballier <aballier@gentoo.org>
Date: Tue Dec 23 12:27:19 2014 +0100
Add support for rospack_norecurse to avoid recursing into all subdirectories when looking for a package.
I am installing ros into /usr, hence this searches in /usr/share. I have a lot of directories, not ROS related, into /usr/share (e.g. a full TeX Live install), and I get these timings:
Without rospack_norecurse in /usr/share:
$ time rosversion rospack
2.2.5
real 0m2.861s
user 0m1.588s
sys 0m1.267s
With rospack_norecurse in /usr/share:
$ time rosversion rospack
2.2.5
real 0m0.135s
user 0m0.100s
sys 0m0.034s
This is on a desktop with a SSD drive. On an arm board, with much less packages in /usr/share but way much slower I/O I remember hitting the 10 seconds timeout for roscore to start.
diff --git a/src/rospkg/rospack.py b/src/rospkg/rospack.py
index e55acec..7ed98de 100644
--- a/src/rospkg/rospack.py
+++ b/src/rospkg/rospack.py
@@ -42,7 +42,7 @@ from .stack import parse_stack_file, InvalidStack
_cache_lock = Lock()
-def list_by_path(manifest_name, path, cache):
+def list_by_path(manifest_name, path, cache, recurse=True):
"""
List ROS stacks or packages within the specified path.
@@ -53,6 +53,7 @@ def list_by_path(manifest_name, path, cache):
:param manifest_name: MANIFEST_FILE or STACK_FILE, ``str``
:param path: path to list resources in, ``str``
:param cache: path cache to update. Maps resource name to directory path, ``{str: str}``
+ :param recurse: search recursively in subdirectories ``bool``
:returns: complete list of resources in ROS environment, ``[str]``
"""
resources = []
@@ -89,9 +90,15 @@ def list_by_path(manifest_name, path, cache):
# optimization for stacks.
del dirs[:]
continue #leaf
- elif 'rospack_nosubdirs' in files:
+ elif 'rospack_nosubdirs' in files or not recurse:
del dirs[:]
continue #leaf
+ elif 'rospack_norecurse' in files:
+ for sd in dirs:
+ spath = os.path.join(d, sd)
+ resources += list_by_path(manifest_name, spath, cache, False)
+ del dirs[:]
+ continue
# remove hidden dirs (esp. .svn/.git)
[dirs.remove(di) for di in dirs if di[0] == '.']
return resources

@ -1,56 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
SCM=""
if [ "${PV#9999}" != "${PV}" ] ; then
SCM="git-r3"
EGIT_REPO_URI="https://github.com/ros-infrastructure/rospkg"
fi
inherit ${SCM} distutils-r1
DESCRIPTION="Standalone Python library for the ROS package system"
HOMEPAGE="http://wiki.ros.org/rospkg"
if [ "${PV#9999}" != "${PV}" ] ; then
SRC_URI=""
KEYWORDS=""
# Needed for tests
S="${WORKDIR}/${PN}"
EGIT_CHECKOUT_DIR="${S}"
else
SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
https://github.com/ros-infrastructure/rospkg/archive/${PV}.tar.gz -> ${P}.tar.gz
"
KEYWORDS="~amd64 ~arm"
fi
LICENSE="BSD"
SLOT="0"
IUSE="test"
RDEPEND="dev-python/pyyaml[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
test? (
dev-python/nose[${PYTHON_USEDEP}]
dev-python/coverage[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/norecurse.patch"
)
python_test() {
nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
}
src_install() {
distutils-r1_src_install
# Avoid recursing into /usr/share when looking for packages.
dodir /usr/share
touch "${ED}/usr/share/rospack_norecurse"
}

@ -1,56 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
SCM=""
if [ "${PV#9999}" != "${PV}" ] ; then
SCM="git-r3"
EGIT_REPO_URI="https://github.com/ros-infrastructure/rospkg"
fi
inherit ${SCM} distutils-r1
DESCRIPTION="Standalone Python library for the ROS package system"
HOMEPAGE="http://wiki.ros.org/rospkg"
if [ "${PV#9999}" != "${PV}" ] ; then
SRC_URI=""
KEYWORDS=""
# Needed for tests
S="${WORKDIR}/${PN}"
EGIT_CHECKOUT_DIR="${S}"
else
SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
https://github.com/ros-infrastructure/rospkg/archive/${PV}.tar.gz -> ${P}.tar.gz
"
KEYWORDS="~amd64 ~arm"
fi
LICENSE="BSD"
SLOT="0"
IUSE="test"
RDEPEND="dev-python/pyyaml[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
test? (
dev-python/nose[${PYTHON_USEDEP}]
dev-python/coverage[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/norecurse.patch"
)
python_test() {
nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
}
src_install() {
distutils-r1_src_install
# Avoid recursing into /usr/share when looking for packages.
dodir /usr/share
touch "${ED}/usr/share/rospack_norecurse"
}

@ -1,56 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
SCM=""
if [ "${PV#9999}" != "${PV}" ] ; then
SCM="git-r3"
EGIT_REPO_URI="https://github.com/ros-infrastructure/rospkg"
fi
inherit ${SCM} distutils-r1
DESCRIPTION="Standalone Python library for the ROS package system"
HOMEPAGE="http://wiki.ros.org/rospkg"
if [ "${PV#9999}" != "${PV}" ] ; then
SRC_URI=""
KEYWORDS=""
# Needed for tests
S="${WORKDIR}/${PN}"
EGIT_CHECKOUT_DIR="${S}"
else
SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
https://github.com/ros-infrastructure/rospkg/archive/${PV}.tar.gz -> ${P}.tar.gz
"
KEYWORDS="~amd64 ~arm"
fi
LICENSE="BSD"
SLOT="0"
IUSE="test"
RDEPEND="dev-python/pyyaml[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
test? (
dev-python/nose[${PYTHON_USEDEP}]
dev-python/coverage[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/norecurse.patch"
)
python_test() {
nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
}
src_install() {
distutils-r1_src_install
# Avoid recursing into /usr/share when looking for packages.
dodir /usr/share
touch "${ED}/usr/share/rospack_norecurse"
}

@ -39,18 +39,7 @@ DEPEND="${RDEPEND}
dev-python/coverage[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/norecurse.patch"
)
python_test() {
nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
}
src_install() {
distutils-r1_src_install
# Avoid recursing into /usr/share when looking for packages.
dodir /usr/share
touch "${ED}/usr/share/rospack_norecurse"
}

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -39,18 +39,7 @@ DEPEND="${RDEPEND}
dev-python/coverage[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/norecurse.patch"
)
python_test() {
nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
}
src_install() {
distutils-r1_src_install
# Avoid recursing into /usr/share when looking for packages.
dodir /usr/share
touch "${ED}/usr/share/rospack_norecurse"
}

@ -0,0 +1 @@
DIST spark_parser-1.4.0.tar.gz 99006 SHA256 282fe0d19de48d5fda6148032e47c822e2f088a5ff050cb7544f2bc2e701ede4 SHA512 1236fcfabcf4b829f70db240fd76baabc79873c03e96d9fdd92e6c23661e144c1b32d317a51f96f683bc6f96763cac0989709e344e53410ae949d30305dfadef WHIRLPOOL 1e8bfc67950e973fc80313d53f3df0da90c083da4482de1e2fac0fb2eb8698140aa1fda93cb0018b127b42a11cd3e8f68b2bfed77f43df9ed392ba668363eba5

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>Primary maintainer</description>
</maintainer>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<maintainer>
<email>rb@dustyfeet.com</email>
<name>Rocky Bernstein</name>
</maintainer>
<remote-id type="pypi">spark_parser</remote-id>
</upstream>
<longdescription>SPARK stands for Scanning, Parsing, and Rewriting Kit.
It uses Jay Earlys algorithm for parsing context free grammars, and
comes with some generic Abstract Syntax Tree routines. There is also a
prototype scanner which does its job by combining Python regular
expressions.
</longdescription>
</pkgmetadata>

@ -0,0 +1,34 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy)
inherit distutils-r1
MY_PN="spark_parser"
DESCRIPTION="An Early-Algorithm Context-free grammar Parser"
HOMEPAGE="https://github.com/rocky/python-spark/ https://pypi.python.org/pypi/spark_parser"
SRC_URI="mirror://pypi/${P:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RDEPEND=""
DEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
>=dev-python/nose-1.0[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
)
"
S="${WORKDIR}/${MY_PN}-${PV}"
python_test() {
emake check
}

@ -0,0 +1 @@
DIST sphinx-py3doc-enhanced-theme-2.3.2.tar.gz 41894 SHA256 af600d39d4ffa6cb27d499730ac42af34045f5553ca5eadc087d865d6f32c602 SHA512 efeeaf1bbb7f5557f5e1500dd0a49aa001b714f329f594e95676d8833eede7eb5e0fa978257caeab9630360b05f48132ffb00137262c7a5b663cae6a009ed42d WHIRLPOOL b536517b64c398c9db7d664b633279915848f5741675e83362227d1905271dbda9b744ba6d09353c1a45c3cdb6f0b3f580a29b9d9e8da9a330aa0e821e51b643

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>Primary maintainer</description>
</maintainer>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<maintainer>
<email>contact@ionelmc.ro</email>
<name>Ionel Cristian Mărieș</name>
</maintainer>
<remote-id type="pypi">sphinx-py3doc-enhanced-theme</remote-id>
</upstream>
<longdescription></longdescription>
</pkgmetadata>

@ -0,0 +1,20 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python{2_7,3_{4,5}} pypy pypy3 )
inherit distutils-r1
DESCRIPTION="Enhanced Sphinx theme (based on Python 3 docs)"
HOMEPAGE="https://github.com/ionelmc/sphinx-py3doc-enhanced-theme https://pypi.python.org/pypi/sphinx-py3doc-enhanced-theme"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=""
RDEPEND="${DEPEND}"

@ -0,0 +1,2 @@
DIST Twisted-16.2.0.tar.bz2 2942537 SHA256 a090e8dc675e97fb20c3bb5f8114ae94169f4e29fd3b3cbede35705fd3cdbd79 SHA512 a1942c15a84946e8bd4833801fffe7be01443560209972e10043262fd17a73c5d0c50592bd037130b6a1de08d7223cbdc1e2398c8c67f559d42e3e8ec81df840 WHIRLPOOL f847d57b833f7fbd9135c4a07af163afaa1e7a821d3aa657b34b2b465540bdce6472682ec20d7f8244117e99a4301e485afe6a765c07b7b64ac9bc90a9592af4
DIST Twisted-16.3.2.tar.bz2 2916410 SHA256 22c32e68feb6be7ea68bcbc8f89184f06b5693a9f1b59d052927d19597645967 SHA512 6ddca880a06087717487d8a5cc128da81f1acbc97e5c372b1ba51eaeb87390ae7f91925e8e4cc90f29df21692bc11b6e0fe3772341b8488940895e57942e5149 WHIRLPOOL ad381b36f94351c15713e35d6312bae35c78ff90eb485892131f7db8c89168ccf5ddbc9d486bfeb47db695e75280bc73401194c6b36815c5859cc945d0191a7b

@ -0,0 +1,7 @@
# These are passed to twistd.
# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -y /etc/twistd.tac"
# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -f /etc/twistd.tap"
# Make any additions to PYTHONPATH the twistd needs here.
# PYTHONPATH="/path/to/extra/python/modules"

@ -0,0 +1,25 @@
#!/sbin/openrc-run
depend() {
need net
}
start() {
if [ -z "${TWISTD_OPTS}" ]; then
eerror "TWISTD_OPTS is not set!"
eerror "You need to configure twistd in /etc/conf.d/twistd."
return 1
fi
export PYTHONPATH
ebegin "Starting twistd"
start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \
--exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \
${TWISTD_OPTS}
eend $? "Failed to start twistd"
}
stop() {
ebegin "Stopping twistd"
start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid
eend $? "Failed to stop twistd"
}

@ -0,0 +1,11 @@
--- twisted/plugin.py
+++ twisted/plugin.py
@@ -174,7 +174,7 @@
if pluginKey not in existingKeys:
del dropinDotCache[pluginKey]
needsWrite = True
- if needsWrite:
+ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
try:
dropinPath.setContent(pickle.dumps(dropinDotCache))
except:

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<maintainer type="person">
<email>dol-sen@gentoo.org</email>
<description>maintainer</description>
</maintainer>
<upstream>
<maintainer>
<email>twisted-python@twistedmatrix.com</email>
<name>Twisted Matrix Laboratories</name>
</maintainer>
<remote-id type="pypi">Twisted</remote-id>
</upstream>
<use>
<flag name="conch">include Twisted SSHv2 implementation</flag>
<flag name="http2">include http2 support</flag>
<flag name="serial">include serial port support</flag>
</use>
<longdescription>Twisted is an event-based framework for internet
applications, supporting Python 2.7 and Python 3.3+. It includes
modules for many different purposes, including the following:
twisted.web: HTTP clients and servers, HTML templating, and a WSGI server
twisted.conch: SSHv2 and Telnet clients and servers and terminal emulators
twisted.words: Clients and servers for IRC, XMPP, and other IM protocols
twisted.mail: IMAPv4, POP3, SMTP clients and servers
twisted.positioning: Tools for communicating with NMEA-compatible GPS receivers
twisted.names: DNS client and tools for making your own DNS servers
twisted.trial: A unit testing framework that integrates well with Twisted-based code.
</longdescription>
</pkgmetadata>

@ -0,0 +1,126 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5})
PYTHON_REQ_USE="threads(+)"
TWISTED_PN="Twisted"
inherit eutils flag-o-matic twisted-r1
DESCRIPTION="An asynchronous networking framework written in Python"
SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~amd64 ~x86"
IUSE="conch crypt serial +soap test"
RDEPEND=">=dev-python/zope-interface-3.6.0[${PYTHON_USEDEP}]
conch? (
dev-python/gmpy[${PYTHON_USEDEP}]
dev-python/pyasn1[${PYTHON_USEDEP}]
>=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
)
crypt? (
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
dev-python/service_identity[${PYTHON_USEDEP}]
dev-python/idna[${PYTHON_USEDEP}]
)
serial? ( dev-python/pyserial[${PYTHON_USEDEP}] )
soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
"
DEPEND="
!dev-python/twisted-core
!dev-python/twisted-conch
!dev-python/twisted-mail
!dev-python/twisted-names
!dev-python/twisted-words
!dev-python/twisted-web
test? (
dev-python/gmpy[${PYTHON_USEDEP}]
dev-python/pyasn1[${PYTHON_USEDEP}]
>=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
dev-python/service_identity[${PYTHON_USEDEP}]
dev-python/idna[${PYTHON_USEDEP}]
dev-python/pyserial[${PYTHON_USEDEP}]
$(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7)
)
"
PATCHES=(
# Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
"${FILESDIR}/${PN}-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
)
python_prepare_all() {
# Remove some tests known to fail due to the network sandbox
rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
# Possibly due to over taxing of the distutils_install_for_testing function
rm twisted/python/test/test_release.py || die "rm twisted/python/test/test_release.py FAILED"
if [[ "${EUID}" -eq 0 ]]; then
# Disable tests failing with root permissions.
sed \
-e "s/test_newPluginsOnReadOnlyPath/_&/" \
-e "s/test_deployedMode/_&/" \
-i twisted/test/test_plugin.py
fi
distutils-r1_python_prepare_all
}
python_compile() {
if ! python_is_python3; then
# Needed to make the sendmsg extension work
# (see http://twistedmatrix.com/trac/ticket/5701 )
local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
fi
distutils-r1_python_compile
}
python_test() {
distutils_install_for_testing
pushd "${TEST_DIR}"/lib > /dev/null || die
if ! "${TEST_DIR}"/scripts/trial twisted; then
die "Tests failed with ${EPYTHON}"
fi
popd > /dev/null || die
}
python_install() {
distutils-r1_python_install
cd "${D%/}$(python_get_sitedir)" || die
# create 'Twisted' egg wrt bug #299736
#local egg=( Twisted_Core*.egg-info )
#[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
#ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
# own the dropin.cache so we don't leave orphans
touch twisted/plugins/dropin.cache || die
}
python_install_all() {
distutils-r1_python_install_all
newconfd "${FILESDIR}/twistd.conf" twistd
newinitd "${FILESDIR}/twistd.init" twistd
}
pkg_postinst(){
einfo "Install complete"
}
pkg_postrm(){
einfo ""
}

@ -0,0 +1,134 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5})
PYTHON_REQ_USE="threads(+)"
TWISTED_PN="Twisted"
inherit eutils flag-o-matic twisted-r1
DESCRIPTION="An asynchronous networking framework written in Python"
SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
# Dropped keywords due to new deps not keyworded
#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~amd64 ~x86"
IUSE="conch crypt http2 serial +soap test"
RDEPEND=">=dev-python/zope-interface-3.6.0[${PYTHON_USEDEP}]
conch? (
dev-python/gmpy[${PYTHON_USEDEP}]
dev-python/pyasn1[${PYTHON_USEDEP}]
>=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
)
crypt? (
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
dev-python/service_identity[${PYTHON_USEDEP}]
dev-python/idna[${PYTHON_USEDEP}]
)
serial? ( dev-python/pyserial[${PYTHON_USEDEP}] )
soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
http2? (
>=dev-python/hyper-h2-2.3.0[${PYTHON_USEDEP}]
<dev-python/hyper-h2-3.0[${PYTHON_USEDEP}]
>=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
<dev-python/priority-2.0[${PYTHON_USEDEP}]
)
!dev-python/twisted-core
!dev-python/twisted-conch
!dev-python/twisted-lore
!dev-python/twisted-mail
!dev-python/twisted-names
!dev-python/twisted-news
!dev-python/twisted-pair
!dev-python/twisted-runner
!dev-python/twisted-words
!dev-python/twisted-web
"
DEPEND="
test? (
dev-python/gmpy[${PYTHON_USEDEP}]
dev-python/pyasn1[${PYTHON_USEDEP}]
>=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
dev-python/service_identity[${PYTHON_USEDEP}]
dev-python/idna[${PYTHON_USEDEP}]
dev-python/pyserial[${PYTHON_USEDEP}]
)
"
PATCHES=(
# Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
"${FILESDIR}/${PN}-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
)
python_prepare_all() {
# Remove some tests known to fail due to the network sandbox
rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
# Possibly due to over taxing of the distutils_install_for_testing function
rm twisted/python/test/test_release.py || die "rm twisted/python/test/test_release.py FAILED"
if [[ "${EUID}" -eq 0 ]]; then
# Disable tests failing with root permissions.
sed \
-e "s/test_newPluginsOnReadOnlyPath/_&/" \
-e "s/test_deployedMode/_&/" \
-i twisted/test/test_plugin.py
fi
distutils-r1_python_prepare_all
}
python_compile() {
if ! python_is_python3; then
# Needed to make the sendmsg extension work
# (see http://twistedmatrix.com/trac/ticket/5701 )
local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
fi
distutils-r1_python_compile
}
python_test() {
distutils_install_for_testing
pushd "${TEST_DIR}"/lib > /dev/null || die
if ! "${TEST_DIR}"/scripts/trial twisted; then
die "Tests failed with ${EPYTHON}"
fi
popd > /dev/null || die
}
python_install() {
distutils-r1_python_install
cd "${D%/}$(python_get_sitedir)" || die
# create 'Twisted' egg wrt bug #299736
#local egg=( Twisted_Core*.egg-info )
#[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
#ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
# own the dropin.cache so we don't leave orphans
touch twisted/plugins/dropin.cache || die
}
python_install_all() {
distutils-r1_python_install_all
newconfd "${FILESDIR}/twistd.conf" twistd
newinitd "${FILESDIR}/twistd.init" twistd
}
pkg_postrm(){
# pre portage-2.3.2 release workaround for bug 595028
cd "${HOME}"
_distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache
}

@ -8,7 +8,7 @@ PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
inherit distutils-r1
DESCRIPTION="Compatibility API between asyncio/Twisted/Trollius"
HOMEPAGE="https://github.com/crossbario/txaio"
HOMEPAGE="https://github.com/crossbario/txaio https://pypi.python.org/pypi/txaio"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save