3 %bcond_with tests # build without tests
6 %define psrlog_min_ver 1.0
7 %define psrlog_max_ver 2.0
9 %define pkgname monolog
10 %define php_min_version 5.3.0
11 %include /usr/lib/rpm/macros.php
12 Summary: Sends your logs to files, sockets, inboxes, databases and various web services
17 Group: Development/Languages/PHP
18 Source0: https://github.com/Seldaek/monolog/archive/%{version}/%{pkgname}-%{version}.tar.gz
19 # Source0-md5: 05c338cde7a1525d2093e6df5b3bbe21
20 URL: https://github.com/Seldaek/monolog
21 BuildRequires: rpm-php-pearprov >= 4.4.2-11
22 BuildRequires: rpmbuild(macros) >= 1.654
24 BuildRequires: php(core) >= %{php_min_version}
25 BuildRequires: php(curl)
26 BuildRequires: php(date)
27 BuildRequires: php(filter)
28 BuildRequires: php(hash)
29 BuildRequires: php(json)
30 BuildRequires: php(mbstring)
31 BuildRequires: php(openssl)
32 BuildRequires: php(pcre)
33 BuildRequires: php(reflection)
34 BuildRequires: php(sockets)
35 BuildRequires: php(spl)
36 BuildRequires: php(xml)
37 BuildRequires: php-psr-Log < %{psrlog_max_ver}
38 BuildRequires: php-psr-Log >= %{psrlog_min_ver}
39 BuildRequires: php-symfony2-ClassLoader
40 BuildRequires: phpunit
42 Requires: php(core) >= %{php_min_version}
43 Requires: php-psr-Log < %{psrlog_max_ver}
44 Requires: php-psr-Log >= %{psrlog_min_ver}
50 Suggests: php(mbstring)
51 Suggests: php(openssl)
53 Suggests: php(sockets)
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 # disable pear auto deps
60 %define _noautoreq_pear .*
63 Monolog sends your logs to files, sockets, inboxes, databases and
64 various web services. Special handlers allow you to build advanced
67 This library implements the PSR-3 interface that you can type-hint
68 against in your own libraries to keep a maximum of interoperability.
69 You can also use it in your applications to make sure you can always
70 use another compatible logger at a later time.
73 %setup -qn %{pkgname}-%{version}
77 : Create tests bootstrap
78 cat <<'BOOTSTRAP' | tee bootstrap.php
81 : Remove MongoDBHandlerTest because it requires a running MongoDB server
82 rm tests/Monolog/Handler/MongoDBHandlerTest.php
84 : Remove GitProcessorTest because it requires a git repo
85 rm tests/Monolog/Processor/GitProcessorTest.php
87 : Skip tests known to fail
88 rm -f tests/Monolog/Handler/SwiftMailerHandlerTest.php
89 sed 's/function testThrowsOnInvalidEncoding/function SKIP_testThrowsOnInvalidEncoding/' \
90 -i tests/Monolog/Formatter/NormalizerFormatterTest.php
92 phpunit --verbose --bootstrap bootstrap.php
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT%{php_data_dir}
98 cp -a src/* $RPM_BUILD_ROOT%{php_data_dir}
101 %defattr(644,root,root,755)
102 %doc *.mdown doc LICENSE
103 %{php_data_dir}/Monolog
106 rm -rf $RPM_BUILD_ROOT