alpha-quadrant/net-p2p/resilio-sync/resilio-sync-2.6.2.ebuild

68 lines
2.0 KiB
Bash
Raw Normal View History

2016-10-11 15:45:54 +02:00
# Copyright (C) 2013-2014 Jonathan Vasquez <fearedbliss@funtoo.org>
# Copyright (C) 2014 Sandy McArthur <Sandy@McArthur.org>
# Copyright (C) 2015 Scott Alfter <scott@alfter.us>
# Copyright (C) 2016 Micha Glave <gentoo@migmedia.de>
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
inherit eutils user
NAME="rslsync"
DESCRIPTION="Magic folder style file syncing powered by BitTorrent."
HOMEPAGE="http://www.getsync.com/"
SRC_URI="
2017-01-04 17:04:49 +01:00
amd64? ( https://download-cdn.resilio.com/${PV}/linux-x64/${PN}_x64.tar.gz -> ${PN}_x64-${PV}.tar.gz )
x86? ( https://download-cdn.resilio.com/${PV}/linux-i386/${PN}_i386.tar.gz -> ${PN}_i386-${PV}.tar.gz )
arm? ( https://download-cdn.resilio.com/${PV}/linux-arm/${PN}_arm.tar.gz -> ${PN}_arm-${PV}.tar.gz )"
2016-10-11 15:45:54 +02:00
RESTRICT="mirror strip"
LICENSE="BitTorrent"
SLOT="0"
KEYWORDS="amd64 x86 arm"
IUSE=""
DEPEND=""
RDEPEND="${DEPEND}"
QA_PREBUILT="opt/${PN}/${NAME}"
S="${WORKDIR}"
pkg_setup() {
enewgroup ${NAME}
enewuser ${NAME} -1 -1 -1 "${NAME}"
}
src_install() {
einfo dodir "/opt/${PN}"
dodir "/opt/${PN}"
exeinto "/opt/${PN}"
doexe ${NAME}
insinto "/opt/${PN}"
doins LICENSE.TXT
newinitd "${FILESDIR}/initd" ${NAME}
newconfd "${FILESDIR}/confd" ${NAME}
einfo dodir "/etc/${PN}"
dodir "/etc/${PN}"
"${D}/opt/${PN}/${NAME}" --dump-sample-config > "${D}/etc/${PN}/config"
fowners ${NAME} "/etc/${PN}/config"
fperms 460 "/etc/${PN}/config"
}
pkg_preinst() {
# Customize for local machine
2017-03-13 11:59:17 +01:00
sed -i 's|// "pid_file".*$| "pid_file" : "/run/resilio-sync/rslsync.pid",|' "${D}/etc/${PN}/config"
2016-10-11 15:45:54 +02:00
# Set device name to `hostname`
sed -i "s/My Sync Device/$(hostname) Gentoo Linux/" "${D}/etc/${PN}/config"
# Update defaults to the ${NAME}'s home dir
sed -i "s|/home/user|$(egethome ${NAME})|" "${D}/etc/${PN}/config"
}
pkg_postinst() {
elog "Init scripts launch ${NAME} daemon as ${NAME}:${NAME} "
elog "Please review/tweak /etc/${PN}/config for default configuration."
elog "Default web-gui URL is http://localhost:8888/ ."
}