]>
Commit | Line | Data |
---|---|---|
9f6cd1fd ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
7605f8f0 | 5 | %define pkgname phpmailer |
2765a7e5 | 6 | %define php_min_version 5.2.4 |
a991a9b9 | 7 | %include /usr/lib/rpm/macros.php |
46bf6096 | 8 | Summary: Full featured email transfer class for PHP |
423f17e4 | 9 | Summary(pl.UTF-8): W pełni funkcjonalna klasa PHP do przesyłania e-maili |
7605f8f0 | 10 | Name: php-%{pkgname} |
d3732919 | 11 | Version: 5.2.12 |
12c10122 | 12 | Release: 1 |
6a698734 | 13 | License: LGPL v2.1 |
46bf6096 | 14 | Group: Development/Languages/PHP |
1e429e6f | 15 | Source0: https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz |
d3732919 | 16 | # Source0-md5: 5c2d02e6fc4a61c9ba8b20810b564b1c |
2765a7e5 ER |
17 | URL: https://github.com/PHPMailer/PHPMailer |
18 | BuildRequires: php-pear-PhpDocumentor | |
a991a9b9 | 19 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
2765a7e5 | 20 | BuildRequires: rpmbuild(macros) >= 1.663 |
9f6cd1fd ER |
21 | %if %{with tests} |
22 | BuildRequires: %{php_name}-cli | |
23 | BuildRequires: %{php_name}-mbstring | |
24 | BuildRequires: phpunit | |
25 | BuildRequires: which | |
26 | %endif | |
ac451b44 | 27 | Requires: php(core) >= %{php_min_version} |
d92be810 | 28 | Requires: php(date) |
27af8029 | 29 | Requires: php(pcre) |
2765a7e5 | 30 | Suggests: php(hash) |
d92be810 ER |
31 | Suggests: php(mbstring) |
32 | Suggests: php(openssl) | |
19f5ccc5 | 33 | Obsoletes: phpmailer |
d3732919 ER |
34 | # Gmail XOAUTH2 authentication |
35 | #Suggests: php-league-oauth2-client | |
46bf6096 ER |
36 | BuildArch: noarch |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
7605f8f0 ER |
39 | %define _appdir %{php_data_dir}/%{pkgname} |
40 | %define _phpdocdir %{_docdir}/phpdoc | |
46bf6096 | 41 | |
6a698734 | 42 | # exclude optional php dependencies |
2765a7e5 | 43 | %define _noautophp php-openssl php-mbstring php-filter php-hash |
6a698734 | 44 | |
b15df9b0 | 45 | # bad depsolver |
d3732919 | 46 | %define _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php |
b15df9b0 | 47 | |
6a698734 | 48 | # put it together for rpmbuild |
84952f85 | 49 | %define _noautoreq %{?_noautophp} |
a991a9b9 | 50 | |
46bf6096 ER |
51 | %description |
52 | PHP email transport class featuring multiple file attachments, SMTP | |
53 | servers, CCs, BCCs, HTML messages, and word wrap, and more. It can | |
54 | send email via sendmail, PHP mail(), or with SMTP. Methods are based | |
55 | on the popular AspEmail active server component. | |
56 | ||
423f17e4 JB |
57 | %description -l pl.UTF-8 |
58 | Klasa PHP do przesyłania e-mail obsługująca wiele załączników | |
59 | plikowych, serwery SMTP, CC, BCC, wiadomości HTML, zawijanie linii | |
60 | itp. Potrafi wysyłać pocztę przez sendmaila, funkcją PHP mail() albo | |
61 | poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail. | |
62 | ||
7605f8f0 ER |
63 | %package phpdoc |
64 | Summary: Online manual for %{name} | |
65 | Summary(pl.UTF-8): Dokumentacja online do %{name} | |
66 | Group: Documentation | |
67 | Requires: php-dirs | |
68 | ||
69 | %description phpdoc | |
70 | Documentation for %{name}. | |
71 | ||
72 | %description phpdoc -l pl.UTF-8 | |
73 | Dokumentacja do %{name}. | |
74 | ||
46bf6096 | 75 | %prep |
2765a7e5 | 76 | %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}} |
46bf6096 | 77 | |
ebab167b | 78 | %build |
bcf627f4 | 79 | # syntax lint |
253bd29f ER |
80 | for f in $(find -name '*.php' -o -name '*.inc'); do |
81 | ||
82 | %if "%{php_major_version}.%{php_minor_version}" < "5.4" | |
83 | case $(basename $f) in | |
84 | class.oauth.php|get_oauth_token.php) | |
85 | # needs php 5.4 | |
86 | continue | |
87 | ;; | |
88 | esac | |
89 | %endif | |
90 | ||
91 | %if "%{php_major_version}.%{php_minor_version}" < "5.3" | |
92 | case $(basename $f) in | |
93 | bootstrap.php|phpmailerTest.php) | |
94 | # needs php 5.3 | |
95 | continue | |
96 | ;; | |
97 | esac | |
98 | %endif | |
99 | ||
100 | %{__php} -n -l $f | |
bcf627f4 ER |
101 | done |
102 | ||
9f6cd1fd ER |
103 | %if %{with tests} |
104 | cd test | |
105 | %{__php} $(which phpunit) . | |
106 | cd - | |
107 | %endif | |
108 | ||
7fc5b62b ER |
109 | rm -rf phpdoc |
110 | phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \ | |
111 | --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode | |
ebab167b ER |
112 | |
113 | # copy images, phpdoc is likely buggy not doing itself | |
114 | sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images | |
115 | install -d phpdoc/media/images | |
7fc5b62b ER |
116 | cp -p $sdir/Constant.png phpdoc/media/images |
117 | cp -p $sdir/Variable.png phpdoc/media/images | |
7605f8f0 | 118 | |
46bf6096 ER |
119 | %install |
120 | rm -rf $RPM_BUILD_ROOT | |
f960917e | 121 | install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language} |
fd66e3cc | 122 | |
f960917e ER |
123 | ln -s %{_appdir}/class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir} |
124 | ln -s %{_appdir}/PHPMailerAutoload.php $RPM_BUILD_ROOT%{php_data_dir} | |
125 | ||
d3732919 | 126 | cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir} |
19f5ccc5 | 127 | # language: translations of error messages |
11151c00 | 128 | cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language |
19f5ccc5 | 129 | |
d3732919 | 130 | # extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php |
26058974 ER |
131 | cp -a extras $RPM_BUILD_ROOT%{_appdir} |
132 | ||
19f5ccc5 | 133 | # examples |
13bc6b87 ER |
134 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
135 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
46bf6096 | 136 | |
7605f8f0 ER |
137 | # api doc |
138 | install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname} | |
139 | cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname} | |
140 | ||
46bf6096 ER |
141 | %clean |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
144 | %files | |
145 | %defattr(644,root,root,755) | |
2765a7e5 | 146 | %doc README.md changelog.md docs/* |
f960917e | 147 | # public interfaces |
f960917e | 148 | %{php_data_dir}/PHPMailerAutoload.php |
2e2daa29 | 149 | %{php_data_dir}/class.phpmailer.php |
19f5ccc5 | 150 | |
13bc6b87 | 151 | %dir %{_appdir} |
2e2daa29 | 152 | %{_appdir}/PHPMailerAutoload.php |
d3732919 | 153 | %{_appdir}/class.oauth.php |
f960917e | 154 | %{_appdir}/class.phpmailer.php |
d3732919 | 155 | %{_appdir}/class.phpmaileroauth.php |
13bc6b87 ER |
156 | %{_appdir}/class.pop3.php |
157 | %{_appdir}/class.smtp.php | |
13bc6b87 | 158 | %dir %{_appdir}/language |
d3732919 | 159 | %lang(am) %{_appdir}/language/phpmailer.lang-am.php |
19f5ccc5 | 160 | %lang(ar) %{_appdir}/language/phpmailer.lang-ar.php |
d3732919 | 161 | %lang(az) %{_appdir}/language/phpmailer.lang-az.php |
c5893738 | 162 | %lang(be) %{_appdir}/language/phpmailer.lang-be.php |
d3732919 | 163 | %lang(bg) %{_appdir}/language/phpmailer.lang-bg.php |
13bc6b87 | 164 | %lang(ca) %{_appdir}/language/phpmailer.lang-ca.php |
6a698734 | 165 | %lang(ch) %{_appdir}/language/phpmailer.lang-ch.php |
f4cd874b | 166 | %lang(cs) %{_appdir}/language/phpmailer.lang-cz.php |
f4cd874b | 167 | %lang(da) %{_appdir}/language/phpmailer.lang-dk.php |
19f5ccc5 | 168 | %lang(de) %{_appdir}/language/phpmailer.lang-de.php |
c5893738 | 169 | %lang(el) %{_appdir}/language/phpmailer.lang-el.php |
2765a7e5 | 170 | %lang(eo) %{_appdir}/language/phpmailer.lang-eo.php |
13bc6b87 ER |
171 | %lang(es) %{_appdir}/language/phpmailer.lang-es.php |
172 | %lang(et) %{_appdir}/language/phpmailer.lang-et.php | |
1e429e6f | 173 | %lang(fa) %{_appdir}/language/phpmailer.lang-fa.php |
13bc6b87 ER |
174 | %lang(fi) %{_appdir}/language/phpmailer.lang-fi.php |
175 | %lang(fo) %{_appdir}/language/phpmailer.lang-fo.php | |
176 | %lang(fr) %{_appdir}/language/phpmailer.lang-fr.php | |
c5893738 | 177 | %lang(gl) %{_appdir}/language/phpmailer.lang-gl.php |
2765a7e5 | 178 | %lang(he) %{_appdir}/language/phpmailer.lang-he.php |
c5893738 | 179 | %lang(hr) %{_appdir}/language/phpmailer.lang-hr.php |
13bc6b87 | 180 | %lang(hu) %{_appdir}/language/phpmailer.lang-hu.php |
d3732919 | 181 | %lang(id) %{_appdir}/language/phpmailer.lang-id.php |
13bc6b87 ER |
182 | %lang(it) %{_appdir}/language/phpmailer.lang-it.php |
183 | %lang(ja) %{_appdir}/language/phpmailer.lang-ja.php | |
c5893738 | 184 | %lang(ka) %{_appdir}/language/phpmailer.lang-ka.php |
d3732919 | 185 | %lang(ko) %{_appdir}/language/phpmailer.lang-ko.php |
1e429e6f | 186 | %lang(lt) %{_appdir}/language/phpmailer.lang-lt.php |
c5893738 | 187 | %lang(lv) %{_appdir}/language/phpmailer.lang-lv.php |
d3732919 | 188 | %lang(ms) %{_appdir}/language/phpmailer.lang-ms.php |
f6089298 | 189 | %lang(nb) %{_appdir}/language/phpmailer.lang-no.php |
19f5ccc5 | 190 | %lang(nl) %{_appdir}/language/phpmailer.lang-nl.php |
13bc6b87 | 191 | %lang(pl) %{_appdir}/language/phpmailer.lang-pl.php |
c5893738 | 192 | %lang(pt) %{_appdir}/language/phpmailer.lang-pt.php |
19f5ccc5 | 193 | %lang(pt_BR) %{_appdir}/language/phpmailer.lang-br.php |
13bc6b87 ER |
194 | %lang(ro) %{_appdir}/language/phpmailer.lang-ro.php |
195 | %lang(ru) %{_appdir}/language/phpmailer.lang-ru.php | |
b904c15d | 196 | %lang(sk) %{_appdir}/language/phpmailer.lang-sk.php |
d3732919 | 197 | %lang(sl) %{_appdir}/language/phpmailer.lang-sl.php |
c5893738 | 198 | %lang(sr) %{_appdir}/language/phpmailer.lang-sr.php |
f4cd874b | 199 | %lang(sv) %{_appdir}/language/phpmailer.lang-se.php |
13bc6b87 | 200 | %lang(tr) %{_appdir}/language/phpmailer.lang-tr.php |
1e429e6f | 201 | %lang(uk) %{_appdir}/language/phpmailer.lang-uk.php |
c5893738 | 202 | %lang(vi) %{_appdir}/language/phpmailer.lang-vi.php |
6a698734 ER |
203 | %lang(zh) %{_appdir}/language/phpmailer.lang-zh.php |
204 | %lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php | |
13bc6b87 | 205 | |
26058974 | 206 | %dir %{_appdir}/extras |
1c7e4594 | 207 | %{_appdir}/extras/README.md |
1e429e6f | 208 | %{_appdir}/extras/EasyPeasyICS.php |
26058974 | 209 | %{_appdir}/extras/htmlfilter.php |
b15df9b0 | 210 | %{_appdir}/extras/ntlm_sasl_client.php |
26058974 | 211 | |
13bc6b87 | 212 | %{_examplesdir}/%{name}-%{version} |
7605f8f0 ER |
213 | |
214 | %files phpdoc | |
215 | %defattr(644,root,root,755) | |
216 | %{_phpdocdir}/%{pkgname} |