File composer.spec of Package composer-1.9.1
#
# spec file for SUSE CAP buildpack dependency
#
# 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.
Name: composer-1.9.1
Version: 1.9.1
Release: 1
Summary: This is a dependency used in SUSE CAP buildpacks
License: MIT
Group: Cloud/Platform/scf
Url: https://getcomposer.org
Source: https://github.com/composer/composer/releases/download/1.9.1/composer.phar
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define otherdir %{_topdir}/OTHER
%description
%prep
%build
CHECKSUM=`sha256sum %{SOURCE0}`
EXTENSION=$(echo "%{SOURCE0}" | perl -lne 'print $& if /(\.[a-zA-Z]{1,4}\.{0,1}[a-zA-Z]{0,3})/')
NEW_TARBALL=%{otherdir}/%{name}-${CHECKSUM:0:8}${EXTENSION}
cp %{SOURCE0} ${NEW_TARBALL}
pushd $(dirname ${NEW_TARBALL})
sha256sum $(basename ${NEW_TARBALL}) > ${NEW_TARBALL}.sha256
popd
%files
%defattr(-,root,root)
%changelog