|
Shawn Iwinski |
2394a88 |
#
|
|
Shawn Iwinski |
f02e511 |
# Fedora spec file for php-masterminds-html5
|
|
Shawn Iwinski |
2394a88 |
#
|
|
Shawn Iwinski |
2394a88 |
# Copyright (c) 2015 Shawn Iwinski <shawn.iwinski@gmail.com>
|
|
Shawn Iwinski |
2394a88 |
#
|
|
Shawn Iwinski |
2394a88 |
# License: MIT
|
|
Shawn Iwinski |
2394a88 |
# http://opensource.org/licenses/MIT
|
|
Shawn Iwinski |
2394a88 |
#
|
|
Shawn Iwinski |
2394a88 |
# Please preserve changelog entries
|
|
Shawn Iwinski |
2394a88 |
#
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%global github_owner Masterminds
|
|
Shawn Iwinski |
2394a88 |
%global github_name html5-php
|
|
Shawn Iwinski |
f02e511 |
%global github_version 2.1.2
|
|
Shawn Iwinski |
f02e511 |
%global github_commit 8f782e0f01a6e33a319bdc8f6de9cfd6569979a4
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%global composer_vendor masterminds
|
|
Shawn Iwinski |
2394a88 |
%global composer_project html5
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
# "php" : ">=5.3.0"
|
|
Shawn Iwinski |
2394a88 |
%global php_min_ver 5.3.0
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
# Build using "--without tests" to disable tests
|
|
Shawn Iwinski |
f02e511 |
%global with_tests 0%{!?_without_tests:1}
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%{!?phpdir: %global phpdir %{_datadir}/php}
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
Name: php-%{composer_vendor}-%{composer_project}
|
|
Shawn Iwinski |
2394a88 |
Version: %{github_version}
|
|
Shawn Iwinski |
f02e511 |
Release: 1%{?dist}
|
|
Shawn Iwinski |
2394a88 |
Summary: An HTML5 parser and serializer
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
Group: Development/Libraries
|
|
Shawn Iwinski |
2394a88 |
License: MIT
|
|
Shawn Iwinski |
2394a88 |
URL: http://masterminds.github.io/html5-php
|
|
Shawn Iwinski |
2394a88 |
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
BuildArch: noarch
|
|
Shawn Iwinski |
2394a88 |
# Autoload generation
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: %{_bindir}/phpab
|
|
Shawn Iwinski |
2394a88 |
# Tests
|
|
Shawn Iwinski |
2394a88 |
%if %{with_tests}
|
|
Shawn Iwinski |
2394a88 |
## composer.json
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: %{_bindir}/phpunit
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php(language) >= %{php_min_ver}
|
|
Shawn Iwinski |
f02e511 |
## phpcompatinfo (computed from version 2.1.2)
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-ctype
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-dom
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-iconv
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-json
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-mbstring
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-pcre
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-reflection
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-spl
|
|
Shawn Iwinski |
2394a88 |
BuildRequires: php-xml
|
|
Shawn Iwinski |
2394a88 |
%endif
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
# composer.json
|
|
Shawn Iwinski |
2394a88 |
Requires: php(language) >= %{php_min_ver}
|
|
Shawn Iwinski |
f02e511 |
# phpcompatinfo (computed from version 2.1.2)
|
|
Shawn Iwinski |
2394a88 |
Requires: php-ctype
|
|
Shawn Iwinski |
2394a88 |
Requires: php-dom
|
|
Shawn Iwinski |
2394a88 |
Requires: php-iconv
|
|
Shawn Iwinski |
2394a88 |
Requires: php-mbstring
|
|
Shawn Iwinski |
2394a88 |
Requires: php-pcre
|
|
Shawn Iwinski |
2394a88 |
Requires: php-spl
|
|
Shawn Iwinski |
2394a88 |
Requires: php-xml
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
# Composer
|
|
Shawn Iwinski |
2394a88 |
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%description
|
|
Shawn Iwinski |
2394a88 |
The need for an HTML5 parser in PHP is clear. This project initially began with
|
|
Shawn Iwinski |
2394a88 |
the seemingly abandoned html5lib project original source. But after some initial
|
|
Shawn Iwinski |
2394a88 |
refactoring work, we began a new parser.
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
* An HTML5 serializer
|
|
Shawn Iwinski |
2394a88 |
* Support for PHP namespaces
|
|
Shawn Iwinski |
2394a88 |
* Composer support
|
|
Shawn Iwinski |
2394a88 |
* Event-based (SAX-like) parser
|
|
Shawn Iwinski |
2394a88 |
* DOM tree builder
|
|
Shawn Iwinski |
2394a88 |
* Interoperability with QueryPath
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%prep
|
|
Shawn Iwinski |
2394a88 |
%setup -qn %{github_name}-%{github_commit}
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
# Docs
|
|
Shawn Iwinski |
2394a88 |
mkdir -p docs/{Parser,Serializer}
|
|
Shawn Iwinski |
2394a88 |
mv composer.json *.md docs/
|
|
Shawn Iwinski |
2394a88 |
mv src/HTML5/Parser/*.md docs/Parser/
|
|
Shawn Iwinski |
2394a88 |
mv src/HTML5/Serializer/*.md docs/Serializer/
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%build
|
|
Shawn Iwinski |
2394a88 |
: Generate autoloader
|
|
Shawn Iwinski |
2394a88 |
# Vendor-level autoloader to pick up "Masterminds/HTML5" class
|
|
Shawn Iwinski |
2394a88 |
%{_bindir}/phpab --nolower --output src/autoload-html5.php src
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%install
|
|
Shawn Iwinski |
2394a88 |
mkdir -p %{buildroot}%{phpdir}/Masterminds
|
|
Shawn Iwinski |
2394a88 |
cp -pr src/* %{buildroot}%{phpdir}/Masterminds/
|
|
Shawn Iwinski |
2394a88 |
# Project-level autoloader for consistency with other pkgs
|
|
Shawn Iwinski |
2394a88 |
ln -s ../autoload-html5.php %{buildroot}%{phpdir}/Masterminds/HTML5/autoload.php
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%check
|
|
Shawn Iwinski |
2394a88 |
%if %{with_tests}
|
|
Shawn Iwinski |
2394a88 |
: Generate test autoloader
|
|
Shawn Iwinski |
2394a88 |
%{_bindir}/phpab --nolower --output test/autoload.php test
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
: Create mock Composer autoloader
|
|
Shawn Iwinski |
2394a88 |
mkdir vendor
|
|
Shawn Iwinski |
2394a88 |
cat > vendor/autoload.php <<'AUTOLOAD'
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
require '%{buildroot}%{phpdir}/Masterminds/HTML5/autoload.php';
|
|
Shawn Iwinski |
2394a88 |
require __DIR__ . '/../test/autoload.php';
|
|
Shawn Iwinski |
2394a88 |
AUTOLOAD
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
: Run tests
|
|
Shawn Iwinski |
f02e511 |
%{_bindir}/phpunit -v
|
|
Shawn Iwinski |
2394a88 |
%else
|
|
Shawn Iwinski |
2394a88 |
: Tests skipped
|
|
Shawn Iwinski |
2394a88 |
%endif
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%files
|
|
Shawn Iwinski |
2394a88 |
%{!?_licensedir:%global license %%doc}
|
|
Shawn Iwinski |
2394a88 |
%license LICENSE.txt
|
|
Shawn Iwinski |
2394a88 |
%doc docs/*
|
|
Shawn Iwinski |
2394a88 |
%{phpdir}/Masterminds
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
|
|
Shawn Iwinski |
2394a88 |
%changelog
|
|
Shawn Iwinski |
f02e511 |
* Sun Jun 28 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.1.2-1
|
|
Shawn Iwinski |
f02e511 |
- Updated to 2.1.2 (RHBZ #1229011)
|
|
Shawn Iwinski |
f02e511 |
|
|
|
b32db55 |
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-2
|
|
|
b32db55 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
|
|
b32db55 |
|
|
Shawn Iwinski |
2394a88 |
* Fri May 22 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.1.1-1
|
|
Shawn Iwinski |
2394a88 |
- Initial package
|