From ac7008596b7785dc60562210fb8a6807407474e1 Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Mon, 25 Apr 2016 09:53:42 +0200 Subject: [PATCH] btsync added --- net-p2p/btsync/Manifest | 6 +++ net-p2p/btsync/btsync-2.3.6.ebuild | 66 ++++++++++++++++++++++++++++++ net-p2p/btsync/files/confd | 12 ++++++ net-p2p/btsync/files/initd | 41 +++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 net-p2p/btsync/Manifest create mode 100644 net-p2p/btsync/btsync-2.3.6.ebuild create mode 100644 net-p2p/btsync/files/confd create mode 100644 net-p2p/btsync/files/initd diff --git a/net-p2p/btsync/Manifest b/net-p2p/btsync/Manifest new file mode 100644 index 0000000..ca04912 --- /dev/null +++ b/net-p2p/btsync/Manifest @@ -0,0 +1,6 @@ +AUX confd 309 SHA256 53cb6a33c911ccbe4d4a405e9e8ac7d17af1a79083a4e5de75dd15f21aa6a3d9 SHA512 8bc7355dde4ce7ce48847ab3ffe5742b702ddf9c5e9e4397d2c17c183387ed671ba3da490c339abfd079691a5cc0f0b5cdcea2a3d50c6cc747970eec0a99702f WHIRLPOOL 85e31904fd23e6db23e634a8f37701dbd3d0b04588faf7f4565d99122d36bcaabf8dd4ce03bd4b18551e6afb47e1ce778febc6f90e0ed0f33bf5386658ce5b8f +AUX initd 805 SHA256 035073064836a70166a63caab5142c00681b15924d455d1630c7c2694b60753f SHA512 ed74e0514e0070d175a065ce119740cce02fa9fe19d7a1daf02d06c31225dfb000155b336a60511075633a9c5a52cde4d265a0e30ca7de0df7b193d65a811c4d WHIRLPOOL b8c1d53366a5d126b9f51329755bf2d2f4c9d2f5c25f1dd588b0d362a97571fd84b3b0ec7ead3bde764f8447a66d08994682c062387a75cc195501626c591a70 +DIST btsync_arm-2.3.6.tar.gz 5240377 SHA256 d43f4e07efd4727df4b70b40b4cf28b56aab37871573dedcd685ff5d09df5efb SHA512 064504016de6a1a86c84f038c3f7629f0093a966c26acc7dfd8f3efef07cb043c50e10191ce2ce356debdfa1fd54147305b526a152d79641c0e90b917350fc67 WHIRLPOOL c9cec9615d01a3a2a2286353de1a717eaa7f034add2438e6a5cadbb6ef33ee01efc281884b8d82946ca9cd37b5787de657446c9639c7b887dabf018e998e41d0 +DIST btsync_i386-2.3.6.tar.gz 5739936 SHA256 a7d50cf379e6c9d6c97116225a1effb2350a5a90b93a95b345f070e20ea52d85 SHA512 4f417efde4088830a0092f503f6230efdad353ac22e3f1fce8105221a55e9f0441fcb5f240e1883a7cc1efc1cfd32513184dae42ee644892202cbea15fa3d259 WHIRLPOOL 11c71eba95ef242be959dbc08df4071da8b80e35da8310e1a0363575e877c0a6ecded99a0faf5d3dc7a4ffa364f247e35719252479e97b5665bac1159c7a68cd +DIST btsync_x64-2.3.6.tar.gz 5924266 SHA256 fac80d415aa44d9f2e027b56cb4fea1aa8770489cffc037b64fd05135fa4d907 SHA512 1f2e15e6b25c1207a9d7b6cb93f762e629aea91884a37954af1b247c754b3d9643191df15947e189238fe4bb32631224451f3bb122b95a6819f391641c1e80a2 WHIRLPOOL 2d21f2027efb9930256e55165fab3f8bb84e08fc80d3ee5f77db92f711fd54f1eeb520cdba5fa75fe2430988ea8531128a7d014fb9527e8172264f25f874999a +EBUILD btsync-2.3.6.ebuild 1976 SHA256 82d38b839a75e0eab6a4eefd0e5b13ca3af76c01f901c8392052e72d29d396e5 SHA512 718f65dff5e6d231dccc6ad6e26c8b66420c0836706b560b055172cc97183779e2389251dad4a90eb8c8c449e41d4d56835625d435f39f6c00021eacd357d523 WHIRLPOOL 11fa5424f8f8e3c9adb7faca37b250d9ebb142591c90f8eb6815ef968997eb5c531a4561c33a12d5377022d633920728a4d41c9ba64be7ff0ef305b5de9714f8 diff --git a/net-p2p/btsync/btsync-2.3.6.ebuild b/net-p2p/btsync/btsync-2.3.6.ebuild new file mode 100644 index 0000000..6e13397 --- /dev/null +++ b/net-p2p/btsync/btsync-2.3.6.ebuild @@ -0,0 +1,66 @@ +# copyright (C) 2013-2014 Jonathan Vasquez +# Copyright (C) 2014 Sandy McArthur +# Copyright (C) 2015 Scott Alfter +# Distributed under the terms of the GNU General Public License v2 + +EAPI="4" + +inherit eutils user +NAME="btsync" +DESCRIPTION="Magic folder style file syncing powered by BitTorrent." +HOMEPAGE="http://www.getsync.com/" +SRC_URI=" + amd64? ( https://download-cdn.getsync.com/${PV}/linux-x64/BitTorrent-Sync_x64.tar.gz -> ${NAME}_x64-${PV}.tar.gz ) + x86? ( https://download-cdn.getsync.com/${PV}/linux-i386/BitTorrent-Sync_i386.tar.gz -> ${NAME}_i386-${PV}.tar.gz ) + arm? ( https://download-cdn.getsync.com/${PV}/linux-arm/BitTorrent-Sync_arm.tar.gz -> ${NAME}_arm-${PV}.tar.gz )" + +RESTRICT="mirror strip" +LICENSE="BitTorrent" +SLOT="0" +KEYWORDS="amd64 x86 arm" +IUSE="" + +DEPEND="" +RDEPEND="${DEPEND}" + +QA_PREBUILT="opt/btsync/btsync" + +S="${WORKDIR}" + +pkg_setup() { + enewgroup btsync + enewuser btsync -1 -1 -1 "btsync" --system +} + +src_install() { + einfo dodir "/opt/${NAME}" + dodir "/opt/${NAME}" + exeinto "/opt/${NAME}" + doexe btsync + insinto "/opt/${NAME}" + doins LICENSE.TXT + + newinitd "${FILESDIR}/initd" ${NAME} + newconfd "${FILESDIR}/confd" ${NAME} + + einfo dodir "/etc/${NAME}" + dodir "/etc/${NAME}" + "${D}/opt/btsync/btsync" --dump-sample-config > "${D}/etc/${NAME}/config" + sed -i 's|// "pid_file"| "pid_file"|' "${D}/etc/${NAME}/config" + fowners btsync "/etc/${NAME}/config" + fperms 460 "/etc/${NAME}/config" +} + +pkg_preinst() { + # Customize for local machine + # Set device name to `hostname` + sed -i "s/My Sync Device/$(hostname) Gentoo Linux/" "${D}/etc/btsync/config" + # Update defaults to the btsync's home dir + sed -i "s|/home/user|$(egethome btsync)|" "${D}/etc/btsync/config" +} + +pkg_postinst() { + elog "Init scripts launch btsync daemon as btsync:btsync " + elog "Please review/tweak /etc/${NAME}/config for default configuration." + elog "Default web-gui URL is http://localhost:8888/ ." +} diff --git a/net-p2p/btsync/files/confd b/net-p2p/btsync/files/confd new file mode 100644 index 0000000..d26aab3 --- /dev/null +++ b/net-p2p/btsync/files/confd @@ -0,0 +1,12 @@ +# conf.d file for btsync + +# User and group daemon runs as +BTSYNC_USER="btsync" +BTSYNC_GROUP="btsync" + +NAME="BitTorrent Sync" +SYNC_NAME="btsync" +SYNC_PATH="/opt/${SYNC_NAME}/" +SYNC_BINARY="${SYNC_PATH}/${SYNC_NAME}" +SYNC_OPTS="--config /etc/${SYNC_NAME}/config" +SYNC_PIDFILE="/var/run/btsync/${SYNC_NAME}.pid" diff --git a/net-p2p/btsync/files/initd b/net-p2p/btsync/files/initd new file mode 100644 index 0000000..3e55f5b --- /dev/null +++ b/net-p2p/btsync/files/initd @@ -0,0 +1,41 @@ +#!/sbin/runscript +# Copyright (C) 2013-2014 Jonathan Vasquez +# Copyright (C) 2014 Sandy McArthur +# Distributed under the terms of the Simplified BSD License. + +depend() { + need localmount net + after bootmisc +} + +start() { + ebegin "Starting ${NAME}" + + mkdir -p $(dirname ${SYNC_PIDFILE}) + chown ${BTSYNC_USER}:${BTSYNC_GROUP} $(dirname ${SYNC_PIDFILE}) + + start-stop-daemon \ + --start \ + --user "${BTSYNC_USER}" \ + --group "${BTSYNC_GROUP}" \ + --nice 5 \ + --ionice 3 \ + --exec "${SYNC_BINARY}" \ + -- ${SYNC_OPTS} + + eend $? +} + +stop() { + ebegin "Stopping ${NAME}" + + start-stop-daemon \ + --stop \ + --user "${BTSYNC_USER}" \ + --group "${BTSYNC_GROUP}" \ + --exec "${SYNC_BINARY}" \ + --wait 5000 \ + --retry SIGTERM/5 + + eend $? +}