File php-sabre-event.spec of Package php-sabre-event (Revision 76d7b1b5b0da80883b7c280481b9ee65)

Currently displaying revision 76d7b1b5b0da80883b7c280481b9ee65 , Show latest

103
 
1
# Spec file for php-sabre-event
2
#
3
# Copyright (c) 2013-2014 Remi Collet
4
# License: CC-BY-SA
5
# http://creativecommons.org/licenses/by-sa/3.0/
6
#
7
# Please, preserve the changelog entries
8
#
9
%global gh_commit    5ee3adf5441c2fe53b8ceacff6db81e621ee884c
10
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
11
%global gh_owner     fruux
12
%global gh_project   sabre-event
13
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}
14
15
Name:           php-%{gh_project}
16
Summary:        Lightweight library for event-based programming
17
Version:        1.0.1
18
Release:        1%{?dist}
19
20
URL:            http://sabre.io/event
21
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
22
License:        BSD
23
Group:          Development/Libraries
24
25
BuildArch:      noarch
26
%if %{with_tests}
27
%if 0%{?suse_version}
28
BuildRequires:  php5 >= 5.4.1
29
%else
30
BuildRequires:  php(language) >= 5.4.1
31
%endif
32
BuildRequires:  php-phpunit-PHPUnit
33
%endif
34
35
# From composer.json
36
%if 0%{?suse_version}
37
Requires:       php5 >= 5.4.1
38
%else
39
Requires:       php(language) >= 5.4.1
40
%endif
41
# From phpcompatinfo report: nothing else
42
43
Provides:       php-composer(sabre/event) = %{version}
44
45
46
%description
47
A lightweight library for event management in PHP.
48
It's design is inspired by Node.js's EventEmitter. sabre/event requires PHP 5.4.
49
50
51
%prep
52
%setup -q -n %{gh_project}-%{gh_commit}
53
54
: Create trivial PSR0 autoloader
55
cat <<EOF | tee psr0.php
56
<?php
57
spl_autoload_register(function (\$class) {
58
    \$file = str_replace('\\\\', '/', \$class).'.php';
59
    @include \$file;
60
});
61
EOF
62
63
64
%build
65
# nothing to build
66
67
68
%install
69
# Install as a PSR-0 library
70
mkdir -p %{buildroot}%{_datadir}/php
71
cp -pr lib/Sabre %{buildroot}%{_datadir}/php/Sabre
72
73
74
%check
75
%if %{with_tests}
76
: Run upstream test suite against installed library
77
cd tests
78
phpunit \
79
  --bootstrap=../psr0.php \
80
  --include-path=%{buildroot}%{_datadir}/php \
81
  -d date.timezone=UTC
82
%else
83
: Skip upstream test suite
84
%endif
85
86
87
%files
88
%doc ChangeLog composer.json LICENSE README.md
89
%{_datadir}/php/Sabre
90
91
92
%changelog
93
* Fri Jun 13 2014 Remi Collet <remi@fedoraproject.org> - 1.0.1-1
94
- update to 1.0.1
95
- add provides php-composer(sabre/event)
96
- change url to http://sabre.io/event
97
98
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
99
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
100
101
* Tue Dec 31 2013 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
102
- Initial packaging
103