diff options
author | ava1ar | 2015-06-12 22:21:10 -0400 |
---|---|---|
committer | ava1ar | 2015-06-12 22:21:10 -0400 |
commit | 76a8fc2ffae0f5c7db68869e216f976a255dd896 (patch) | |
tree | 447c4a9b07ea318f0ce7a43d99e45d341a353fc3 | |
download | aur-76a8fc2ffae0f5c7db68869e216f976a255dd896.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | PKGBUILD | 51 | ||||
-rw-r--r-- | btsync.conf | 1 | ||||
-rw-r--r-- | btsync.install | 74 | ||||
-rw-r--r-- | btsync.service | 13 | ||||
-rw-r--r-- | btsync_user.service | 11 |
6 files changed, 184 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..76661c7560ec --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = btsync-1.4 + pkgdesc = BitTorrent Sync - automatically sync files via secure, distributed technology (beta version) + pkgver = 1.4.111 + pkgrel = 1 + url = http://www.bittorrent.com/sync + install = btsync.install + arch = i686 + arch = x86_64 + arch = arm + arch = armv6h + arch = armv7h + license = custom:btsync + optdepends = btsync-autoconfig: Auto-create users' config files if needed + conflicts = btsync + backup = etc/btsync.conf + source = btsync.service + source = btsync_user.service + source = btsync.conf + sha1sums = 05038b03a673dd0207b2758a2e01db5d28c409d1 + sha1sums = d30deb7e41ba1d163b4a5e442b8d8118758d312a + sha1sums = bf7d6bd7ffe2d23cce51a51e92fac3b82a7c87bb + source_i686 = http://syncapp.bittorrent.com/1.4.111/btsync_i386-1.4.111.tar.gz + sha1sums_i686 = 5e09a31fab0cf5032e22df12e4d67651bfe9edfe + source_x86_64 = http://syncapp.bittorrent.com/1.4.111/btsync_x64-1.4.111.tar.gz + sha1sums_x86_64 = bb2dec020e5d8ec3a0ce18a38ae08ddabd2a7750 + source_arm = http://syncapp.bittorrent.com/1.4.111/btsync_arm-1.4.111.tar.gz + sha1sums_arm = 00769d20b05e816a43c797f32a690f0fb8cd5dd5 + source_armv6h = http://syncapp.bittorrent.com/1.4.111/btsync_arm-1.4.111.tar.gz + sha1sums_armv6h = 00769d20b05e816a43c797f32a690f0fb8cd5dd5 + source_armv7h = http://syncapp.bittorrent.com/1.4.111/btsync_arm-1.4.111.tar.gz + sha1sums_armv7h = 00769d20b05e816a43c797f32a690f0fb8cd5dd5 + +pkgname = btsync-1.4 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..04a9aa8af149 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,51 @@ +# Contributor: Dalton Miller +# Contributor: Kilian Lackhove kilian@lackhove.de +# Contributor: Justin Patera serialhex@gmail.com +# Maintainer: ava1ar <mail(at)ava1ar(dot)me> + +pkgname=btsync-1.4 +pkgver=1.4.111 +pkgrel=1 +pkgdesc="BitTorrent Sync - automatically sync files via secure, distributed technology (beta version)" +license=("custom:btsync") +arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h') +url="http://www.bittorrent.com/sync" +install=btsync.install +backup=('etc/btsync.conf') +optdepends=("btsync-autoconfig: Auto-create users' config files if needed") +conflicts=('btsync') +source=(btsync.service btsync_user.service btsync.conf) +source_arm+=("http://syncapp.bittorrent.com/${pkgver}/btsync_arm-${pkgver}.tar.gz") +source_armv6h+=("http://syncapp.bittorrent.com/${pkgver}/btsync_arm-${pkgver}.tar.gz") +source_armv7h+=("http://syncapp.bittorrent.com/${pkgver}/btsync_arm-${pkgver}.tar.gz") +source_i686+=("http://syncapp.bittorrent.com/${pkgver}/btsync_i386-${pkgver}.tar.gz") +source_x86_64+=("http://syncapp.bittorrent.com/${pkgver}/btsync_x64-${pkgver}.tar.gz") +sha1sums=('05038b03a673dd0207b2758a2e01db5d28c409d1' + 'd30deb7e41ba1d163b4a5e442b8d8118758d312a' + 'bf7d6bd7ffe2d23cce51a51e92fac3b82a7c87bb') +sha1sums_i686=('5e09a31fab0cf5032e22df12e4d67651bfe9edfe') +sha1sums_x86_64=('bb2dec020e5d8ec3a0ce18a38ae08ddabd2a7750') +sha1sums_arm=('00769d20b05e816a43c797f32a690f0fb8cd5dd5') +sha1sums_armv6h=('00769d20b05e816a43c797f32a690f0fb8cd5dd5') +sha1sums_armv7h=('00769d20b05e816a43c797f32a690f0fb8cd5dd5') + +package() { + # install main binary + install -Dm755 "${srcdir}"/btsync "${pkgdir}"/usr/bin/btsync + + # generate and install system-wide config + mkdir -p "${pkgdir}"/etc + ./btsync --dump-sample-config \ + | sed 's:/home/user/\.sync:/var/lib/btsync:' \ + | sed 's:\/\/ "pid_file": "pid_file":' \ + | sed 's:\/\/ "storage_path": "storage_path":' \ + > "${pkgdir}"/etc/btsync.conf + + # install systemd config files + install -Dm644 "${srcdir}"/btsync.service "${pkgdir}"/usr/lib/systemd/system/btsync.service + install -Dm644 "${srcdir}"/btsync.conf "${pkgdir}"/usr/lib/tmpfiles.d/btsync.conf + install -Dm644 "${srcdir}"/btsync_user.service "${pkgdir}"/usr/lib/systemd/user/btsync.service + + # install license + install -Dm644 "${srcdir}"/LICENSE.TXT "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt +} diff --git a/btsync.conf b/btsync.conf new file mode 100644 index 000000000000..643daafd2166 --- /dev/null +++ b/btsync.conf @@ -0,0 +1 @@ +D /var/run/btsync 0755 btsync btsync - diff --git a/btsync.install b/btsync.install new file mode 100644 index 000000000000..010c85689ee7 --- /dev/null +++ b/btsync.install @@ -0,0 +1,74 @@ +post_install() { + + # add btsync user and group if doesn't exist + if [ "$(grep btsync /etc/passwd)" == "" ]; then + useradd -r -s /bin/sh -d /var/lib/btsync btsync + fi + # create btsync dir + mkdir -p /var/lib/btsync && chown -R btsync:btsync /var/lib/btsync + + post_upgrade +} + +post_upgrade() { + + # following will be moved to post_install eventually + + # create tmpdirs + systemd-tmpfiles --create btsync.conf + # adjust owner and permissions for config file + chown btsync:btsync /etc/btsync.conf + chmod 600 /etc/btsync.conf + +cat << EOF + + WebGUI can be accessed via following URL: http://localhost:8888 + + * Running btsync system instance (using dedicated btsync:btsync account) + + System instance of btsync is preconfigured (configuration file located + at /etc/btsync.conf) and can be used directly after installation. + + Execute: + + to reload system systemd modules: systemctl daemon-reload + to start btsync manually: systemctl start btsync + to autostart btsync on system start: systemctl enable btsync + + * Running btsync user instance (using current user account) + + User instance MUST be configured before use. To perform configuration, + install btsync-autoconfig package or follow manual configuration steps: + + 1. Copy /etc/btsync/btsync.conf to ~/.config/btsync/btsync.conf for + the user you wish to configure btsync: + + mkdir -p ~/.config/btsync + cp /etc/btsync.conf ~/.config/btsync/btsync.conf + + 2. Replace user-specific references with the appropriate information, + including the following settings: + + - storage_path + - pid_file + - webui.listen + - webui.login + - webui.password + + 3. Make sure folder you specified as storage_path and folder where pid_file will + be located both exist in the filesystem, since btsync will not create it for you. + + Execute: + + to reload user systemd modules: systemctl --user daemon-reload + to start btsync manually: systemctl --user start btsync + to autostart btsync on user login: systemctl --user enable btsync + +EOF + +} + +post_remove() { + userdel btsync + echo -e "Please remove /var/lib/btsync folder manually" +} diff --git a/btsync.service b/btsync.service new file mode 100644 index 000000000000..8dd6c0aafaf7 --- /dev/null +++ b/btsync.service @@ -0,0 +1,13 @@ +[Unit] +Description=Bittorent Sync service +After=network.target + +[Service] +Type=forking +User=btsync +Group=btsync +ExecStart=/usr/bin/btsync --config /etc/btsync.conf +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/btsync_user.service b/btsync_user.service new file mode 100644 index 000000000000..249ec48aafa7 --- /dev/null +++ b/btsync_user.service @@ -0,0 +1,11 @@ +[Unit] +Description=Bittorent Sync per-user service +After=network.target + +[Service] +Type=forking +ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.conf +Restart=on-abort + +[Install] +WantedBy=default.target |