]>
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} |
e7bb53de | 11 | Version: 5.2.17 |
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 |
e7bb53de | 16 | # Source0-md5: 27e50d0c40577faa71819af3a166174e |
2765a7e5 | 17 | URL: https://github.com/PHPMailer/PHPMailer |
db04397e | 18 | BuildRequires: php-devel |
2765a7e5 | 19 | BuildRequires: php-pear-PhpDocumentor |
a991a9b9 | 20 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
2765a7e5 | 21 | BuildRequires: rpmbuild(macros) >= 1.663 |
9f6cd1fd ER |
22 | %if %{with tests} |
23 | BuildRequires: %{php_name}-cli | |
24 | BuildRequires: %{php_name}-mbstring | |
25 | BuildRequires: phpunit | |
26 | BuildRequires: which | |
27 | %endif | |
ac451b44 | 28 | Requires: php(core) >= %{php_min_version} |
d92be810 | 29 | Requires: php(date) |
27af8029 | 30 | Requires: php(pcre) |
2765a7e5 | 31 | Suggests: php(hash) |
d92be810 ER |
32 | Suggests: php(mbstring) |
33 | Suggests: php(openssl) | |
19f5ccc5 | 34 | Obsoletes: phpmailer |
d3732919 ER |
35 | # Gmail XOAUTH2 authentication |
36 | #Suggests: php-league-oauth2-client | |
46bf6096 ER |
37 | BuildArch: noarch |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
7605f8f0 ER |
40 | %define _appdir %{php_data_dir}/%{pkgname} |
41 | %define _phpdocdir %{_docdir}/phpdoc | |
46bf6096 | 42 | |
6a698734 | 43 | # exclude optional php dependencies |
2765a7e5 | 44 | %define _noautophp php-openssl php-mbstring php-filter php-hash |
6a698734 | 45 | |
b15df9b0 | 46 | # bad depsolver |
0893ce72 | 47 | %define _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php extras/.* |
b15df9b0 | 48 | |
6a698734 | 49 | # put it together for rpmbuild |
84952f85 | 50 | %define _noautoreq %{?_noautophp} |
a991a9b9 | 51 | |
46bf6096 ER |
52 | %description |
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. | |
57 | ||
423f17e4 JB |
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. | |
63 | ||
7605f8f0 ER |
64 | %package phpdoc |
65 | Summary: Online manual for %{name} | |
66 | Summary(pl.UTF-8): Dokumentacja online do %{name} | |
67 | Group: Documentation | |
68 | Requires: php-dirs | |
69 | ||
70 | %description phpdoc | |
71 | Documentation for %{name}. | |
72 | ||
73 | %description phpdoc -l pl.UTF-8 | |
74 | Dokumentacja do %{name}. | |
75 | ||
46bf6096 | 76 | %prep |
2765a7e5 | 77 | %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}} |
46bf6096 | 78 | |
ebab167b | 79 | %build |
bcf627f4 | 80 | # syntax lint |
253bd29f ER |
81 | for f in $(find -name '*.php' -o -name '*.inc'); do |
82 | ||
83 | %if "%{php_major_version}.%{php_minor_version}" < "5.4" | |
84 | case $(basename $f) in | |
47134f6f | 85 | class.phpmaileroauthgoogle.php|get_oauth_token.php) |
253bd29f ER |
86 | # needs php 5.4 |
87 | continue | |
88 | ;; | |
89 | esac | |
90 | %endif | |
91 | ||
92 | %if "%{php_major_version}.%{php_minor_version}" < "5.3" | |
93 | case $(basename $f) in | |
94 | bootstrap.php|phpmailerTest.php) | |
95 | # needs php 5.3 | |
96 | continue | |
97 | ;; | |
98 | esac | |
99 | %endif | |
100 | ||
101 | %{__php} -n -l $f | |
bcf627f4 ER |
102 | done |
103 | ||
9f6cd1fd ER |
104 | %if %{with tests} |
105 | cd test | |
106 | %{__php} $(which phpunit) . | |
107 | cd - | |
108 | %endif | |
109 | ||
7fc5b62b ER |
110 | rm -rf phpdoc |
111 | phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \ | |
112 | --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode | |
ebab167b ER |
113 | |
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 | |
7fc5b62b ER |
117 | cp -p $sdir/Constant.png phpdoc/media/images |
118 | cp -p $sdir/Variable.png phpdoc/media/images | |
7605f8f0 | 119 | |
46bf6096 ER |
120 | %install |
121 | rm -rf $RPM_BUILD_ROOT | |
f960917e | 122 | install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language} |
fd66e3cc | 123 | |
f960917e ER |
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} | |
126 | ||
d3732919 | 127 | cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir} |
19f5ccc5 | 128 | # language: translations of error messages |
11151c00 | 129 | cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language |
19f5ccc5 | 130 | |
d3732919 | 131 | # extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php |
26058974 ER |
132 | cp -a extras $RPM_BUILD_ROOT%{_appdir} |
133 | ||
19f5ccc5 | 134 | # examples |
13bc6b87 ER |
135 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
136 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
46bf6096 | 137 | |
7605f8f0 ER |
138 | # api doc |
139 | install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname} | |
140 | cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname} | |
141 | ||
46bf6096 ER |
142 | %clean |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | ||
145 | %files | |
146 | %defattr(644,root,root,755) | |
2765a7e5 | 147 | %doc README.md changelog.md docs/* |
f960917e | 148 | # public interfaces |
f960917e | 149 | %{php_data_dir}/PHPMailerAutoload.php |
2e2daa29 | 150 | %{php_data_dir}/class.phpmailer.php |
19f5ccc5 | 151 | |
13bc6b87 | 152 | %dir %{_appdir} |
2e2daa29 | 153 | %{_appdir}/PHPMailerAutoload.php |
f960917e | 154 | %{_appdir}/class.phpmailer.php |
d3732919 | 155 | %{_appdir}/class.phpmaileroauth.php |
47134f6f | 156 | %{_appdir}/class.phpmaileroauthgoogle.php |
13bc6b87 ER |
157 | %{_appdir}/class.pop3.php |
158 | %{_appdir}/class.smtp.php | |
13bc6b87 | 159 | %dir %{_appdir}/language |
d3732919 | 160 | %lang(am) %{_appdir}/language/phpmailer.lang-am.php |
19f5ccc5 | 161 | %lang(ar) %{_appdir}/language/phpmailer.lang-ar.php |
d3732919 | 162 | %lang(az) %{_appdir}/language/phpmailer.lang-az.php |
c5893738 | 163 | %lang(be) %{_appdir}/language/phpmailer.lang-be.php |
d3732919 | 164 | %lang(bg) %{_appdir}/language/phpmailer.lang-bg.php |
13bc6b87 | 165 | %lang(ca) %{_appdir}/language/phpmailer.lang-ca.php |
6a698734 | 166 | %lang(ch) %{_appdir}/language/phpmailer.lang-ch.php |
f4cd874b | 167 | %lang(cs) %{_appdir}/language/phpmailer.lang-cz.php |
f4cd874b | 168 | %lang(da) %{_appdir}/language/phpmailer.lang-dk.php |
19f5ccc5 | 169 | %lang(de) %{_appdir}/language/phpmailer.lang-de.php |
c5893738 | 170 | %lang(el) %{_appdir}/language/phpmailer.lang-el.php |
2765a7e5 | 171 | %lang(eo) %{_appdir}/language/phpmailer.lang-eo.php |
13bc6b87 ER |
172 | %lang(es) %{_appdir}/language/phpmailer.lang-es.php |
173 | %lang(et) %{_appdir}/language/phpmailer.lang-et.php | |
1e429e6f | 174 | %lang(fa) %{_appdir}/language/phpmailer.lang-fa.php |
13bc6b87 ER |
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 | |
c5893738 | 178 | %lang(gl) %{_appdir}/language/phpmailer.lang-gl.php |
2765a7e5 | 179 | %lang(he) %{_appdir}/language/phpmailer.lang-he.php |
c5893738 | 180 | %lang(hr) %{_appdir}/language/phpmailer.lang-hr.php |
13bc6b87 | 181 | %lang(hu) %{_appdir}/language/phpmailer.lang-hu.php |
d3732919 | 182 | %lang(id) %{_appdir}/language/phpmailer.lang-id.php |
13bc6b87 ER |
183 | %lang(it) %{_appdir}/language/phpmailer.lang-it.php |
184 | %lang(ja) %{_appdir}/language/phpmailer.lang-ja.php | |
c5893738 | 185 | %lang(ka) %{_appdir}/language/phpmailer.lang-ka.php |
d3732919 | 186 | %lang(ko) %{_appdir}/language/phpmailer.lang-ko.php |
1e429e6f | 187 | %lang(lt) %{_appdir}/language/phpmailer.lang-lt.php |
c5893738 | 188 | %lang(lv) %{_appdir}/language/phpmailer.lang-lv.php |
d3732919 | 189 | %lang(ms) %{_appdir}/language/phpmailer.lang-ms.php |
f6089298 | 190 | %lang(nb) %{_appdir}/language/phpmailer.lang-no.php |
19f5ccc5 | 191 | %lang(nl) %{_appdir}/language/phpmailer.lang-nl.php |
13bc6b87 | 192 | %lang(pl) %{_appdir}/language/phpmailer.lang-pl.php |
c5893738 | 193 | %lang(pt) %{_appdir}/language/phpmailer.lang-pt.php |
19f5ccc5 | 194 | %lang(pt_BR) %{_appdir}/language/phpmailer.lang-br.php |
13bc6b87 ER |
195 | %lang(ro) %{_appdir}/language/phpmailer.lang-ro.php |
196 | %lang(ru) %{_appdir}/language/phpmailer.lang-ru.php | |
b904c15d | 197 | %lang(sk) %{_appdir}/language/phpmailer.lang-sk.php |
d3732919 | 198 | %lang(sl) %{_appdir}/language/phpmailer.lang-sl.php |
c5893738 | 199 | %lang(sr) %{_appdir}/language/phpmailer.lang-sr.php |
f4cd874b | 200 | %lang(sv) %{_appdir}/language/phpmailer.lang-se.php |
13bc6b87 | 201 | %lang(tr) %{_appdir}/language/phpmailer.lang-tr.php |
1e429e6f | 202 | %lang(uk) %{_appdir}/language/phpmailer.lang-uk.php |
c5893738 | 203 | %lang(vi) %{_appdir}/language/phpmailer.lang-vi.php |
6a698734 ER |
204 | %lang(zh) %{_appdir}/language/phpmailer.lang-zh.php |
205 | %lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php | |
13bc6b87 | 206 | |
26058974 | 207 | %dir %{_appdir}/extras |
1c7e4594 | 208 | %{_appdir}/extras/README.md |
1e429e6f | 209 | %{_appdir}/extras/EasyPeasyICS.php |
26058974 | 210 | %{_appdir}/extras/htmlfilter.php |
b15df9b0 | 211 | %{_appdir}/extras/ntlm_sasl_client.php |
26058974 | 212 | |
13bc6b87 | 213 | %{_examplesdir}/%{name}-%{version} |
7605f8f0 ER |
214 | |
215 | %files phpdoc | |
216 | %defattr(644,root,root,755) | |
217 | %{_phpdocdir}/%{pkgname} |