File libmemcache.spec of Package libmemcache-1.0.18
#
# spec file for package libffi
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: libmemcache-1.0.18
Version: 1.0.18
Release: 1
Summary: This is a dependency used in SUSE CAP buildpacks
License: BSD-3-Clause
Group: Cloud/Platform/scf
Url: http://libmemcached.org/License.html
Source0: https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
Source1: sources.yml
Patch0: libmemcached-gcc7-build.patch
BuildRequires: gcc-c++
# cyrus-sasl build requires
BuildRequires: openssl-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: cyrus-sasl
BuildRoot: %{_tmppath}/%{name}-build
# BEGIN shared macros for all dependency packages
BuildRequires: aaa_stack_build_requires
%if 0%{?suse_version} == 1315
%if 0%{?is_opensuse}
%define stack opensuse42
%else
%define stack sle12
%endif
%else
%define stack sle15
%endif
%define otherdir %{_topdir}/OTHER
%define prefix_path /app/vendor/%{name}
%define destdir /tmp/%{name}
%define dependencydir %{destdir}%{prefix_path}
# END shared macros
%description
%prep
%setup -q -n libmemcached-%{version}
%if 0%{?suse_version} != 1315
%patch0 -p1
%endif
%build
mkdir -p %{destdir}
./configure --prefix=%{prefix_path}
make %{?_smp_mflags}
%install
make install DESTDIR=%{destdir}
# copy cyrus sasl libraries
cp -a /usr/lib64/sasl2 lib/
cp /usr/lib64/libsasl* lib/
cp -a /usr/include/sasl include/
TARBALL=%{otherdir}/%{name}-linux-x64.tgz
pushd %{dependencydir}
# The upstream binary-builder is using `cp -r` which has the same effect
# as the --hard-dereference flag here.
# (https://github.com/cloudfoundry/binary-builder/blob/master/lib/archive_recipe.rb#L20)
tar -C %{dependencydir} -czvf ${TARBALL} --hard-dereference * --owner=0 --group=0
popd
CHECKSUM=`sha256sum ${TARBALL}`
NEW_TARBALL=%{otherdir}/%{name}-linux-x64-%{stack}-${CHECKSUM:0:8}.tgz
mv ${TARBALL} ${NEW_TARBALL}
pushd $(dirname ${NEW_TARBALL})
sha256sum $(basename ${NEW_TARBALL}) > ${NEW_TARBALL}.sha256
popd
%post
%postun
%files
%defattr(-,root,root)
%changelog