2014-05-21 22:43:52 +01:00
|
|
|
# Copyright 1999-2013 Gentoo Foundation
|
2014-02-26 02:04:35 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2014-05-21 22:43:52 +01:00
|
|
|
# $Header: $
|
2014-02-26 02:04:35 +02:00
|
|
|
|
2014-05-21 22:43:52 +01:00
|
|
|
EAPI=5
|
2014-02-26 02:04:35 +02:00
|
|
|
|
2014-05-21 22:43:52 +01:00
|
|
|
inherit eutils pax-utils user flag-o-matic multilib autotools pam systemd versionator
|
2014-02-26 02:04:35 +02:00
|
|
|
|
2014-05-26 23:23:05 +01:00
|
|
|
DESCRIPTION="Sync files & folders using BitTorrent protocol"
|
2014-02-26 02:04:35 +02:00
|
|
|
HOMEPAGE="http://labs.bittorrent.com/experiments/sync.html"
|
2014-05-21 22:43:52 +01: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 )"
|
2014-02-26 02:04:35 +02:00
|
|
|
|
|
|
|
RESTRICT="mirror strip"
|
|
|
|
LICENSE="BitTorrent"
|
|
|
|
SLOT="0"
|
2014-05-21 22:43:52 +01:00
|
|
|
KEYWORDS="amd64 ~x86 ~arm ~ppc"
|
2014-02-26 02:04:35 +02:00
|
|
|
IUSE=""
|
|
|
|
|
|
|
|
DEPEND=""
|
|
|
|
RDEPEND="${DEPEND}"
|
|
|
|
|
|
|
|
S="${WORKDIR}"
|
|
|
|
|
2014-05-26 23:23:05 +01:00
|
|
|
QA_PREBUILT="/opt/${PN}/"
|
2014-02-26 02:04:35 +02:00
|
|
|
|
|
|
|
src_install() {
|
2014-06-23 22:12:04 +01:00
|
|
|
dodoc "${S}/LICENSE.TXT"
|
2014-05-21 22:43:52 +01:00
|
|
|
|
2014-06-23 22:12:04 +01:00
|
|
|
newconfd "${FILESDIR}/${PN}_confd" "/${PN}"
|
2014-05-21 22:43:52 +01:00
|
|
|
|
|
|
|
# system-v-init support
|
2014-06-23 22:12:04 +01:00
|
|
|
newinitd "${FILESDIR}/${PN}_initd" "/${PN}"
|
2014-05-21 22:43:52 +01:00
|
|
|
|
|
|
|
# systemd support
|
2014-06-23 22:12:04 +01:00
|
|
|
systemd_dounit "${FILESDIR}/${PN}.service"
|
|
|
|
systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
|
2014-06-25 16:34:56 +01:00
|
|
|
#systemd_newuserunit "${FILESDIR}/${PN}_user.service" "${PN}.service"
|
2014-06-23 22:12:04 +01:00
|
|
|
insinto "$(systemd_get_userunitdir)"
|
|
|
|
newins "${FILESDIR}/${PN}_user.service" "${PN}.service"
|
2014-05-26 23:23:05 +01:00
|
|
|
|
2014-06-23 22:12:04 +01:00
|
|
|
exeinto "/opt/${PN}/bin/"
|
|
|
|
doexe "${FILESDIR}/${PN}_setup"
|
2014-05-26 23:23:05 +01:00
|
|
|
doexe "${PN}"
|
2014-02-26 02:04:35 +02:00
|
|
|
}
|
|
|
|
|
2014-05-21 22:43:52 +01:00
|
|
|
pkg_preinst() {
|
2014-05-26 23:23:05 +01:00
|
|
|
enewgroup "${PN}"
|
2014-06-25 16:34:56 +01:00
|
|
|
enewuser "${PN}" -1 -1 -1 "${PN}"
|
2014-05-26 23:23:05 +01:00
|
|
|
dodir "/run/${PN}"
|
|
|
|
fowners "${PN}":"${PN}" "/run/${PN}"
|
2014-06-23 22:12:04 +01:00
|
|
|
dodir "/var/lib/${PN}"
|
|
|
|
fowners "${PN}":"${PN}" "/var/lib/${PN}"
|
2014-05-21 22:43:52 +01:00
|
|
|
}
|
2014-02-26 02:04:35 +02:00
|
|
|
|
2014-05-21 22:43:52 +01: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"
|
2014-06-23 22:12:04 +01:00
|
|
|
einfo " uses /var/lib/btsync for btsync working data"
|
2014-05-21 22:43:52 +01:00
|
|
|
einfo "btsync@<user>.service"
|
|
|
|
einfo " run as a system service but with user privilege"
|
2014-06-25 16:34:56 +01:00
|
|
|
einfo " uses /home/<user>/.btsync/btsync.conf for btsync working data"
|
2014-05-21 22:43:52 +01:00
|
|
|
einfo "btsync_user.service"
|
|
|
|
einfo " run as a standard user service"
|
2014-06-25 16:34:56 +01:00
|
|
|
einfo " uses /home/<user>/.btsync/btsync.conf for btsync working data"
|
2014-05-21 22:43:52 +01:00
|
|
|
einfo ""
|
|
|
|
einfo "Ensure you open the following ports in your firewall:"
|
2014-06-23 22:12:04 +01:00
|
|
|
einfo " btsync.conf specified sync listening port (UDP/TCP)"
|
2014-05-21 22:43:52 +01:00
|
|
|
einfo " port 3838 (UDP) for DHT tracking"
|
2014-06-23 22:12:04 +01:00
|
|
|
einfo ""
|
|
|
|
einfo "WebUI listens on: localhost:(8888+UID)"
|
|
|
|
|
2014-02-26 02:04:35 +02:00
|
|
|
}
|