Gentoo Archives: gentoo-commits

From: Dirkjan Ochtman <djc@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/syncthing/
Date: Thu, 27 Apr 2017 10:52:18
Message-Id: 1493290325.32d1e7047cf5f17227e97fbe7a48c3ba892dfbb8.djc@gentoo
1 commit: 32d1e7047cf5f17227e97fbe7a48c3ba892dfbb8
2 Author: nickgen <nickgen <AT> users <DOT> noreply <DOT> github <DOT> com>
3 AuthorDate: Tue Apr 25 22:19:08 2017 +0000
4 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 27 10:52:05 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32d1e704
7
8 net-p2p/syncthing: bump to 0.14.27
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 net-p2p/syncthing/Manifest | 1 +
13 net-p2p/syncthing/syncthing-0.14.27.ebuild | 114 +++++++++++++++++++++++++++++
14 2 files changed, 115 insertions(+)
15
16 diff --git a/net-p2p/syncthing/Manifest b/net-p2p/syncthing/Manifest
17 index a7a4a06205e..ab1d2839891 100644
18 --- a/net-p2p/syncthing/Manifest
19 +++ b/net-p2p/syncthing/Manifest
20 @@ -1,2 +1,3 @@
21 DIST syncthing-0.14.23.tar.gz 6783975 SHA256 bf8a13f27329c85a3fddef87a3dc90d40b6de3a233738b1d05127bc378aacd60 SHA512 36a1d0f1ec6642056a6ff43b90af417eff09d6f9c7358fb1d80c3f0470d9c686d8644e4491c94f95a644ee26b6b4df4ecc27d519c7d4cc39539061f6dc5b181c WHIRLPOOL cae76bc2f41bb7c3a3df3fdf2af702a42e4f25f8dc2f03c0b90bd51f0205f29354a2b4744d7d54e8e11f15509c695ae9693b37d35b4e7d03087f71faf8d90ff8
22 DIST syncthing-0.14.24.tar.gz 6781504 SHA256 6538536d4c1c17dc20e1f1253f7a393ea7cf2f993d27b41e74d98af5963c2fc3 SHA512 164bb2ec8a85b5d10c9b4a08dfc3a94ff1b479069f272471067dea82ac6bb1616ea21fd2576bf5464c144be1bff61a89c24f04fe18c20c4c982acd26c0cc5ca3 WHIRLPOOL 56233ac875be1f633eae73337a88175391cae7d25a2a46d1715dd3b4397054863cdc1fc4a92dbdf1253dfecedaa8bf5d370428b78699ca6ce9d160a53148440a
23 +DIST syncthing-0.14.27.tar.gz 4611326 SHA256 27051df042b73df7cbee590a56a75931a63e228dcd5c044d0950e14b46730d64 SHA512 438d3385dc3b9737bc0ec275462b9dc41a630b353443061fddb9e48b184b5cb39e3ccf144fef4e30f4523d1c6a96f2a8a9d87bc27e9734b1f7d7d462c9c15e51 WHIRLPOOL 72f10183a7140b7989562de74d185cd8bcea41f52e31c2667126418d7b19c64a045f7f7ebfb0d6269e614e76b58762ccf21cd54ee69c343a2377776d311caac3
24
25 diff --git a/net-p2p/syncthing/syncthing-0.14.27.ebuild b/net-p2p/syncthing/syncthing-0.14.27.ebuild
26 new file mode 100644
27 index 00000000000..6a552aa9568
28 --- /dev/null
29 +++ b/net-p2p/syncthing/syncthing-0.14.27.ebuild
30 @@ -0,0 +1,114 @@
31 +# Copyright 1999-2017 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +EGO_PN="github.com/${PN}/${PN}"
37 +
38 +inherit golang-vcs-snapshot systemd user versionator
39 +
40 +DESCRIPTION="Open Source Continuous File Synchronization"
41 +HOMEPAGE="https://syncthing.net"
42 +SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
43 +
44 +LICENSE="MPL-2.0"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~x86 ~arm"
47 +IUSE="tools"
48 +
49 +DOCS=( README.md AUTHORS CONTRIBUTING.md )
50 +
51 +pkg_setup() {
52 + enewgroup ${PN}
53 + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
54 +
55 + if use tools ; then
56 + # separate user for the relay server
57 + enewgroup strelaysrv
58 + enewuser strelaysrv -1 -1 /var/lib/strelaysrv strelaysrv
59 + # and his home folder
60 + keepdir /var/lib/strelaysrv
61 + fowners strelaysrv:strelaysrv /var/lib/strelaysrv
62 + fi
63 +}
64 +
65 +src_prepare() {
66 + default
67 + sed -i \
68 + 's|^ExecStart=.*|ExecStart=/usr/libexec/syncthing/strelaysrv|' \
69 + src/${EGO_PN}/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service \
70 + || die
71 +}
72 +
73 +src_compile() {
74 + export GOPATH="${S}:$(get_golibdir_gopath)"
75 + cd src/${EGO_PN} || die
76 + go run build.go -version "v${PV}" -no-upgrade install \
77 + $(usex tools "all" "") || die "build failed"
78 +}
79 +
80 +src_test() {
81 + cd src/${EGO_PN} || die
82 + go run build.go test || die "test failed"
83 +}
84 +
85 +src_install() {
86 + pushd src/${EGO_PN} >& /dev/null || die
87 + doman man/*.[157]
88 + einstalldocs
89 +
90 + dobin bin/syncthing
91 + if use tools ; then
92 + exeinto /usr/libexec/syncthing
93 + local exe
94 + for exe in bin/* ; do
95 + [[ "${exe}" == "bin/syncthing" ]] || doexe "${exe}"
96 + done
97 + fi
98 + popd >& /dev/null || die
99 +
100 + # openrc and systemd service files
101 + systemd_dounit src/${EGO_PN}/etc/linux-systemd/system/${PN}{@,-resume}.service
102 + systemd_douserunit src/${EGO_PN}/etc/linux-systemd/user/${PN}.service
103 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
104 + newinitd "${FILESDIR}/${PN}.initd" ${PN}
105 +
106 + keepdir /var/{lib,log}/${PN}
107 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
108 + insinto /etc/logrotate.d
109 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
110 +
111 + if use tools ; then
112 + # openrc and systemd service files
113 + systemd_dounit src/${EGO_PN}/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service
114 + newconfd "${FILESDIR}/strelaysrv.confd" strelaysrv
115 + newinitd "${FILESDIR}/strelaysrv.initd" strelaysrv
116 +
117 + insinto /etc/logrotate.d
118 + newins "${FILESDIR}/strelaysrv.logrotate" strelaysrv
119 + fi
120 +}
121 +
122 +pkg_postinst() {
123 + local v
124 + for v in ${REPLACING_VERSIONS}; do
125 + if [[ $(get_version_component_range 2) -gt \
126 + $(get_version_component_range 2 ${v}) ]]; then
127 + ewarn "Version ${PV} is not protocol-compatible with version" \
128 + "0.$(($(get_version_component_range 2) - 1)).x or lower."
129 + ewarn "Make sure all your devices are running at least version" \
130 + "0.$(get_version_component_range 2).0."
131 + fi
132 + done
133 +
134 + # check if user syncthing-relaysrv exists
135 + # if yes, warn that it has been moved to strelaysrv
136 + if [[ -n "$(egetent passwd syncthing-relaysrv 2>/dev/null)" ]]; then
137 + ewarn
138 + ewarn "The user and group for the relay server have been changed"
139 + ewarn "from syncthing-relaysrv to strelaysrv"
140 + ewarn "The old user and group are not deleted automatically. Delete them by running:"
141 + ewarn " userdel -r syncthing-relaysrv"
142 + ewarn " groupdel syncthing-relaysrv"
143 + fi
144 +}