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