From 549dcc067add4392e10675a430b527c22a6ffbb9 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Jan 14 2020 10:08:43 +0000 Subject: import from review #1789783 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df84f80 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/php-webimpress-http-middleware-compatibility-0.1.4-8ed1c2c.tgz diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..87a1c0b --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +NAME=$(basename $PWD) +OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) +VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) +COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT\n" + +echo "Cloning..." +git clone --recursive https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + +echo "Getting commit..." +pushd $PROJECT-$COMMIT +git checkout $COMMIT +cp composer.json ../composer.json +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $PROJECT-$COMMIT + +echo "Cleaning..." +rm -rf $PROJECT-$COMMIT + +echo "Done." + diff --git a/php-webimpress-http-middleware-compatibility.spec b/php-webimpress-http-middleware-compatibility.spec new file mode 100644 index 0000000..19bd1d9 --- /dev/null +++ b/php-webimpress-http-middleware-compatibility.spec @@ -0,0 +1,133 @@ +# remirepo/fedora spec file for php-webimpress-http-middleware-compatibility +# +# Copyright (c) 2020 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# + +%global with_tests 0%{!?_without_tests:1} +# Github +%global gh_commit 8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner webimpress +%global gh_project http-middleware-compatibility +# Packagist +%global pk_vendor %{gh_owner} +%global pk_project %{gh_project} +%global major %nil + +Name: php-%{pk_vendor}-%{pk_project}%{major} +Version: 0.1.4 +Release: 1%{?dist} +Summary: Compatibility library for Draft PSR-15 HTTP Middleware + +License: BSD +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: %{name}-%{version}-%{?gh_short}.tgz +Source1: makesrc.sh + +BuildArch: noarch +%if %{with_tests} +BuildRequires: php(language) >= 5.4 +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(http-interop/http-middleware) > 0.1.1 with php-composer(http-interop/http-middleware) < 0.6) +# For tests, from composer.json "require-dev": { +# "phpunit/phpunit": "^5.7.23 || ^6.4.3" +BuildRequires: phpunit6 > 6.4.3 +%global phpunit %{_bindir}/phpunit6 +# remirepo:5 +%else +BuildRequires: php-composer(http-interop/http-middleware) +BuildRequires: php-composer(phpunit/phpunit) >= 5.7.23 +%global phpunit %{_bindir}/phpunit +%endif +%endif + +# From composer.json, "require": { +# "php": "^5.6 || ^7.0", +# "http-interop/http-middleware": "^0.1.1 || ^0.2 || ^0.3 || ^0.4.1 || ^0.5", +# "webimpress/composer-extra-dependency": "^0.2.2" +Requires: php(language) >= 5.6 +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(http-interop/http-middleware) > 0.1.1 with php-composer(http-interop/http-middleware) < 0.6) +# remirepo:3 +%else +Requires: php-composer(http-interop/http-middleware) +%endif +# From phpcompatinfo report for 0.1.4 +# Only core + +# Composer +Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version} + + +%description +The purpose of the library is to deliver consistent interface for +different versions of http-interop/http-middleware which implements +Draft of PSR-15 HTTP Middleware. + +Many projects currently use different version of library +http-interop/http-middleware and updating to newest version requires +usually major release. The library lets consumers of your component +decide what version of http-interop/http-middleware they want to use +and allow them to migrate to the latest version at any time. + +Autoloader: %{_datadir}/php/%{pk_vendor}/%{pk_project}%{major}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +mv LICENSE.md LICENSE + + +%build +cat << 'EOF' | tee autoload/autoload.php + - 0.1.4-1 +- initial package diff --git a/sources b/sources new file mode 100644 index 0000000..9b247e6 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (php-webimpress-http-middleware-compatibility-0.1.4-8ed1c2c.tgz) = 873e017899f4b39f39131ff138a1b76e66ae0e967f19a32ad956471e8d10fe81a4b94e96f084992fff732e8c6d45af39e518bf6281a5f5cb7ef5db267325c254