Skip to content

Stop downloading unused curl #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: stackdriver-agent-5.5.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ CURL_VERSION=7.52.1
endif
endif

ifeq ($(filter sles%,$(DISTRO)),) # If DISTRO is not sles*.
vendor:
[ -f curl-$(CURL_VERSION).tar.bz2 ] || curl -O https://curl.haxx.se/download/curl-$(CURL_VERSION).tar.bz2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have to fix all parts of the RPM spec that use bundle_curl (that's where this downloaded source is used).

sha1sum -c curl-$(CURL_VERSION).sha1
else
vendor:;true
endif

TOPDIR=/root/rpmbuild

Expand Down
1 change: 0 additions & 1 deletion rpm/curl-7.34.0.sha1

This file was deleted.

1 change: 0 additions & 1 deletion rpm/curl-7.52.1.sha1

This file was deleted.

36 changes: 0 additions & 36 deletions rpm/stackdriver-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
%define bundle_mongo 1
%define varnish 1
%define java_plugin 1
%define bundle_curl 1
%define curl_version 7.34.0
%define java_version 1.6.0
%define java_lib_location /usr/lib/jvm/java
Expand All @@ -64,7 +63,6 @@
%endif

%if 0%{?suse_version} > 0
%define bundle_curl 0
%define java_lib_location /usr/lib64/jvm/java
%if 0%{?suse_version} < 1500
%define java_version 1.7.0
Expand All @@ -80,11 +78,6 @@
%define redis_flag --enable-redis --with-libhiredis
%endif

%if %{bundle_curl}
%define curl_include -Icurl-%{curl_version}/include
%define libcurl_flag --with-libcurl=%{buildroot}/%{_prefix}
%endif

%if %{has_yajl}
%define curl_json_flag --enable-curl_json
%define gcm_flag --enable-write_gcm
Expand Down Expand Up @@ -116,11 +109,6 @@ Group: System Environment/Daemons
URL: http://www.stackdriver.com/

Source: stackdriver-agent-%{version}.orig.tar.gz
%if %{bundle_curl}
# embed libcurl so we know it's linked against openssl instead of
# nss. this avoids problems of nss leaking with libcurl. sigh.
Source1: curl-%{curl_version}.tar.bz2
%endif
Source200: stackdriver-agent
Source201: collectd.conf
Source202: stackdriver.sysconfig
Expand All @@ -141,9 +129,7 @@ BuildRequires: flex
BuildRequires: libtool
BuildRequires: rpm-build
%endif
%if ! %{bundle_curl}
BuildRequires: libcurl-devel
%endif
%if 0%{?suse_version} > 0
BuildRequires: libmysqlclient-devel
%else
Expand Down Expand Up @@ -249,21 +235,8 @@ Currently includes collectd.
%prep
%setup -q -n collectd-pristine
# update for aarch64
%if %{bundle_curl}
%setup -q -n collectd-pristine -a 1
%endif

%build
%if %{bundle_curl}
# build libcurl first
pushd curl-%{curl_version}
./configure --prefix=%{buildroot}%{_prefix} --with-ssl --disable-threaded-resolver --enable-ipv6 \
--with-libidn --disable-shared --enable-static --disable-manual \
--with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt
%{__make} %{?_smp_mflags}
%{__make} install
popd
%endif
export PATH=%{buildroot}/%{_prefix}/bin:$PATH

# re-generate build files
Expand Down Expand Up @@ -329,15 +302,6 @@ export PATH=%{buildroot}/%{_prefix}/bin:$PATH


%install
# we have to reinstall as %%install cleans the buildroot
%if %{bundle_curl}
pushd curl-%{curl_version}
%{__make} install
# now remove things to avoid unpackaged files
rm -rf %{buildroot}/%{_prefix}/bin %{buildroot}/%{_prefix}/man
rm -rf %{buildroot}/%{_prefix}/share %{buildroot}/%{_prefix}/lib*/pkgconfig
popd
%endif

%{__rm} -rf contrib/SpamAssassin
%{__make} install DESTDIR="%{buildroot}"
Expand Down