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: Fri, 26 Aug 2016 09:24:55
Message-Id: 1472203465.bfdc48106bf81d1d238e5661fd60f0c368e4506f.djc@gentoo
1 commit: bfdc48106bf81d1d238e5661fd60f0c368e4506f
2 Author: Louis Sautier <sautier.louis <AT> gmail <DOT> com>
3 AuthorDate: Tue Aug 23 11:13:22 2016 +0000
4 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 26 09:24:25 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfdc4810
7
8 net-p2p/syncthing: bump to 0.14.5
9
10 Package-Manager: portage-2.3.0
11
12 net-p2p/syncthing/Manifest | 1 +
13 net-p2p/syncthing/syncthing-0.14.5.ebuild | 122 ++++++++++++++++++++++++++++++
14 2 files changed, 123 insertions(+)
15
16 diff --git a/net-p2p/syncthing/Manifest b/net-p2p/syncthing/Manifest
17 index 5d95d6f..ea16cb4 100644
18 --- a/net-p2p/syncthing/Manifest
19 +++ b/net-p2p/syncthing/Manifest
20 @@ -2,3 +2,4 @@ DIST syncthing-0.13.10.tar.gz 4292039 SHA256 a86c7948afabc6e7b07f217d5200fb1e36c
21 DIST syncthing-0.14.0.tar.gz 6368723 SHA256 bfa25ee766be4fb53c98df9aad99f57e562715280ed73445abe15ce2a713588e SHA512 68202cdd1db1c7cee77345e9c4786b4b3c97f69fb13df0b7450e40a2eacea75315324998a5e8286968cc5d462276dd75d4622f12038753734a09aae6ade6ac9e WHIRLPOOL 37da9eaff26f16fbafc30b1aa0b90b129832b85fc5cb95995a7d9570cbcdec40307b4d10a6547fbd6252bcd83b19a9a23fd9c618012eea4bf53cf89cbb8bc20a
22 DIST syncthing-0.14.3.tar.gz 6380761 SHA256 1c7ce74db4bf780463c04ed3d5677296ad2bb347f3e35fe4229eb26893a6604a SHA512 f9586013253ad031e1940e73f01f8ca398820e9ffeef0978fcd51079c535c04957c0be1314ecc635251ae06300c6b4141077ac5c3c8e7e9741d58e4545a7f3ba WHIRLPOOL b226642a41b8288ecd50eff5013a0c7b92e3f73dba85726f7bbbd529c0b6caeff85954205fcc7faf00bb9b5d18ff0809b93ddf7d0d4553815b3627bd2eb71c30
23 DIST syncthing-0.14.4.tar.gz 6387191 SHA256 5c29e2d3de4c35cf917df801c50a195f1cea612a31879c28a8474ce923c23551 SHA512 0540d1e58b67d13401ecff4988897d185b04ca44f360c68cc52a2be8e70661cd6b84d6eae2b8f56e5a0f590efd9a8462f477f0492e5903992102a6c66bd3534e WHIRLPOOL 4d5502c8e1d1577cc7223c88a7e364b853d7a2e469d9cdbbc01de98dd679fad61d3278ee8ff444acc10fec83bd460fce086b4ef47b2c0db17f7f0ec6f1377f90
24 +DIST syncthing-0.14.5.tar.gz 6387026 SHA256 32979e333a77dcd4e2ba9cb9c74404f9fd06891032c84b1285bcb779c9e132b6 SHA512 c60e3205624e49de34c17a77cf3a8e7af49572a53faa97a6dca7e57a7009c068f70f986e4e3f60774514e3b74a09edff4e6843563456d4ff97b408843a9a06fb WHIRLPOOL 6283cf0cf0440a1333f4a27bdc5fcef389df975d177cd0cd41f7174164c9b9abc79dddbb9a64c394808b8ec4fa77b1f92fd67f2276d9b0277886d1a25437ef4e
25
26 diff --git a/net-p2p/syncthing/syncthing-0.14.5.ebuild b/net-p2p/syncthing/syncthing-0.14.5.ebuild
27 new file mode 100644
28 index 00000000..e18e316
29 --- /dev/null
30 +++ b/net-p2p/syncthing/syncthing-0.14.5.ebuild
31 @@ -0,0 +1,122 @@
32 +# Copyright 1999-2016 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +# $Id$
35 +
36 +EAPI=6
37 +
38 +EGO_PN="github.com/${PN}/${PN}"
39 +
40 +inherit golang-vcs-snapshot systemd user versionator
41 +
42 +DESCRIPTION="Open Source Continuous File Synchronization"
43 +HOMEPAGE="https://syncthing.net"
44 +SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
45 +
46 +LICENSE="MPL-2.0"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~x86 ~arm"
49 +IUSE="tools"
50 +
51 +DOCS="README.md AUTHORS CONTRIBUTING.md"
52 +
53 +pkg_setup() {
54 + enewgroup ${PN}
55 + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
56 +
57 + if use tools ; then
58 + # separate user for the relay server
59 + enewgroup strelaysrv
60 + enewuser strelaysrv -1 -1 /var/lib/strelaysrv strelaysrv
61 + # and his home folder
62 + keepdir /var/lib/strelaysrv
63 + fowners strelaysrv:strelaysrv /var/lib/strelaysrv
64 + fi
65 +}
66 +
67 +src_prepare() {
68 + default
69 + sed -i \
70 + 's|^ExecStart=.*|ExecStart=/usr/libexec/syncthing/strelaysrv|' \
71 + src/${EGO_PN}/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service \
72 + || die
73 +}
74 +
75 +src_compile() {
76 + export GOPATH="${S}:$(get_golibdir_gopath)"
77 + cd src/${EGO_PN} || die
78 + # If we pass "build" to build.go, it builds only syncthing itself, and
79 + # places the binary in the root folder. If we do not pass "build", all the
80 + # tools are built, and all binaries are placed in folder ./bin.
81 + ST_BUILD="build"
82 + if use tools ; then
83 + ST_BUILD=""
84 + fi
85 + go run build.go -version "v${PV}" -no-upgrade ${ST_BUILD} || die "build failed"
86 +}
87 +
88 +src_test() {
89 + cd src/${EGO_PN} || die
90 + go run build.go test || die "test failed"
91 +}
92 +
93 +src_install() {
94 + cd src/${EGO_PN} || die
95 + doman man/*.[157]
96 + einstalldocs
97 +
98 + if use tools ; then
99 + dobin bin/syncthing
100 + exeinto /usr/libexec/syncthing
101 + for exe in bin/* ; do
102 + [ "${exe}" = "bin/syncthing" ] || doexe "${exe}"
103 + done
104 + else
105 + dobin syncthing
106 + fi
107 +
108 + # openrc and systemd service files
109 + systemd_dounit "${S}"/src/${EGO_PN}/etc/linux-systemd/system/${PN}@.service \
110 + "${S}"/src/${EGO_PN}/etc/linux-systemd/system/${PN}-resume.service
111 + systemd_douserunit "${S}"/src/${EGO_PN}/etc/linux-systemd/user/${PN}.service
112 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
113 + newinitd "${FILESDIR}/${PN}.initd" ${PN}
114 +
115 + keepdir /var/{lib,log}/${PN}
116 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
117 + insinto /etc/logrotate.d
118 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
119 +
120 + if use tools ; then
121 + # openrc and systemd service files
122 + systemd_dounit "${S}"/src/${EGO_PN}/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service
123 + newconfd "${FILESDIR}/strelaysrv.confd" strelaysrv
124 + newinitd "${FILESDIR}/strelaysrv.initd" strelaysrv
125 +
126 + insinto /etc/logrotate.d
127 + newins "${FILESDIR}/strelaysrv.logrotate" strelaysrv
128 + fi
129 +}
130 +
131 +pkg_postinst() {
132 + local v
133 + for v in ${REPLACING_VERSIONS}; do
134 + if [[ $(get_version_component_range 2) -gt \
135 + $(get_version_component_range 2 ${v}) ]]; then
136 + ewarn "Version ${PV} is not protocol-compatible with version" \
137 + "0.$(($(get_version_component_range 2) - 1)).x or lower."
138 + ewarn "Make sure all your devices are running at least version" \
139 + "0.$(get_version_component_range 2).0."
140 + fi
141 + done
142 +
143 + # check if user syncthing-relaysrv exists
144 + # if yes, warn that it has been moved to strelaysrv
145 + if [ -n "$(egetent passwd syncthing-relaysrv 2>/dev/null)" ]; then
146 + ewarn
147 + ewarn "The user and group for the relay server have been changed"
148 + ewarn "from syncthing-relaysrv to strelaysrv"
149 + ewarn "The old user and group are not deleted automatically. Delete them by running:"
150 + ewarn " userdel -r syncthing-relaysrv"
151 + ewarn " groupdel syncthing-relaysrv"
152 + fi
153 +}