summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Elsner <open@mindrunner.de>2014-09-12 16:40:39 +1000
committerLukas Elsner <open@mindrunner.de>2014-09-12 16:40:39 +1000
commit71dd9b7d8357c98bf59a07ad7e9d8565ff408bc6 (patch)
tree31026b3ae594c838955816836bce58972a4e2c82
parentfix insync crap (diff)
downloadluman-71dd9b7d8357c98bf59a07ad7e9d8565ff408bc6.tar.gz
luman-71dd9b7d8357c98bf59a07ad7e9d8565ff408bc6.tar.bz2
luman-71dd9b7d8357c98bf59a07ad7e9d8565ff408bc6.zip
added bt-sync
-rw-r--r--net-p2p/bittorrent-sync/Manifest5
-rw-r--r--net-p2p/bittorrent-sync/bittorrent-sync-1.4.75.ebuild66
-rw-r--r--net-p2p/bittorrent-sync/files/config20
-rw-r--r--net-p2p/bittorrent-sync/files/init.d/btsync41
-rw-r--r--net-p2p/bittorrent-sync/files/systemd/btsync.service13
5 files changed, 145 insertions, 0 deletions
diff --git a/net-p2p/bittorrent-sync/Manifest b/net-p2p/bittorrent-sync/Manifest
new file mode 100644
index 0000000..d37df2a
--- /dev/null
+++ b/net-p2p/bittorrent-sync/Manifest
@@ -0,0 +1,5 @@
+AUX config 361 SHA256 f492224a5bbf0f078fa8c91a26e1f22919cc68bd78dafd03411cb1b8b4bee5af SHA512 3760ce370e38e4a67a115cb9832a08fe76786219fc171346fed92b964442b60ff8ce052e6c97dfbac756e29d2181b379a429292ad6465024b3557b96ed46b9a4 WHIRLPOOL 8e0b9ffc7a032393e7c15e3de99034eb6dff34478ffe3e562d2b969ddd8d3a68f9497fffc7615f4b44ec68a4022186b7487c2f1707c2ed87556c9cdbcf2726ad
+AUX init.d/btsync 907 SHA256 d47c407b9451bea27835a9b75491ff00f0c74ac21fd61abd909f597ee27db75b SHA512 5989be8991c8868a021846045fab5252f686870d2fef32474ef259e01f1ad2b7fa8217f3b9c1b8c36480fa8352562fca70d44ceb0f80e6622c2adf9cfbe416a6 WHIRLPOOL b8a4b72186a59cfd6d67dfcbcf4a1ff2fc8567e6daab6b77f03d25795b19062e9e31f7edb3073a2b3d75b937bbb24f4794bfd29d659a6f7d8f3be9bacc211bae
+AUX systemd/btsync.service 342 SHA256 4a337170e6c4492b77ab3c83635cf06be5e08e4b5bba1d0fa966f580ba82517c SHA512 afb4a5b924501cd8fd62bfa39ebaef1ffd376e6f4341eb447217f6ac200c942ebd9d6f064b32cbf1035f4412ad2374b3e6e79ee0e88d92581c3d7038309eda02 WHIRLPOOL 35e030c45122af08f5feecf473b3d2f021f00bf928f1d5d04e31070f29dd3714099bbf1d3203e1f5f2f0b75792a73ff9dcb85136b5f8c4d39543c73e87db8bbe
+DIST btsync_x64-1.4.75.tar.gz 3883783 SHA256 c4dde7580b7dbddee88df6104bacb6198bcfb24f9a66cb19d7a5eb59b231d407 SHA512 b8c09e5b24f3e4ebc515582f0b5046953ced6c290499003336e5da91021c35cce2d7465934b82e2df8ebe31392a92941bfe8842d7a3683e8b69d65517d969df3 WHIRLPOOL 79d10feea3a871d331896e6a0abce370f98345a293fe246931c4bd9c5270706be212e73bdff5dfe82b72051221141a84bce7e831a0d8687e5ef4ca1a6bcdd240
+EBUILD bittorrent-sync-1.4.75.ebuild 1863 SHA256 343e033827916cdb2ea74b187ea1714e1e9795e1a9ead5bc156384c081c532e0 SHA512 efc6ff5327b2425c40f489ff80a34bc115aa23368fdb33c43db3bbb9c1dc8f9b38e96aecc52a72208f88dea87f43dd4456df81e282be867e35589b33b432196e WHIRLPOOL e36d8ceeeb06cc5d6023518bcc6ea2665a37c25cf717e5c542859017c67366f1316eb7df27687e81ce392143997bd9c23dd117b0c56195879bcfe5e7d4d6a25e
diff --git a/net-p2p/bittorrent-sync/bittorrent-sync-1.4.75.ebuild b/net-p2p/bittorrent-sync/bittorrent-sync-1.4.75.ebuild
new file mode 100644
index 0000000..cb335b4
--- /dev/null
+++ b/net-p2p/bittorrent-sync/bittorrent-sync-1.4.75.ebuild
@@ -0,0 +1,66 @@
+# Copyright 2013-2014 Jonathan Vasquez <jvasquez1011@gmail.com>
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit user systemd
+
+NAME="btsync"
+DESCRIPTION="Fast, unlimited and secure file-syncing. Free from the cloud."
+HOMEPAGE="http://labs.bittorrent.com/experiments/sync.html"
+SRC_URI="
+ amd64? ( http://syncapp.bittorrent.com/${PV}/btsync_x64-${PV}.tar.gz )"
+
+RESTRICT="mirror strip"
+LICENSE="BitTorrent"
+SLOT="0"
+KEYWORDS="~amd64"
+
+QA_PREBUILT="opt/btsync/btsync"
+
+S="${WORKDIR}"
+
+src_install() {
+ # Install the executable
+ exeinto "/opt/${NAME}"
+ doexe "${S}/${NAME}"
+
+ # Install a default configuration file
+ insinto "/etc/${NAME}"
+ doins "${FILESDIR}/config"
+
+ # Install the OpenRC init file
+ doinitd "${FILESDIR}/init.d/${NAME}"
+
+ # Install the systemd unit file
+ systemd_dounit "${FILESDIR}/systemd/${NAME}.service"
+}
+
+pkg_postinst() {
+ local syncuser="btsync"
+ local syncdir="/home/${syncuser}"
+
+ # Let's set up the user and group for this daemon so that members of the group
+ # can have write permissions.
+ enewgroup "${syncuser}"
+ enewuser "${syncuser}" -1 /bin/bash "${syncdir}" "${syncuser}"
+
+ if [[ ! -d "${syncdir}" ]]; then
+ # Create the .sync directory where sync metadata will be stored
+ mkdir "${syncdir}/.sync"
+
+ # Fixed home directory group permissions since it's currently btsync:root
+ chown ${syncuser}:${syncuser} "${syncdir}"
+
+ # Fix .sync directory ownership
+ chown ${syncuser}:${syncuser} "${syncdir}/.sync"
+ fi
+
+ elog "In order for shared files between local users to be as easy as possible,"
+ elog "please set up ACLs on your system."
+ elog ""
+ elog "You will also need to configure btsync by editing /etc/btsync/config"
+ elog ""
+ elog "After checking your config, start the service and point your browser to"
+ elog "http://localhost:8888 , the default username and password is admin/admin."
+}
diff --git a/net-p2p/bittorrent-sync/files/config b/net-p2p/bittorrent-sync/files/config
new file mode 100644
index 0000000..547c203
--- /dev/null
+++ b/net-p2p/bittorrent-sync/files/config
@@ -0,0 +1,20 @@
+{
+ "device_name": "GENTOO",
+ "listening_port" : 0,
+
+ "storage_path" : "/home/btsync/.sync",
+ "pid_file" : "/var/run/btsync.pid",
+
+ "check_for_updates" : true,
+ "use_upnp" : true,
+
+ "download_limit" : 0,
+ "upload_limit" : 0,
+
+ "webui" :
+ {
+ "listen" : "0.0.0.0:8888",
+ "login" : "admin",
+ "password" : "admin"
+ }
+}
diff --git a/net-p2p/bittorrent-sync/files/init.d/btsync b/net-p2p/bittorrent-sync/files/init.d/btsync
new file mode 100644
index 0000000..b0515ea
--- /dev/null
+++ b/net-p2p/bittorrent-sync/files/init.d/btsync
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+
+# Copyright 2013-2014 Jonathan Vasquez <jvasquez1011@gmail.com>
+# Distributed under the terms of the GNU General Public License v2
+
+NAME="BitTorrent Sync"
+SYNC_NAME="btsync"
+SYNC_PATH="/opt/${SYNC_NAME}/"
+SYNC_BINARY="${SYNC_PATH}/${SYNC_NAME}"
+SYNC_OPTS="--nodaemon --config /etc/${SYNC_NAME}/config"
+SYNC_PIDFILE="/var/run/${SYNC_NAME}.pid"
+
+start() {
+ ebegin "Starting ${NAME}"
+
+ # Sets the umask for the process so that btsync creates files
+ # with group write permissions
+ start-stop-daemon --start --exec "${SYNC_BINARY}" \
+ --pidfile "${SYNC_PIDFILE}" --background \
+ -- ${SYNC_OPTS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${NAME}"
+
+ start-stop-daemon --stop --exec "${SYNC_BINARY}" \
+ --pidfile "${SYNC_PIDFILE}"
+
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${NAME}"
+
+ start-stop-daemon --signal HUP --exec "${SYNC_BINARY}" \
+ --pidfile "${SYNC_PIDFILE}"
+
+ eend $?
+}
diff --git a/net-p2p/bittorrent-sync/files/systemd/btsync.service b/net-p2p/bittorrent-sync/files/systemd/btsync.service
new file mode 100644
index 0000000..64b8c43
--- /dev/null
+++ b/net-p2p/bittorrent-sync/files/systemd/btsync.service
@@ -0,0 +1,13 @@
+# Copyright 2014 Jonathan Vasquez <jvasquez1011@gmail.com>
+# Distributed under the terms of the GNU General Public License v2
+
+[Unit]
+Description=BitTorrent Sync
+After=systemd-udev-settle.target local-fs.target zfs.service
+
+[Service]
+Type=forking
+ExecStart=/opt/btsync/btsync --config /etc/btsync/config
+
+[Install]
+WantedBy=multi-user.target