3 %bcond_with tests # build without tests
5 %define pkgname phpmailer
6 %define php_min_version 5.2.4
7 %include /usr/lib/rpm/macros.php
8 Summary: Full featured email transfer class for PHP
9 Summary(pl.UTF-8): W pełni funkcjonalna klasa PHP do przesyłania e-maili
14 Group: Development/Languages/PHP
15 Source0: https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz
16 # Source0-md5: 68e05bbdd4196920ba6342cc63628ca2
17 URL: https://github.com/PHPMailer/PHPMailer
18 BuildRequires: php-devel
19 BuildRequires: php-pear-PhpDocumentor
20 BuildRequires: rpm-php-pearprov >= 4.4.2-11
21 BuildRequires: rpmbuild(macros) >= 1.663
23 BuildRequires: %{php_name}-cli
24 BuildRequires: %{php_name}-mbstring
25 BuildRequires: phpunit
28 Requires: php(core) >= %{php_min_version}
32 Suggests: php(mbstring)
33 Suggests: php(openssl)
35 # Gmail XOAUTH2 authentication
36 #Suggests: php-league-oauth2-client
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define _appdir %{php_data_dir}/%{pkgname}
41 %define _phpdocdir %{_docdir}/phpdoc
43 # exclude optional php dependencies
44 %define _noautophp php-openssl php-mbstring php-filter php-hash
47 %define _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php extras/.*
49 # put it together for rpmbuild
50 %define _noautoreq %{?_noautophp}
53 PHP email transport class featuring multiple file attachments, SMTP
54 servers, CCs, BCCs, HTML messages, and word wrap, and more. It can
55 send email via sendmail, PHP mail(), or with SMTP. Methods are based
56 on the popular AspEmail active server component.
58 %description -l pl.UTF-8
59 Klasa PHP do przesyłania e-mail obsługująca wiele załączników
60 plikowych, serwery SMTP, CC, BCC, wiadomości HTML, zawijanie linii
61 itp. Potrafi wysyłać pocztę przez sendmaila, funkcją PHP mail() albo
62 poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail.
65 Summary: Online manual for %{name}
66 Summary(pl.UTF-8): Dokumentacja online do %{name}
71 Documentation for %{name}.
73 %description phpdoc -l pl.UTF-8
74 Dokumentacja do %{name}.
77 %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}}
81 for f in $(find -name '*.php' -o -name '*.inc'); do
83 %if "%{php_major_version}.%{php_minor_version}" < "5.4"
84 case $(basename $f) in
85 class.phpmaileroauthgoogle.php|get_oauth_token.php)
92 %if "%{php_major_version}.%{php_minor_version}" < "5.3"
93 case $(basename $f) in
94 bootstrap.php|phpmailerTest.php)
106 %{__php} $(which phpunit) .
111 phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \
112 --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode
114 # copy images, phpdoc is likely buggy not doing itself
115 sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images
116 install -d phpdoc/media/images
117 cp -p $sdir/Constant.png phpdoc/media/images
118 cp -p $sdir/Variable.png phpdoc/media/images
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language}
124 ln -s %{_appdir}/class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir}
125 ln -s %{_appdir}/PHPMailerAutoload.php $RPM_BUILD_ROOT%{php_data_dir}
127 cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir}
128 # language: translations of error messages
129 cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language
131 # extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php
132 cp -a extras $RPM_BUILD_ROOT%{_appdir}
135 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
139 install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
140 cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
143 rm -rf $RPM_BUILD_ROOT
146 %defattr(644,root,root,755)
147 %doc README.md changelog.md docs/*
149 %{php_data_dir}/PHPMailerAutoload.php
150 %{php_data_dir}/class.phpmailer.php
153 %{_appdir}/PHPMailerAutoload.php
154 %{_appdir}/class.phpmailer.php
155 %{_appdir}/class.phpmaileroauth.php
156 %{_appdir}/class.phpmaileroauthgoogle.php
157 %{_appdir}/class.pop3.php
158 %{_appdir}/class.smtp.php
159 %dir %{_appdir}/language
160 %lang(am) %{_appdir}/language/phpmailer.lang-am.php
161 %lang(ar) %{_appdir}/language/phpmailer.lang-ar.php
162 %lang(az) %{_appdir}/language/phpmailer.lang-az.php
163 %lang(be) %{_appdir}/language/phpmailer.lang-be.php
164 %lang(bg) %{_appdir}/language/phpmailer.lang-bg.php
165 %lang(ca) %{_appdir}/language/phpmailer.lang-ca.php
166 %lang(ch) %{_appdir}/language/phpmailer.lang-ch.php
167 %lang(cs) %{_appdir}/language/phpmailer.lang-cz.php
168 %lang(da) %{_appdir}/language/phpmailer.lang-dk.php
169 %lang(de) %{_appdir}/language/phpmailer.lang-de.php
170 %lang(el) %{_appdir}/language/phpmailer.lang-el.php
171 %lang(eo) %{_appdir}/language/phpmailer.lang-eo.php
172 %lang(es) %{_appdir}/language/phpmailer.lang-es.php
173 %lang(et) %{_appdir}/language/phpmailer.lang-et.php
174 %lang(fa) %{_appdir}/language/phpmailer.lang-fa.php
175 %lang(fi) %{_appdir}/language/phpmailer.lang-fi.php
176 %lang(fo) %{_appdir}/language/phpmailer.lang-fo.php
177 %lang(fr) %{_appdir}/language/phpmailer.lang-fr.php
178 %lang(gl) %{_appdir}/language/phpmailer.lang-gl.php
179 %lang(he) %{_appdir}/language/phpmailer.lang-he.php
180 %lang(hr) %{_appdir}/language/phpmailer.lang-hr.php
181 %lang(hu) %{_appdir}/language/phpmailer.lang-hu.php
182 %lang(id) %{_appdir}/language/phpmailer.lang-id.php
183 %lang(it) %{_appdir}/language/phpmailer.lang-it.php
184 %lang(ja) %{_appdir}/language/phpmailer.lang-ja.php
185 %lang(ka) %{_appdir}/language/phpmailer.lang-ka.php
186 %lang(ko) %{_appdir}/language/phpmailer.lang-ko.php
187 %lang(lt) %{_appdir}/language/phpmailer.lang-lt.php
188 %lang(lv) %{_appdir}/language/phpmailer.lang-lv.php
189 %lang(ms) %{_appdir}/language/phpmailer.lang-ms.php
190 %lang(nb) %{_appdir}/language/phpmailer.lang-no.php
191 %lang(nl) %{_appdir}/language/phpmailer.lang-nl.php
192 %lang(pl) %{_appdir}/language/phpmailer.lang-pl.php
193 %lang(pt) %{_appdir}/language/phpmailer.lang-pt.php
194 %lang(pt_BR) %{_appdir}/language/phpmailer.lang-br.php
195 %lang(ro) %{_appdir}/language/phpmailer.lang-ro.php
196 %lang(ru) %{_appdir}/language/phpmailer.lang-ru.php
197 %lang(sk) %{_appdir}/language/phpmailer.lang-sk.php
198 %lang(sl) %{_appdir}/language/phpmailer.lang-sl.php
199 %lang(sr) %{_appdir}/language/phpmailer.lang-sr.php
200 %lang(sv) %{_appdir}/language/phpmailer.lang-se.php
201 %lang(tr) %{_appdir}/language/phpmailer.lang-tr.php
202 %lang(uk) %{_appdir}/language/phpmailer.lang-uk.php
203 %lang(vi) %{_appdir}/language/phpmailer.lang-vi.php
204 %lang(zh) %{_appdir}/language/phpmailer.lang-zh.php
205 %lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php
207 %dir %{_appdir}/extras
208 %{_appdir}/extras/README.md
209 %{_appdir}/extras/EasyPeasyICS.php
210 %{_appdir}/extras/htmlfilter.php
211 %{_appdir}/extras/ntlm_sasl_client.php
213 %{_examplesdir}/%{name}-%{version}
216 %defattr(644,root,root,755)
217 %{_phpdocdir}/%{pkgname}