diff options
author | Remi Collet <remi@remirepo.net> | 2018-06-11 11:15:22 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-06-11 11:15:22 +0200 |
commit | 79304342a276e62abd5b46385dacda0b3c8b9459 (patch) | |
tree | 94a76497b3cb7e671898d8f9e63554343f7c74a8 |
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | composer.json | 35 | ||||
-rw-r--r-- | php-aura-intl.spec | 111 |
4 files changed, 157 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a2cd659 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..6366d0a --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "aura/intl", + "type": "library", + "description": "The Aura Intl package provides internationalization tools, specifically message translation.", + "keywords": [ + "intl", + "internationalization", + "i18n", + "l10n", + "localization", + "globalization", + "g11n" + ], + "homepage": "https://github.com/auraphp/Aura.Intl", + "license": "MIT", + "authors": [ + { + "name": "Aura.Intl Contributors", + "homepage": "https://github.com/auraphp/Aura.Intl/contributors" + } + ], + "require": { + "php": "^5.6|^7.0" + }, + "autoload": { + "psr-4": { + "Aura\\Intl\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Aura\\Intl\\": "tests/" + } + } +} diff --git a/php-aura-intl.spec b/php-aura-intl.spec new file mode 100644 index 0000000..8467bfb --- /dev/null +++ b/php-aura-intl.spec @@ -0,0 +1,111 @@ +# remirepo/Fedora spec file for php-aura-intl +# +# Copyright (c) 2018 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global bootstrap 0 +%global gh_commit 7fce228980b19bf4dee2d7bbd6202a69b0dde926 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner auraphp +%global gh_project Aura.Intl +%global pk_owner aura +%global pk_project intl +%global ns_owner Aura +%global ns_project Intl +%global php_home %{_datadir}/php +%global with_tests 0%{!?_without_tests:1} + +Name: php-%{pk_owner}-%{pk_project} +Version: 3.0.0 +Release: 1%{?dist} +Summary: Internationalization tools + +Group: Development/Libraries +License: MIT +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz + +BuildArch: noarch +BuildRequires: php-composer(fedora/autoloader) +# Tests +%if %{with_tests} +BuildRequires: php(language) >= 5.6 +BuildRequires: php-intl +BuildRequires: %{_bindir}/phpunit +BuildRequires: php-composer(fedora/autoloader) +%endif + +# From composer, "require": { +# "php": "^5.6|^7.0" +Requires: php(language) >= 5.6 +# From phpcompatinfo report for version 3.0.0 +Requires: php-intl +# Autoloader +Requires: php-composer(fedora/autoloader) + +Provides: php-composer(%{pk_owner}/%{pk_project}) = %{version} + + +%description +The Aura.Intl package provides internationalization (I18N) tools, +specifically package-oriented per-locale message translation. + +Autoloader: %{php_home}/%{ns_owner}/%{ns_project}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + + +%build +cat << 'EOF' | tee -a src/autoload.php +<?php +/* Autoloader for %{pk_owner}/%{pk_project} and its dependencies */ + +require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Aura\\Intl\\', __DIR__); +EOF + + +%install +mkdir -p %{buildroot}%{php_home}/%{ns_owner} +cp -pr src %{buildroot}%{php_home}/%{ns_owner}/%{ns_project} + + +%check +%if %{with_tests} + +mkdir vendor +cat << 'EOF' | tee -a vendor/autoload.php +<?php +require '%{buildroot}/%{php_home}/%{ns_owner}/%{ns_project}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Aura\\Intl\\', dirname(__DIR__) . '/tests'); +EOF + +ret=0 +for cmd in php php70 php71 php72 php73; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose || ret=1 + fi +done +exit $ret +%else +: Test suite disabled +%endif + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *.md +%doc composer.json +%dir %{php_home}/%{ns_owner}/ + %{php_home}/%{ns_owner}/%{ns_project}/ + + +%changelog +* Mon Jun 11 2018 Remi Collet <remi@remirepo.net> - 3.0.0-1 +- initial package |