Blob Blame History Raw
%global commit 0759f1d823cae572c02e818876168092c7e956ec
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:		libs3
Version:	2.0
Release:	0.4.20160322git%{shortcommit}%{?dist}
Summary:	C Library and Tools for Amazon S3 Access

Group:		System Environment/Libraries
License:	LGPLv3
URL:		https://github.com/bji/libs3
Source0:	https://github.com/bji/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	curl-devel
BuildRequires:	libxml2-devel

%description
This package includes the libs3 shared object library, needed to run
applications compiled against libs3, and additionally contains the s3
utility for accessing Amazon S3.

%package	devel
Summary:	Development files for %{name}
Group:		Development/Libraries
Requires:	%{name}%{?_isa} = %{version}-%{release}

%description	devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q -n %{name}-%{commit}

%if %{?rhel}%{!?rhel:0} == 5
# Adapt to older version of libcurl
sed 's/CURLE_PEER_FAILED_VERIFICATION/CURLE_SSL_PEER_CERTIFICATE/' \
    -i src/request.c
%endif

sed -e 's!^CFLAGS +=!& %{optflags}!' \
    -e 's!^LDFLAGS =!& %{?__global_ldflags}!' \
    -e 's!install -Dps!install -Dp!' \
    -i GNUmakefile

%build
make %{?_smp_mflags} exported VERBOSE=1

%install
rm -rf %{buildroot}
make %{?_smp_mflags} install VERBOSE=1 \
     DESTDIR=%{buildroot}%{_prefix} LIBDIR=%{buildroot}%{_libdir}
rm %{buildroot}%{_libdir}/libs3.a
chmod 755 %{buildroot}%{_libdir}/libs3.so.2.0

%check
make %{?_smp_mflags} test VERBOSE=1

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%{_bindir}/s3
%{_libdir}/libs3.so.*
%{!?_licensedir: %doc COPYING LICENSE}
%{?_licensedir: %license COPYING LICENSE}

%files devel
%{_includedir}/libs3.h
%{_libdir}/libs3.so

%changelog
* Fri May 20 2016 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0-0.4.20160322git0759f1d
- New github snapshot
- Drop patch libs3-format.patch (accepted upstream)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-0.3.20150902git247ba1b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Sep 23 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0-0.2.20150902git247ba1b
- Fix compilation on 32 bit archs

* Wed Sep 09 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0-0.1.20150902git247ba1b
- Initial package