2014-05-21 23:43:52 +02:00
|
|
|
# Copyright 1999-2013 Gentoo Foundation
|
2013-09-28 01:18:49 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2014-05-21 23:43:52 +02:00
|
|
|
# $Header: $
|
2013-09-28 01:18:49 +02:00
|
|
|
|
2014-05-21 23:43:52 +02:00
|
|
|
EAPI=5
|
2013-09-28 01:18:49 +02:00
|
|
|
|
2014-05-21 23:43:52 +02:00
|
|
|
inherit eutils pax-utils user flag-o-matic multilib autotools pam systemd versionator
|
2013-09-28 01:18:49 +02:00
|
|
|
|
2014-05-27 00:23:05 +02:00
|
|
|
DESCRIPTION="Sync files & folders using BitTorrent protocol"
|
2013-09-28 01:18:49 +02:00
|
|
|
HOMEPAGE="http://labs.bittorrent.com/experiments/sync.html"
|
2014-05-21 23:43:52 +02:00
|
|
|
SRC_URI="amd64? ( http://syncapp.bittorrent.com/${PV}/${PN}_x64-${PV}.tar.gz )
|
|
|
|
x86? ( http://syncapp.bittorrent.com/${PV}/${PN}_i386-${PV}.tar.gz )
|
|
|
|
ppc? ( http://syncapp.bittorrent.com/${PV}/${PN}_powerpc-${PV}.tar.gz )
|
|
|
|
arm? ( http://syncapp.bittorrent.com/${PV}/${PN}_arm-${PV}.tar.gz )"
|
2013-09-28 01:18:49 +02:00
|
|
|
|
2013-09-28 02:56:52 +02:00
|
|
|
RESTRICT="mirror strip"
|
2013-09-28 01:18:49 +02:00
|
|
|
LICENSE="BitTorrent"
|
|
|
|
SLOT="0"
|
2014-05-21 23:43:52 +02:00
|
|
|
KEYWORDS="amd64 ~x86 ~arm ~ppc"
|
2013-09-28 01:18:49 +02:00
|
|
|
IUSE=""
|
|
|
|
|
|
|
|
DEPEND=""
|
|
|
|
RDEPEND="${DEPEND}"
|
|
|
|
|
2013-09-28 02:56:52 +02:00
|
|
|
S="${WORKDIR}"
|
2013-09-28 01:18:49 +02:00
|
|
|
|
2014-05-27 00:23:05 +02:00
|
|
|
QA_PREBUILT="/opt/${PN}/"
|
2013-10-14 18:16:16 +02:00
|
|
|
|
2013-09-28 01:18:49 +02:00
|
|
|
src_install() {
|
2014-05-21 23:43:52 +02:00
|
|
|
dodoc "${S}"/LICENSE.TXT
|
|
|
|
|
2014-05-27 00:23:05 +02:00
|
|
|
doconfd "${FILESDIR}/conf.d/${PN}"
|
|
|
|
"${S}/${PN}" --dump-sample-config | sed 's:/home/user/\.sync:/var/lib/btsync:g' > "${PN}.conf"
|
2014-05-21 23:43:52 +02:00
|
|
|
insinto /etc
|
2014-05-27 00:23:05 +02:00
|
|
|
doins "${PN}.conf"
|
2014-05-21 23:43:52 +02:00
|
|
|
|
|
|
|
# system-v-init support
|
2014-05-27 00:23:05 +02:00
|
|
|
doinitd "${FILESDIR}/init.d/${PN}"
|
2014-05-21 23:43:52 +02:00
|
|
|
|
|
|
|
# systemd support
|
|
|
|
systemd_dounit "${FILESDIR}/btsync.service"
|
|
|
|
systemd_dounit "${FILESDIR}/btsync@.service"
|
|
|
|
systemd_dounit "${FILESDIR}/btsync_user.service"
|
2014-05-27 00:23:05 +02:00
|
|
|
|
|
|
|
exeinto "/opt/${PN}/"
|
|
|
|
doexe "${PN}"
|
2013-10-16 02:27:55 +02:00
|
|
|
}
|
|
|
|
|
2014-05-21 23:43:52 +02:00
|
|
|
pkg_preinst() {
|
2014-05-27 00:23:05 +02:00
|
|
|
enewgroup "${PN}"
|
|
|
|
enewuser "${PN}" -1 -1 /dev/null "${PN}"
|
|
|
|
dodir "/run/${PN}"
|
|
|
|
fowners "${PN}":"${PN}" "/run/${PN}"
|
2014-05-21 23:43:52 +02:00
|
|
|
}
|
2013-10-16 03:48:58 +02:00
|
|
|
|
2014-05-21 23:43:52 +02:00
|
|
|
pkg_postinst() {
|
|
|
|
einfo "Auto-generated configuration file is located at /etc/btsync.conf"
|
|
|
|
einfo "(use this file as a template for user-level privilege service units)"
|
|
|
|
einfo ""
|
|
|
|
einfo "systemd"
|
|
|
|
einfo "btsync.service:"
|
|
|
|
einfo " run as a system service as user/group btsync:btsync"
|
|
|
|
einfo " use /var/lib/btsync for btsync working data"
|
|
|
|
einfo "btsync@<user>.service"
|
|
|
|
einfo " run as a system service but with user privilege"
|
|
|
|
einfo " use /home/<user>/.config/btsync/btsync.conf for btsync working data"
|
|
|
|
einfo "btsync_user.service"
|
|
|
|
einfo " run as a standard user service"
|
|
|
|
einfo " use /home/<user>/.config/btsync/btsync.conf for btsync working data"
|
|
|
|
einfo ""
|
|
|
|
einfo "Ensure you open the following ports in your firewall:"
|
|
|
|
einfo " btsync.conf specified listening port (UDP/TCP)"
|
|
|
|
einfo " port 3838 (UDP) for DHT tracking"
|
2013-10-14 18:16:16 +02:00
|
|
|
}
|