# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 inherit eutils cmake-utils systemd DESCRIPTION="High performance peer-to-peer hub for the ADC network." HOMEPAGE="https://www.uhub.org/" SRC_URI="http://www.extatic.org/downloads/uhub/${P}-src.tar.bz2" LICENSE="GPL-3" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="+ssl" DEPEND="dev-db/sqlite:3 dev-lang/perl ssl? ( dev-libs/openssl )" RDEPEND="${DEPEND}" #REQUIRED_USE="gnutls? ( !openssl )" pkg_setup() { enewuser uhub } src_configure() { local mycmakeargs=( $(cmake-utils_use ssl SSL_SUPPORT) $(cmake-utils_use ssl USE_OPENSSL) ) cmake-utils_src_configure } src_install() { keepdir /etc/uhub cmake-utils_src_install newinitd "${FILESDIR}/${PN}.runscript" ${PN} systemd_dounit "${FILESDIR}/${PN}.service" dodoc AUTHORS BUGS README cd doc insinto /etc/uhub doins users.conf dodoc architecture.txt dodoc getstarted.txt dodoc extensions.txt doman uhub.1 doman uhub-passwd.1 } pkg_postinst() { local users_file="${ROOT}/etc/uhub/users.db" if [[ ! -e ${users_file} ]]; then ebegin "Generating ${users_file}" uhub-passwd ${users_file} create eend ${?} elog "Empty ${users_file} created with $(umask -S) permissions." fi local motd_file="${ROOT}/etc/uhub/motd.txt" if [[ ! -e ${motd_file} ]]; then ebegin "Creating empty ${motd_file}" touch ${motd_file} eend ${?} fi if use ssl; then einfo "For documentation on TLS configuration see " einfo "https://www.uhub.org/doc/config_ssl.php" fi }