]> git.pld-linux.org Git - packages/php-monolog.git/blob - php-monolog.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/php-monolog.git] / php-monolog.spec
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 Summary:        Sends your logs to files, sockets, inboxes, databases and various web services
12 Name:           php-%{pkgname}
13 Version:        1.22.0
14 Release:        1
15 License:        MIT
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
22 %if %{with tests}
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
40 %endif
41 Requires:       php(core) >= %{php_min_version}
42 Requires:       php-psr-Log < %{psrlog_max_ver}
43 Requires:       php-psr-Log >= %{psrlog_min_ver}
44 Suggests:       php(curl)
45 Suggests:       php(date)
46 Suggests:       php(filter)
47 Suggests:       php(hash)
48 Suggests:       php(json)
49 Suggests:       php(mbstring)
50 Suggests:       php(openssl)
51 Suggests:       php(pcre)
52 Suggests:       php(sockets)
53 Suggests:       php(spl)
54 Suggests:       php(xml)
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 # disable pear auto deps
59 %define         _noautoreq_pear .*
60
61 %description
62 Monolog sends your logs to files, sockets, inboxes, databases and
63 various web services. Special handlers allow you to build advanced
64 logging strategies.
65
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.
70
71 %prep
72 %setup -qn %{pkgname}-%{version}
73
74 %build
75 %if %{with tests}
76 : Create tests bootstrap
77 cat <<'BOOTSTRAP' | tee bootstrap.php
78 BOOTSTRAP
79
80 : Remove MongoDBHandlerTest because it requires a running MongoDB server
81 rm tests/Monolog/Handler/MongoDBHandlerTest.php
82
83 : Remove GitProcessorTest because it requires a git repo
84 rm tests/Monolog/Processor/GitProcessorTest.php
85
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
90
91 phpunit --verbose --bootstrap bootstrap.php
92 %endif
93
94 %install
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}
98
99 %files
100 %defattr(644,root,root,755)
101 %doc *.mdown doc LICENSE
102 %{php_data_dir}/Monolog
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
This page took 0.089223 seconds and 4 git commands to generate.