# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 inherit eutils cmake-utils systemd user 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="~amd64 ~x86" # big-endian issues to be fixed in uhub-0.4.2 IUSE="+ssl" DEPEND="dev-db/sqlite:3 dev-lang/perl ssl? ( dev-libs/openssl )" RDEPEND="${DEPEND}" pkg_setup() { enewuser uhub } src_prepare() { epatch "${FILESDIR}/${P}-libsuffix.patch" } 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 || die "could not chdir to ${S}/doc" insinto /etc/uhub doins users.conf dodoc architecture.txt extensions.txt getstarted.txt doman uhub.1 uhub-passwd.1 } pkg_postinst() { elog "To create an intial user database, run 'emerge --config net-p2p/uhub'. " elog "See /usr/share/doc/${P}/getstarted.txt.bz2 and 'man 1 uhub-passwd' " elog "for more information." if use ssl; then einfo "For documentation on TLS configuration see " einfo "https://www.uhub.org/doc/config_ssl.php" fi } pkg_config() { 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 }