Skip to content

Commit f5f10cf

Browse files
Don't bundle libcurl in RPM builds. (#142)
1 parent bdbd655 commit f5f10cf

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

rpm/stackdriver-agent.spec

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
%define bundle_yajl 0
3434
%define has_hiredis 1
3535
%define java_plugin 1
36-
%define bundle_curl 1
3736
%define curl_version 7.34.0
3837
%define java_version 1.6.0
3938
%define java_lib_location /usr/lib/jvm/java
@@ -59,7 +58,6 @@
5958
%endif
6059

6160
%if 0%{?suse_version} > 0
62-
%define bundle_curl 0
6361
%define java_lib_location /usr/lib64/jvm/java
6462
%if 0%{?suse_version} < 1500
6563
%define java_version 1.7.0
@@ -75,11 +73,6 @@
7573
%define redis_flag --enable-redis --with-libhiredis
7674
%endif
7775

78-
%if %{bundle_curl}
79-
%define curl_include -Icurl-%{curl_version}/include
80-
%define libcurl_flag --with-libcurl=%{buildroot}/%{_prefix}
81-
%endif
82-
8376
%if %{has_yajl}
8477
%define curl_json_flag --enable-curl_json
8578
%define gcm_flag --enable-write_gcm
@@ -98,11 +91,6 @@ Group: System Environment/Daemons
9891
URL: http://www.stackdriver.com/
9992

10093
Source: stackdriver-agent-%{version}.orig.tar.gz
101-
%if %{bundle_curl}
102-
# embed libcurl so we know it's linked against openssl instead of
103-
# nss. this avoids problems of nss leaking with libcurl. sigh.
104-
Source1: curl-%{curl_version}.tar.bz2
105-
%endif
10694
Source200: stackdriver-agent
10795
Source201: collectd.conf
10896
Source202: stackdriver.sysconfig
@@ -124,9 +112,7 @@ BuildRequires: flex
124112
BuildRequires: libtool
125113
BuildRequires: rpm-build
126114
%endif
127-
%if ! %{bundle_curl}
128115
BuildRequires: libcurl-devel
129-
%endif
130116
%if 0%{?suse_version} > 0
131117
BuildRequires: libmysqlclient-devel
132118
%else
@@ -219,35 +205,22 @@ Currently includes collectd.
219205
%prep
220206
%setup -q -n collectd-pristine
221207
# update for aarch64
222-
%if %{bundle_curl}
223-
%setup -q -n collectd-pristine -a 1
224-
%endif
225208

226209
%build
227-
%if %{bundle_curl}
228-
# build libcurl first
229-
pushd curl-%{curl_version}
230-
./configure --prefix=%{buildroot}%{_prefix} --with-ssl --disable-threaded-resolver --enable-ipv6 \
231-
--with-libidn --disable-shared --enable-static --disable-manual \
232-
--with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt
233-
%{__make} %{?_smp_mflags}
234-
%{__make} install
235-
popd
236-
%endif
210+
237211
export PATH=%{buildroot}/%{_prefix}/bin:$PATH
238212

239213
# re-generate build files
240214
./clean.sh && ./build.sh
241215

242-
%configure CFLAGS="%{optflags} -DLT_LAZY_OR_NOW='RTLD_NOW|RTLD_GLOBAL' %{?curl_include}" \
216+
%configure CFLAGS="%{optflags} -DLT_LAZY_OR_NOW='RTLD_NOW|RTLD_GLOBAL'" \
243217
--program-prefix=stackdriver- \
244218
--with-useragent="stackdriver_agent/%{version}-%{release}" \
245219
--with-data-max-name-len=256 \
246220
--disable-all-plugins \
247221
--disable-static \
248222
--disable-perl --without-libperl --without-perl-bindings \
249223
--with-libiptc \
250-
%{?libcurl_flag} \
251224
--enable-cpu \
252225
--enable-curl \
253226
--enable-df \
@@ -296,15 +269,6 @@ export PATH=%{buildroot}/%{_prefix}/bin:$PATH
296269

297270
%install
298271
# we have to reinstall as %%install cleans the buildroot
299-
%if %{bundle_curl}
300-
pushd curl-%{curl_version}
301-
%{__make} install
302-
# now remove things to avoid unpackaged files
303-
rm -rf %{buildroot}/%{_prefix}/bin %{buildroot}/%{_prefix}/man
304-
rm -rf %{buildroot}/%{_prefix}/share %{buildroot}/%{_prefix}/lib*/pkgconfig
305-
popd
306-
%endif
307-
308272
%{__rm} -rf contrib/SpamAssassin
309273
%{__make} install DESTDIR="%{buildroot}"
310274

0 commit comments

Comments
 (0)