Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/syncthing/
Date: Thu, 26 Jul 2018 10:13:44
Message-Id: 1532594866.f1ac06c36a288df21104ce6353e28f84b72995ec.marecki@gentoo
1 commit: f1ac06c36a288df21104ce6353e28f84b72995ec
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 26 08:47:46 2018 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 26 08:47:46 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1ac06c3
7
8 net-p2p/syncthing: bump to 0.14.49
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 net-p2p/syncthing/Manifest | 1 +
13 net-p2p/syncthing/syncthing-0.14.49.ebuild | 123 +++++++++++++++++++++++++++++
14 2 files changed, 124 insertions(+)
15
16 diff --git a/net-p2p/syncthing/Manifest b/net-p2p/syncthing/Manifest
17 index fefa0b45d33..a709f42dafb 100644
18 --- a/net-p2p/syncthing/Manifest
19 +++ b/net-p2p/syncthing/Manifest
20 @@ -1,3 +1,4 @@
21 DIST syncthing-0.14.38.tar.gz 8246629 BLAKE2B 93c01750fedd57cc07bffa14fe65d98fc1cf48b43eaf965fc3ff9546a24acada411a89a19b47e2f5b5e7508e57646d0560559c35bb3c378b7c04e3db14b7ffaa SHA512 be5f7527d63e8db427705c34b26d783d9abd7cb5727d3dcf08ee62b1ace5454b7dfed4f030ec53e847a34f560cf349460f68c859a1008c5105aef65ef42c5cc5
22 DIST syncthing-0.14.46.tar.gz 10200015 BLAKE2B 679b82af8ee5dad769ef01b77d0d3545d953ec2f2889faa129c433863094f431bf3e44a633109d944cbcaba6486a8b51257557eddfc20a2fb3f0cd8a77861b96 SHA512 ebf8491d1ac1dda90df35b8a9dafb808a9171d4a8083f0f24ac1c9b3aa8d2baac6cef61c5cd897a88c3fb93b114d79a31a341168859f091ed2cdef529321178c
23 DIST syncthing-0.14.47.tar.gz 10278343 BLAKE2B 8aace6ae059af3317a4f1aabfc06ff21140168428fa5a808dbb3aacbb27fdbfbe56ff910124b5b4c5b54637d444178ddc31492a59ec0bbd7fa4012a2e59ce997 SHA512 16718528fd4c618ea0e0eab1971405870d72ac60d391c27a06313a6ce9b9d023301eac052cfc00aab51e2b1f7c65800becfb822c5bca2d467fcb267b77ba55a9
24 +DIST syncthing-0.14.49.tar.gz 10952008 BLAKE2B a5c5b59720585a6a444d4c0a25c22639263330c1a1987471149773b257a3a0975428c3d63885f567fefbeb7cdf690f0a7ac3296448a2ca070d8ce53e3d657879 SHA512 7a9974e0d45582c5f184165456ea8fcaca0f7ba07a01b9f8eb2de1e1f0410ca36dc978ddde9c725a2b9d08bae8286fc2ce67595a0e510cbfe22fde9cdd9fc694
25
26 diff --git a/net-p2p/syncthing/syncthing-0.14.49.ebuild b/net-p2p/syncthing/syncthing-0.14.49.ebuild
27 new file mode 100644
28 index 00000000000..00190a582b6
29 --- /dev/null
30 +++ b/net-p2p/syncthing/syncthing-0.14.49.ebuild
31 @@ -0,0 +1,123 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +EGO_PN="github.com/${PN}/${PN}"
38 +
39 +inherit golang-vcs-snapshot systemd user versionator
40 +
41 +DESCRIPTION="Open Source Continuous File Synchronization"
42 +HOMEPAGE="https://syncthing.net"
43 +SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
44 +
45 +LICENSE="MPL-2.0"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~arm ~x86"
48 +IUSE="selinux tools"
49 +
50 +RDEPEND="selinux? ( sec-policy/selinux-syncthing )"
51 +
52 +DOCS=( README.md AUTHORS CONTRIBUTING.md )
53 +
54 +pkg_setup() {
55 + enewgroup ${PN}
56 + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
57 +
58 + if use tools ; then
59 + # separate user for the relay server
60 + enewgroup strelaysrv
61 + enewuser strelaysrv -1 -1 /var/lib/strelaysrv strelaysrv
62 + # and his home folder
63 + keepdir /var/lib/strelaysrv
64 + fowners strelaysrv:strelaysrv /var/lib/strelaysrv
65 + fi
66 +}
67 +
68 +src_prepare() {
69 + default
70 + sed -i \
71 + 's|^ExecStart=.*|ExecStart=/usr/libexec/syncthing/strelaysrv|' \
72 + src/${EGO_PN}/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service \
73 + || die
74 +}
75 +
76 +src_compile() {
77 + export GOPATH="${S}:$(get_golibdir_gopath)"
78 + cd src/${EGO_PN} || die
79 + go run build.go -version "v${PV}" -no-upgrade install \
80 + $(usex tools "all" "") || die "build failed"
81 +}
82 +
83 +src_test() {
84 + cd src/${EGO_PN} || die
85 + go run build.go test || die "test failed"
86 +}
87 +
88 +src_install() {
89 + pushd src/${EGO_PN} >& /dev/null || die
90 + doman man/*.[157]
91 + einstalldocs
92 +
93 + dobin bin/syncthing
94 + if use tools ; then
95 + exeinto /usr/libexec/syncthing
96 + local exe
97 + for exe in bin/* ; do
98 + [[ "${exe}" == "bin/syncthing" ]] || doexe "${exe}"
99 + done
100 + fi
101 + popd >& /dev/null || die
102 +
103 + # openrc and systemd service files
104 + systemd_dounit src/${EGO_PN}/etc/linux-systemd/system/${PN}{@,-resume}.service
105 + systemd_douserunit src/${EGO_PN}/etc/linux-systemd/user/${PN}.service
106 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
107 + newinitd "${FILESDIR}/${PN}.initd" ${PN}
108 +
109 + keepdir /var/{lib,log}/${PN}
110 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
111 + insinto /etc/logrotate.d
112 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
113 +
114 + if use tools ; then
115 + # openrc and systemd service files
116 + systemd_dounit src/${EGO_PN}/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service
117 + newconfd "${FILESDIR}/strelaysrv.confd" strelaysrv
118 + newinitd "${FILESDIR}/strelaysrv.initd" strelaysrv
119 +
120 + insinto /etc/logrotate.d
121 + newins "${FILESDIR}/strelaysrv.logrotate" strelaysrv
122 + fi
123 +}
124 +
125 +pkg_postinst() {
126 + local v
127 + for v in ${REPLACING_VERSIONS}; do
128 + if [[ $(get_version_component_range 2) -gt \
129 + $(get_version_component_range 2 ${v}) ]]; then
130 + ewarn "Version ${PV} is not protocol-compatible with version" \
131 + "0.$(($(get_version_component_range 2) - 1)).x or lower."
132 + ewarn "Make sure all your devices are running at least version" \
133 + "0.$(get_version_component_range 2).0."
134 + fi
135 + ewarn "Syncthing OpenRC init script now uses the upstream default of"
136 + ewarn ""
137 + ewarn " /var/lib/${PN}/.config/${PN}"
138 + ewarn ""
139 + ewarn "as its configuration directory. Please set SYNCTHING_HOMEDIR"
140 + ewarn "to /var/lib/${PN} in /etc/conf.d/${PN} if you wish to continue"
141 + ewarn "using the old Gentoo default. Systemd users are not affected."
142 + done
143 +
144 + # check if user syncthing-relaysrv exists
145 + # if yes, warn that it has been moved to strelaysrv
146 + if [[ -n "$(egetent passwd syncthing-relaysrv 2>/dev/null)" ]]; then
147 + ewarn
148 + ewarn "The user and group for the relay server have been changed"
149 + ewarn "from syncthing-relaysrv to strelaysrv"
150 + ewarn "The old user and group are not deleted automatically. Delete them by running:"
151 + ewarn " userdel -r syncthing-relaysrv"
152 + ewarn " groupdel syncthing-relaysrv"
153 + fi
154 +}