# Distributed under the terms of the GNU General Public License v2 EAPI="1" inherit eutils autotools subversion DESCRIPTION="NetXMS is new and rapidly developing monitoring system" HOMEPAGE="http://netxms.org/" SRC_URI="" RESTRICT="mirror" IUSE="server client console +agent nxhttpd mdebug sqlite odbc oracle mysql pgsql openssl gd unstable debug" SLOT="" LICENSE="GPL-2" KEYWORDS="" ESVN_REPO_URI="https://svn.netxms.org/public/netxms/trunk" ESVN_STORE_DIR="${DISTDIR}/svn-src" ESVN_PROJECT="${PN/-svn}" ESVN_BOOTSTRAP="./reconf" RDEPEND="${DEPEND} " DEPEND="${COMMON_DEPEND} sys-devel/autoconf:2.5 sys-devel/automake:1.10 mysql? ( virtual/mysql ) openssl? ( dev-libs/openssl ) postgres? ( virtual/postgresql-base ) console? ( x11-libs/wxGTK ) gd? ( media-libs/gd ) sqlite? ( >=dev-db/sqlite-3 ) " S="${WORKDIR}/${P/_/}" src_unpack(){ subversion_src_unpack cd "${S}" # eautoreconf } src_compile() { econf \ $(useq server && echo --with-server ) \ $(useq client && echo --with-client ) \ $(useq agent && echo --with-agent ) \ $(useq console && echo --with-console ) \ $(useq nxhttpd && echo --with-nxhttpd ) \ $(useq mdebug && echo --with-mdebug ) \ $(useq sqlite && echo --with-sqlite ) \ $(useq odbc && echo --with-odbc ) \ $(useq oracle && echo --with-oracle ) \ $(useq mysql && echo --with-mysql ) \ $(useq pgsql && echo --with-pgsql ) \ $(use_enable openssl encryption) \ $(useq gd && echo --with-gd ) \ $(useq unstable && echo --enable-unstable ) \ $(useq debug && echo --enable-debug ) || die "econf failed" emake CONFDIR="/etc/netxms" || die "emake failed" } src_install() { emake DESTDIR="${D}" CONFDIR="${D}/etc/netxms" install || die "install failed" } pkg_postinst() { dodir /etc/netxms keepdir /etc/netxms if ( use server ) then if ( test -e /etc/netxms/netxmsd.conf ) then elog "Keeping your existing config /etc/netxms/netxmsd.conf" else elog "Installing initial server config file to /etc/netxms/netxmsd.conf" cp ${FILESDIR}/netxmsd.conf /etc/netxms/netxmsd.conf fi fi if ( use agent ) then if ( test -e /etc/netxms/nxagentd.conf ) then elog "Keeping your existing config /etc/netxms/nxagentd.conf" else elog "Installing initial server config file to /etc/netxms/nxagentd.conf" cp ${FILESDIR}/nxagentd.conf /etc/netxms/nxagentd.conf fi fi $(useq server && cp ${FILESDIR}/netxmsd /etc/init.d/netxmsd ) $(useq agent && cp ${FILESDIR}/nxagentd /etc/init.d/nxagentd ) elog elog "Startup scripts installed to /etc/init.d" elog }