Diff influxdb-1.8.10 with a influxdb-2.7.1-r1

/usr/portage/dev-db/influxdb/influxdb-2.7.1-r1.ebuild 2023-10-09 14:52:29.316368346 +0300
1
# Copyright 1999-2022 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5
inherit go-module systemd
6
GIT_COMMIT=688e697c51fd5353725da078555adbeff0363d01
7
GIT_BRANCH=1.8
5

  
6
CRATES="
7
	adler32-1.2.0
8
	ahash-0.7.6
9
	aho-corasick-0.7.18
10
	ansi_term-0.11.0
11
	ansi_term-0.12.1
12
	anyhow-1.0.56
13
	arrayvec-0.5.2
14
	atty-0.2.14
15
	autocfg-1.0.1
16
	bitflags-1.3.2
17
	bstr-0.2.17
18
	bumpalo-3.12.0
19
	cast-0.2.7
20
	cfg-if-1.0.0
21
	chrono-0.4.19
22
	clap-2.33.3
23
	codespan-reporting-0.11.1
24
	colored-2.0.0
25
	crc32fast-1.2.1
26
	criterion-0.3.5
27
	criterion-plot-0.4.4
28
	crossbeam-channel-0.5.1
29
	crossbeam-deque-0.8.1
30
	crossbeam-epoch-0.9.5
31
	crossbeam-utils-0.8.8
32
	csv-1.1.6
33
	csv-core-0.1.10
34
	ctor-0.1.21
35
	derivative-2.2.0
36
	derive_more-0.99.17
37
	diff-0.1.12
38
	dissimilar-1.0.3
39
	either-1.6.1
40
	ena-0.14.0
41
	env_logger-0.9.0
42
	expect-test-1.2.2
43
	fallible-iterator-0.2.0
44
	fallible-streaming-iterator-0.1.9
45
	fastrand-1.7.0
46
	flatbuffers-22.9.29
47
	fnv-1.0.7
48
	form_urlencoded-1.0.1
49
	getrandom-0.2.6
50
	half-1.8.2
51
	hashbrown-0.11.2
52
	hashlink-0.7.0
53
	heck-0.3.3
54
	hermit-abi-0.1.19
55
	humantime-2.1.0
56
	idna-0.2.3
57
	indexmap-1.8.1
58
	instant-0.1.12
59
	itertools-0.10.1
60
	itoa-0.4.8
61
	itoa-1.0.1
62
	js-sys-0.3.55
63
	lazy_static-1.4.0
64
	libc-0.2.121
65
	libflate-1.2.0
66
	libflate_lz77-1.1.0
67
	libsqlite3-sys-0.23.2
68
	lock_api-0.4.6
69
	log-0.4.16
70
	lsp-types-0.91.1
71
	maplit-1.0.2
72
	matches-0.1.9
73
	memchr-2.4.1
74
	memoffset-0.6.4
75
	num-integer-0.1.44
76
	num-traits-0.2.14
77
	num_cpus-1.13.0
78
	once_cell-1.10.0
79
	oorandom-11.1.3
80
	ordered-float-3.2.0
81
	output_vt100-0.1.2
82
	pad-0.1.6
83
	parking_lot-0.11.2
84
	parking_lot_core-0.8.5
85
	percent-encoding-2.1.0
86
	pkg-config-0.3.25
87
	plotters-0.3.1
88
	plotters-backend-0.3.2
89
	plotters-svg-0.3.1
90
	pretty-0.11.2
91
	pretty_assertions-1.2.1
92
	proc-macro-error-1.0.4
93
	proc-macro-error-attr-1.0.4
94
	proc-macro2-1.0.32
95
	pulldown-cmark-0.9.1
96
	quote-1.0.10
97
	rayon-1.5.2
98
	rayon-core-1.9.2
99
	redox_syscall-0.2.10
100
	regex-1.5.5
101
	regex-automata-0.1.10
102
	regex-syntax-0.6.25
103
	remove_dir_all-0.5.3
104
	rle-decode-fast-1.0.1
105
	rusqlite-0.26.3
106
	rustc-hash-1.1.0
107
	rustc_version-0.4.0
108
	ryu-1.0.5
109
	salsa-0.17.0-pre.2
110
	salsa-macros-0.17.0-pre.2
111
	same-file-1.0.6
112
	scopeguard-1.1.0
113
	semver-1.0.4
114
	serde-1.0.136
115
	serde_cbor-0.11.2
116
	serde_derive-1.0.136
117
	serde_json-1.0.79
118
	serde_repr-0.1.7
119
	smallvec-1.7.0
120
	strsim-0.8.0
121
	structopt-0.3.26
122
	structopt-derive-0.4.18
123
	syn-1.0.81
124
	tempfile-3.3.0
125
	termcolor-1.1.2
126
	textwrap-0.11.0
127
	thiserror-1.0.30
128
	thiserror-impl-1.0.30
129
	time-0.1.43
130
	tinytemplate-1.2.1
131
	tinyvec-1.5.1
132
	tinyvec_macros-0.1.0
133
	typed-arena-2.0.1
134
	unicase-2.6.0
135
	unicode-bidi-0.3.7
136
	unicode-normalization-0.1.19
137
	unicode-segmentation-1.8.0
138
	unicode-width-0.1.9
139
	unicode-xid-0.2.2
140
	url-2.2.2
141
	vcpkg-0.2.15
142
	vec_map-0.8.2
143
	version_check-0.9.3
144
	walkdir-2.3.2
145
	wasi-0.10.2+wasi-snapshot-preview1
146
	wasm-bindgen-0.2.78
147
	wasm-bindgen-backend-0.2.78
148
	wasm-bindgen-macro-0.2.78
149
	wasm-bindgen-macro-support-0.2.78
150
	wasm-bindgen-shared-0.2.78
151
	web-sys-0.3.55
152
	winapi-0.3.9
153
	winapi-i686-pc-windows-gnu-0.4.0
154
	winapi-util-0.1.5
155
	winapi-x86_64-pc-windows-gnu-0.4.0
156
"
157

  
158
inherit cargo go-module systemd
8 159

  
9 160
DESCRIPTION="Scalable datastore for metrics, events, and real-time analytics"
10 161
HOMEPAGE="https://www.influxdata.com"
11 162

  
12 163
SRC_URI="https://github.com/influxdata/influxdb/archive/v${PV}.tar.gz -> ${P}.tar.gz"
13
SRC_URI+=" https://github.com/Dwosky/packages/raw/main/${P}-deps.tar.xz"
164
SRC_URI+=" https://github.com/influxdata/ui/releases/download/OSS-v${PV}/build.tar.gz -> ${P}-assets.tar.gz"
165
SRC_URI+=" https://gentoo.kropotkin.rocks/go-pkgs/${P}-deps.tar.xz"
166
SRC_URI+=" $(cargo_crate_uris)"
14 167

  
15 168
LICENSE="Apache-2.0 BSD BSD-2 EPL-2.0 ISC MIT MPL-2.0"
16 169
SLOT="0"
17 170
KEYWORDS="~amd64"
18
IUSE="man"
171
IUSE="test"
172
RESTRICT="!test? ( test )"
173

  
174
BDEPEND="virtual/pkgconfig"
19 175

  
20
BDEPEND="man? (
21
	app-text/asciidoc
22
	app-text/xmlto
23
)"
24 176
COMMON_DEPEND="
25 177
	acct-group/influxdb
26
	acct-user/influxdb"
178
	acct-user/influxdb
179
"
180

  
27 181
DEPEND="${COMMON_DEPEND}"
28 182
RDEPEND="${COMMON_DEPEND}"
29 183

  
184
src_unpack() {
185
	cargo_src_unpack
186
}
187

  
188
src_prepare() {
189
	default
190

  
191
	local data_dir
192
	data_dir="${S}/static/data"
193
	mkdir "${data_dir}" || die
194
	mv "${WORKDIR}/build" "${data_dir}" || die
195
}
196

  
30 197
src_compile() {
198
	mv "${WORKDIR}/go-mod" "${WORKDIR}/go-mod-tmp" || die
199
	mv "${WORKDIR}/go-mod-tmp/github.com/influxdata/pkg-config@v0.2.11/go-mod" "${WORKDIR}/go-mod" || die
200
	cd "${WORKDIR}"/go-mod-tmp/github.com/influxdata/pkg-config* || die
201
	ego build .
202
	mv "${WORKDIR}/go-mod" "${WORKDIR}/go-mod-tmp/github.com/influxdata/pkg-config@v0.2.11" || die
203
	mv "${WORKDIR}/go-mod-tmp" "${WORKDIR}/go-mod" || die
204

  
205
	cd "${WORKDIR}/go-mod/github.com/influxdata/flux@v0.193.0/libflux" || die
206
	cargo_src_compile
207

  
208
	cd "${S}" || die
209

  
210
	export PKG_CONFIG="${WORKDIR}/go-mod/github.com/influxdata/pkg-config@v0.2.11/pkg-config"
211
	ego generate ./static
31 212
	GOBIN="${S}/bin" \
32
		go install \
33
		-ldflags="-X main.version=${PV}
34
			-X main.branch=${GIT_BRANCH}
35
			-X main.commit=${GIT_COMMIT}" \
36
		./... || die "compile failed"
37
	use man && emake -C man build
213
		ego install \
214
			-tags 'assets,noasm,sqlite_json,sqlite_foreign_keys' \
215
			-ldflags="-X main.version=${PV}" \
216
		./...
217
}
218

  
219
src_test() {
220
	ego test ./tests
38 221
}
39 222

  
40 223
src_install() {
41 224
	dobin bin/influx*
42 225
	dodoc *.md
43
	use man && doman man/*.1
44
	insinto /etc/influxdb
45
	newins etc/config.sample.toml influxdb.conf
46
	insinto /etc/logrotate.d
47
	newins scripts/logrotate influxdb
48
	systemd_dounit scripts/influxdb.service
49

  
226
	cd .circleci/package/fs
227
	systemd_dounit usr/lib/influxdb/scripts/influxdb.service
228
	dodir /usr/lib/influxdb/scripts
229
	exeinto /usr/lib/influxdb/scripts
230
	doexe usr/lib/influxdb/scripts/influxd-systemd-start.sh
231
	dodir /usr/share/influxdb
232
	exeinto /usr/share/influxdb
233
	doexe usr/share/influxdb/influxdb2-upgrade.sh
50 234
	newconfd "${FILESDIR}"/influxdb.confd influxdb
51 235
	newinitd "${FILESDIR}"/influxdb.initd influxdb
52 236
	keepdir /var/log/influxdb
53 237
	fowners influxdb:influxdb /var/log/influxdb
54 238
}
55 239

  
56
src_test() {
57
	go test ./tests || die
240
pkg_postinst() {
241
	elog "Upgrading from InfluxDB1.x requires migration of time series data."
242
	elog "See https://docs.influxdata.com/influxdb/v2.7/upgrade/v1-to-v2/"
243
	elog "Keep in mind that some applications not compatible with InfluxDB 2.x"
244
	elog "may stop working."
245

  
246
	ewarn "The InfluxDB command line client has been moved to dev-db/influx-cli"
247
	ewarn "You will need to install it separately"
58 248
}
Thank you!