From 016ff095f2c533f24ffde7d6b4b62a6069ce24bb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 17 Mar 2020 15:03:46 +0100 Subject: import from Fedora --- php-webflo-drupal-finder.spec | 148 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 php-webflo-drupal-finder.spec (limited to 'php-webflo-drupal-finder.spec') diff --git a/php-webflo-drupal-finder.spec b/php-webflo-drupal-finder.spec new file mode 100644 index 0000000..96f779c --- /dev/null +++ b/php-webflo-drupal-finder.spec @@ -0,0 +1,148 @@ +# +# Fedora spec file for php-webflow-drupal-finder +# +# Copyright (c) 2020 Shawn Iwinski +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + +%global github_owner webflo +%global github_name drupal-finder +%global github_version 1.2.0 +%global github_commit 123e248e14ee8dd3fbe89fb5a733a6cf91f5820e + +%global composer_vendor webflo +%global composer_project drupal-finder + +# mikey179/vfsstream: ^1.6 +%global mikey179_vfsstream_min_ver 1.6 +%global mikey179_vfsstream_max_ver 2.0 + +# Build using "--without tests" to disable tests +%global with_tests 0%{!?_without_tests:1} + +# Range dependencies supported? +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global with_range_dependencies 1 +%else +%global with_range_dependencies 0 +%endif + +%{!?phpdir: %global phpdir %{_datadir}/php} + +Name: php-%{composer_vendor}-%{composer_project} +Version: %{github_version} +Release: 1%{?github_release}%{?dist} +Summary: Provides a class to locate a Drupal installation in a given path + +License: GPLv2+ +URL: https://github.com/%{github_owner}/%{github_name} +Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +# Add license file +# https://github.com/webflo/drupal-finder/pull/50 +# https://github.com/webflo/drupal-finder/pull/50.patch +Patch0: %{name}-pr50.patch + +BuildArch: noarch +# Tests +%if %{with_tests} +## composer.json +BuildRequires: php-json +BuildRequires: php-composer(phpunit/phpunit) +%if %{with_range_dependencies} +BuildRequires: (php-composer(mikey179/vfsstream) >= %{mikey179_vfsstream_min_ver} with php-composer(mikey179/vfsstream) < %{mikey179_vfsstream_max_ver}) +%else +BuildRequires: php-composer(mikey179/vfsstream) >= %{mikey179_vfsstream_min_ver} +BuildRequires: php-composer(mikey179/vfsstream) < %{mikey179_vfsstream_max_ver} +%endif +## phpcompatinfo for version 1.2.0 +BuildRequires: php(language) >= 5.4.0 +## Autoloader +BuildRequires: php-composer(fedora/autoloader) +%endif + +# composer.json +Requires: php-json +# phpcompatinfo for version 1.2.0 +Requires: php(language) >= 5.4.0 +# Autoloader +Requires: php-composer(fedora/autoloader) + +# Composer +Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} + +%description +%{summary}. + +Autoloader: %{phpdir}/DrupalFinder/autoload.php + + +%prep +%setup -qn %{github_name}-%{github_commit} + +# Add license file +%patch0 -p1 + + +%build +: Create autoloader +cat <<'AUTOLOAD' | tee src/autoload.php + - 1.2.0-1 +- Initial package -- cgit