]>
Commit | Line | Data |
---|---|---|
711d9c4b ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
5 | # "psr/log": "~1.0" | |
6 | %define psrlog_min_ver 1.0 | |
7 | %define psrlog_max_ver 2.0 | |
8 | ||
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 | |
13 | Name: php-%{pkgname} | |
0a86fafb | 14 | Version: 1.19.0 |
711d9c4b ER |
15 | Release: 1 |
16 | License: MIT | |
17 | Group: Development/Languages/PHP | |
18 | Source0: https://github.com/Seldaek/monolog/archive/%{version}/%{pkgname}-%{version}.tar.gz | |
0a86fafb | 19 | # Source0-md5: 05c338cde7a1525d2093e6df5b3bbe21 |
711d9c4b | 20 | URL: https://github.com/Seldaek/monolog |
0994a1fa | 21 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
711d9c4b ER |
22 | BuildRequires: rpmbuild(macros) >= 1.654 |
23 | %if %{with tests} | |
711d9c4b | 24 | BuildRequires: php(core) >= %{php_min_version} |
711d9c4b ER |
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) | |
0994a1fa ER |
37 | BuildRequires: php-psr-Log < %{psrlog_max_ver} |
38 | BuildRequires: php-psr-Log >= %{psrlog_min_ver} | |
711d9c4b | 39 | BuildRequires: php-symfony2-ClassLoader |
0994a1fa | 40 | BuildRequires: phpunit |
711d9c4b | 41 | %endif |
711d9c4b ER |
42 | Requires: php(core) >= %{php_min_version} |
43 | Requires: php-psr-Log < %{psrlog_max_ver} | |
44 | Requires: php-psr-Log >= %{psrlog_min_ver} | |
0994a1fa ER |
45 | Suggests: php(curl) |
46 | Suggests: php(date) | |
47 | Suggests: php(filter) | |
48 | Suggests: php(hash) | |
49 | Suggests: php(json) | |
50 | Suggests: php(mbstring) | |
51 | Suggests: php(openssl) | |
52 | Suggests: php(pcre) | |
53 | Suggests: php(sockets) | |
54 | Suggests: php(spl) | |
55 | Suggests: php(xml) | |
711d9c4b ER |
56 | BuildArch: noarch |
57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
58 | ||
59 | # disable pear auto deps | |
60 | %define _noautoreq_pear .* | |
61 | ||
62 | %description | |
63 | Monolog sends your logs to files, sockets, inboxes, databases and | |
64 | various web services. Special handlers allow you to build advanced | |
65 | logging strategies. | |
66 | ||
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. | |
71 | ||
72 | %prep | |
73 | %setup -qn %{pkgname}-%{version} | |
74 | ||
75 | %build | |
76 | %if %{with tests} | |
77 | : Create tests bootstrap | |
78 | cat <<'BOOTSTRAP' | tee bootstrap.php | |
79 | BOOTSTRAP | |
80 | ||
81 | : Remove MongoDBHandlerTest because it requires a running MongoDB server | |
82 | rm tests/Monolog/Handler/MongoDBHandlerTest.php | |
83 | ||
84 | : Remove GitProcessorTest because it requires a git repo | |
85 | rm tests/Monolog/Processor/GitProcessorTest.php | |
86 | ||
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 | |
91 | ||
92 | phpunit --verbose --bootstrap bootstrap.php | |
93 | %endif | |
94 | ||
95 | %install | |
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} | |
99 | ||
100 | %files | |
101 | %defattr(644,root,root,755) | |
102 | %doc *.mdown doc LICENSE | |
103 | %{php_data_dir}/Monolog | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT |