From 5fdf534a4ef577ed8cd53e5f1ec6552b23fa40cc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 21 Apr 2017 16:04:20 +0200 Subject: v1.1.0 - New package --- .gitignore | 7 ++++ Makefile | 4 ++ composer.json | 27 +++++++++++++ php-theseer-tokenizer.spec | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 composer.json create mode 100644 php-theseer-tokenizer.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +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..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2870c70 --- /dev/null +++ b/composer.json @@ -0,0 +1,27 @@ +{ + "name": "theseer/tokenizer", + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "support": { + "issues": "https://github.com/theseer/tokenizer/issues" + }, + "require": { + "php": "^7.0", + "ext-xmlwriter": "*", + "ext-dom": "*", + "ext-tokenizer": "*" + }, + "autoload": { + "classmap": [ + "src/" + ] + } +} + diff --git a/php-theseer-tokenizer.spec b/php-theseer-tokenizer.spec new file mode 100644 index 0000000..a80aa9e --- /dev/null +++ b/php-theseer-tokenizer.spec @@ -0,0 +1,99 @@ +# remirepo/fedora spec file for php-theseer-tokenizer +# +# Copyright (c) 2017 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit cb2f008f3f05af2893a87208fe6a6c4985483f8b +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_vendor theseer +%global gh_project tokenizer +%global ns_vendor TheSeer +%global ns_project Tokenizer + +Name: php-%{gh_vendor}-%{gh_project} +Version: 1.1.0 +Release: 1%{?dist} +Summary: Library for converting tokenized PHP source code into XML + +Group: Development/Libraries +License: BSD +URL: https://github.com/%{gh_vendor}/%{gh_project} +Source0: https://github.com/%{gh_vendor}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{?gh_short}.tar.gz + +BuildArch: noarch +BuildRequires: php(language) >= 7.0 +BuildRequires: php-xmlwriter +BuildRequires: php-dom +BuildRequires: php-tokenizer +BuildRequires: php-pcre +BuildRequires: php-spl +# Autoloader +BuildRequires: php-fedora-autoloader-devel +# Tests +BuildRequires: phpunit6 + +# From composer.json, "require": { +# "php": "^7.0", +# "ext-xmlwriter": "*", +# "ext-dom": "*", +# "ext-tokenizer": "*" +Requires: php(language) >= 7.0 +Requires: php-xmlwriter +Requires: php-dom +Requires: php-tokenizer +# From phpcompatinfo report for version 1.1.0 +Requires: php-pcre +Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) >= 1.0.0 + +Provides: php-composer(%{gh_vendor}/%{gh_project}) = %{version} + + +%description +A small library for converting tokenized PHP source code into XML +and potentially other formats. + +Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + + +%build +: Generate a simple classmap autoloader +%{_bindir}/phpab --template fedora2 --output src/autoload.php src + + +%install +mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} +cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project} + + +%check +ret=0 +for cmd in php php70 php71 php72; do + if which $cmd; then + $cmd -d include_path=.:%{buildroot}%{php_home}:%{php_home} \ + %{_bindir}/phpunit6 \ + --bootstrap %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php \ + --no-coverage --verbose || ret=1 + fi +done +exit $ret + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README.md composer.json +%dir %{_datadir}/php/%{ns_vendor} + %{_datadir}/php/%{ns_vendor}/%{ns_project} + + +%changelog +* Fri Apr 21 2017 Remi Collet - 1.1.0-1 +- initial package, version 1.1.0 -- cgit