Use automatic dependency generation for RPM builds. (#9937)
Our current RPM spec file includes _all_ of our library dependencies as statically listed `Requires:` lines. This, in turn, requires a very large number of conditionals in the dependencies to account for package naming differences between RPM distros, and also makes it a pain in the arse to port the spec file to work with new releases of existing distros. This changes the spec file to just use the automatic `Requires:` generation functionality that's already included in the RPM build process. The net effect is that the spec file ends up much cleaner, and it works just about anywhere with minimal modification., as well as us not having to track anything but build dependencies manually.
Austin S. Hemmelgarn committed
Sep 17, 2020 at 07:46 UTC
8f7b2c80692c909b1f88a59dec6f1172b7d8798e
1 file changed
+7
-44
netdata.spec.in
+7
-44
@@ -5,6 +5,11 @@
5
#TODO: Temporary fix for the build-id error during go.d plugin set up
6
%global _missing_build_ids_terminate_build 0
7
8
+# XXX: We are using automatic `Requires:` generation for libraries
9
+# whenever possible, DO NOT LIST LIBRARY DEPENDENCIES UNLESS THE RESULTANT
10
+# PACKAGE IS BROKEN WITHOUT THEM.
11
+AutoReqProv: yes
12
+
13
%if "@HAVE_LIBBPF@" == "1"
14
%global have_bpf 1
15
%else
@@ -148,31 +153,10 @@ BuildRequires: json-c-devel
153
# Runtime dependencies
154
#
155
Requires: python
151
-Requires: zlib
152
-%if 0%{?suse_version}
153
-# for libuv, Requires version >= 1
154
-Requires: libuv1
155
-Requires: libJudy1
156
-Requires: libjson-c4
157
-Requires: libuuid1
158
-%else
159
-# for libuv, Requires version >= 1
160
-Requires: libuv >= 1
161
-Requires: Judy
162
-Requires: json-c
163
-Requires: libuuid
164
-%endif
165
-Requires: openssl
166
-Requires: lz4
156
157
# Core requirements for the install to succeed
158
Requires(pre): /usr/sbin/groupadd
159
Requires(pre): /usr/sbin/useradd
171
-%if 0%{?suse_version} >= 1140
172
-Requires(post): libcap1
173
-%else
174
-Requires(post): libcap
175
-%endif
160
161
%{netdata_initd_requires}
162
@@ -188,19 +172,6 @@ BuildRequires: libmnl-devel
172
BuildRequires: libnetfilter_acct-devel
173
%endif
174
191
-%if 0%{?suse_version}
192
-Requires: libmnl0
193
-%else
194
-Requires: libmnl
195
-%endif
196
-
197
-%if 0%{?fedora}
198
-Requires: libnetfilter_acct
199
-%else
200
-%if 0%{?suse_version} >= 1140
201
-Requires: libnetfilter_acct1
202
-%endif
203
-%endif
175
# end nfacct plugin dependencies
176
177
# freeipmi plugin dependencies
@@ -221,16 +192,6 @@ BuildRequires: libprotobuf-c-devel
192
%else
193
BuildRequires: protobuf-c-devel
194
%endif
224
-
225
-%if 0%{?suse_version}
226
-Requires: libsnappy1
227
-Requires: protobuf-c
228
-Requires: libprotobuf15
229
-%else
230
-Requires: snappy
231
-Requires: protobuf-c
232
-Requires: protobuf
233
-%endif
195
# end - prometheus remote write dependencies
196
197
# #####################################################################
@@ -559,6 +520,8 @@ are sensor monitoring, system event monitoring, power control, and serial-over-L
520
%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
521
522
%changelog
523
+* Wed Sep 16 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-14
524
+- Convert to using 'AutoReq: yes' for library dependencies.
525
* Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13
526
- Add handling for custom libmosquitto fork
527
* Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12