# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: inherit autotools eutils DESCRIPTION="A DNS-Server which gets its data from a MySQL-/PostgreSQL-database" HOMEPAGE="http://www.mydns.pl/" SRC_URI="http://switch.dl.sourceforge.net/sourceforge/mydns-ng/${P}.tar.gz" S=${WORKDIR}/${P%\.*} LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86" IUSE="alias debug nls postgres ssl static status zlib" RDEPEND="ssl? ( dev-libs/openssl ) zlib? ( sys-libs/zlib ) postgres? ( virtual/postgresql-server ) !postgres? ( virtual/mysql ) virtual/libiconv" DEPEND="${RDEPEND} sys-devel/bison" src_compile() { local myconf="--with-included-gettext" if use postgres; then myconf="${myconf} --without-mysql --with-pgsql" else myconf="${myconf} --with-mysql" fi econf \ $(use_enable alias) \ $(use_enable nls) \ $(use_enable debug) \ $(use_enable static) \ $(use_enable static static-build) \ $(use_enable status) \ $(use_with ssl openssl) \ $(use_with zlib) \ ${myconf} || die emake || die } src_install() { emake DESTDIR="${D}" install || die dodoc AUTHORS BUGS COPYING ChangeLog NEWS README TODO contrib/admin.php contrib/stats.php contrib/create_domain.pl contrib/fix_rr_serial.pl contrib/MyDNS.pm contrib/README if use postgres; then sed -e 's/__db__/postgresql/g' "${FILESDIR}/mydns.rc6" > "${T}/mydns.rc6" || die dodoc QUICKSTART.postgres else sed -e 's/__db__/mysql/g' "${FILESDIR}/mydns.rc6" > "${T}/mydns.rc6" || die dodoc QUICKSTART.mysql README.mysql fi newinitd "${T}/mydns.rc6" mydns || die ## Avoid file collision rm -f "${D}/usr/share/locale/locale.alias" ## Install config file insinto /etc newins mydns.conf mydns.conf fowners root:root /etc/mydns.conf fperms 0600 /etc/mydns.conf } pkg_postinst() { if use postgres; then elog "# createdb mydns" elog "# /usr/sbin/mydns --create-tables | psql mydns" elog elog "to create the tables in the PostgreSQL-Database." elog "For more info see QUICKSTART.postgres." else elog "# mysqladmin -u -p create mydns" elog "# /usr/sbin/mydns --create-tables | mysql -u -p mydns" elog elog "to create the tables in the MySQL-Database." elog "For more info see QUICKSTART.mysql." fi elog }