1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 CMAKE_IN_SOURCE_BUILD=1
8 inherit cmake-utils user wxwidgets
14 DESCRIPTION="${MY_PN} is a job scheduler for PostgreSQL"
15 HOMEPAGE="http://www.pgadmin.org/download/pgagent.php"
16 SRC_URI="https://ftp.postgresql.org/pub/pgadmin3/release/${PN}/${MY_PN}-${PV}-Source.tar.gz"
17 LICENSE="POSTGRESQL GPL-2"
21 RDEPEND="dev-db/postgresql:*
22 x11-libs/wxGTK:${WX_GTK_VER}"
25 S="${WORKDIR}/${MY_PN}-${PV}-Source"
28 "${FILESDIR}/fix-dbconn-getlasterror-crash.patch"
29 "${FILESDIR}/save-stderr-jobstep-output.patch"
30 "${FILESDIR}/add-log-timestamps.patch"
31 "${FILESDIR}/fix-job-success-test.patch"
32 "${FILESDIR}/postgres-10-build-fix.patch"
36 cmake-utils_src_prepare
38 sed -e "s:share):share/${P}):" \
39 -i CMakeLists.txt || die "failed to patch CMakeLists.txt"
40 sed -i -e '/SET(WX_VERSION "2.8")/d' CMakeLists.txt || die
44 if has_version "x11-libs/wxGTK[X]"; then
45 need-wxwidgets unicode
47 need-wxwidgets base-unicode
49 mycmakeargs=( "-DSTATIC_BUILD:BOOLEAN=FALSE"
50 "-DWX_VERSION=${WX_GTK_VER}" )
51 cmake-utils_src_configure
55 cmake-utils_src_install
57 newinitd "${FILESDIR}/pgagent.initd-r1" "${PN}"
58 newconfd "${FILESDIR}/pgagent.confd" "${PN}"
60 rm "${ED}"/usr/{LICENSE,README} || die "failed to remove useless docs"
64 # This user needs a real shell, and the daemon will use the
65 # ~/.pgpass file from its home directory.
66 enewuser pgagent -1 /bin/bash /home/pgagent
70 if [[ -n "${REPLACING_VERSIONS}" ]]; then
71 # This warning can be removed around a year after this version
73 ewarn 'pgAgent now runs as a dedicated "pgagent" user (as'
74 ewarn 'opposed to root). You may need to move your /root/.pgpass'
75 ewarn 'file to /home/pgagent/.pgpass, and the new user will'
76 ewarn 'need permissions on any paths that it will access.'