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: fcdef7bd93fdf3a42d57e41e525d32e0
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}
33 Suggests: php(mbstring)
34 Suggests: php(openssl)
36 # Gmail XOAUTH2 authentication
37 #Suggests: php-league-oauth2-client
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define _appdir %{php_data_dir}/%{pkgname}
42 %define _phpdocdir %{_docdir}/phpdoc
44 # exclude optional php dependencies
45 %define _noautophp php-openssl php-mbstring php-filter php-hash
48 %define _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php extras/.*
50 # put it together for rpmbuild
51 %define _noautoreq %{?_noautophp}
54 PHP email transport class featuring multiple file attachments, SMTP
55 servers, CCs, BCCs, HTML messages, and word wrap, and more. It can
56 send email via sendmail, PHP mail(), or with SMTP. Methods are based
57 on the popular AspEmail active server component.
59 %description -l pl.UTF-8
60 Klasa PHP do przesyłania e-mail obsługująca wiele załączników
61 plikowych, serwery SMTP, CC, BCC, wiadomości HTML, zawijanie linii
62 itp. Potrafi wysyłać pocztę przez sendmaila, funkcją PHP mail() albo
63 poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail.
66 Summary: Online manual for %{name}
67 Summary(pl.UTF-8): Dokumentacja online do %{name}
72 Documentation for %{name}.
74 %description phpdoc -l pl.UTF-8
75 Dokumentacja do %{name}.
78 %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}}
82 for f in $(find -name '*.php' -o -name '*.inc'); do
84 %if "%{php_major_version}.%{php_minor_version}" < "5.4"
85 case $(basename $f) in
86 class.phpmaileroauthgoogle.php|get_oauth_token.php)
93 %if "%{php_major_version}.%{php_minor_version}" < "5.3"
94 case $(basename $f) in
95 bootstrap.php|phpmailerTest.php)
107 %{__php} $(which phpunit) .
112 phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \
113 --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode
115 # copy images, phpdoc is likely buggy not doing itself
116 sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images
117 install -d phpdoc/media/images
118 cp -p $sdir/Constant.png phpdoc/media/images
119 cp -p $sdir/Variable.png phpdoc/media/images
122 rm -rf $RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language}
125 ln -s %{_appdir}/class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir}
126 ln -s %{_appdir}/PHPMailerAutoload.php $RPM_BUILD_ROOT%{php_data_dir}
128 cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir}
129 # language: translations of error messages
130 cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language
132 # extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php
133 cp -a extras $RPM_BUILD_ROOT%{_appdir}
136 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
137 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
140 install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
141 cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
144 rm -rf $RPM_BUILD_ROOT
147 %defattr(644,root,root,755)
148 #%doc README.md changelog.md docs/*
150 %{php_data_dir}/PHPMailerAutoload.php
151 %{php_data_dir}/class.phpmailer.php
154 %{_appdir}/PHPMailerAutoload.php
155 %{_appdir}/class.phpmailer.php
156 %{_appdir}/class.phpmaileroauth.php
157 %{_appdir}/class.phpmaileroauthgoogle.php
158 %{_appdir}/class.pop3.php
159 %{_appdir}/class.smtp.php
160 %dir %{_appdir}/language
161 %lang(am) %{_appdir}/language/phpmailer.lang-am.php
162 %lang(ar) %{_appdir}/language/phpmailer.lang-ar.php
163 %lang(az) %{_appdir}/language/phpmailer.lang-az.php
164 %lang(ba) %{_appdir}/language/phpmailer.lang-ba.php
165 %lang(be) %{_appdir}/language/phpmailer.lang-be.php
166 %lang(bg) %{_appdir}/language/phpmailer.lang-bg.php
167 %lang(ca) %{_appdir}/language/phpmailer.lang-ca.php
168 %lang(ch) %{_appdir}/language/phpmailer.lang-ch.php
169 %lang(cs) %{_appdir}/language/phpmailer.lang-cs.php
170 %lang(da) %{_appdir}/language/phpmailer.lang-da.php
171 %lang(de) %{_appdir}/language/phpmailer.lang-de.php
172 %lang(el) %{_appdir}/language/phpmailer.lang-el.php
173 %lang(eo) %{_appdir}/language/phpmailer.lang-eo.php
174 %lang(es) %{_appdir}/language/phpmailer.lang-es.php
175 %lang(et) %{_appdir}/language/phpmailer.lang-et.php
176 %lang(fa) %{_appdir}/language/phpmailer.lang-fa.php
177 %lang(fi) %{_appdir}/language/phpmailer.lang-fi.php
178 %lang(fo) %{_appdir}/language/phpmailer.lang-fo.php
179 %lang(fr) %{_appdir}/language/phpmailer.lang-fr.php
180 %lang(gl) %{_appdir}/language/phpmailer.lang-gl.php
181 %lang(he) %{_appdir}/language/phpmailer.lang-he.php
182 %lang(hr) %{_appdir}/language/phpmailer.lang-hr.php
183 %lang(hu) %{_appdir}/language/phpmailer.lang-hu.php
184 %lang(id) %{_appdir}/language/phpmailer.lang-id.php
185 %lang(it) %{_appdir}/language/phpmailer.lang-it.php
186 %lang(ja) %{_appdir}/language/phpmailer.lang-ja.php
187 %lang(ka) %{_appdir}/language/phpmailer.lang-ka.php
188 %lang(ko) %{_appdir}/language/phpmailer.lang-ko.php
189 %lang(lt) %{_appdir}/language/phpmailer.lang-lt.php
190 %lang(lv) %{_appdir}/language/phpmailer.lang-lv.php
191 %lang(ms) %{_appdir}/language/phpmailer.lang-ms.php
192 %lang(nb) %{_appdir}/language/phpmailer.lang-nb.php
193 %lang(nl) %{_appdir}/language/phpmailer.lang-nl.php
194 %lang(pl) %{_appdir}/language/phpmailer.lang-pl.php
195 %lang(pt) %{_appdir}/language/phpmailer.lang-pt.php
196 %lang(pt_BR) %{_appdir}/language/phpmailer.lang-pt_br.php
197 %lang(ro) %{_appdir}/language/phpmailer.lang-ro.php
198 %lang(rs) %{_appdir}/language/phpmailer.lang-rs.php
199 %lang(ru) %{_appdir}/language/phpmailer.lang-ru.php
200 %lang(sk) %{_appdir}/language/phpmailer.lang-sk.php
201 %lang(sl) %{_appdir}/language/phpmailer.lang-sl.php
202 %lang(sv) %{_appdir}/language/phpmailer.lang-sv.php
203 %lang(tr) %{_appdir}/language/phpmailer.lang-tr.php
204 %lang(uk) %{_appdir}/language/phpmailer.lang-uk.php
205 %lang(vi) %{_appdir}/language/phpmailer.lang-vi.php
206 %lang(zh) %{_appdir}/language/phpmailer.lang-zh.php
207 %lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php
209 %dir %{_appdir}/extras
210 %{_appdir}/extras/README.md
211 %{_appdir}/extras/EasyPeasyICS.php
212 %{_appdir}/extras/htmlfilter.php
213 %{_appdir}/extras/ntlm_sasl_client.php
215 %{_examplesdir}/%{name}-%{version}
218 %defattr(644,root,root,755)
219 %{_phpdocdir}/%{pkgname}