]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
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 | |
10 | Name: php-%{pkgname} | |
11 | Version: 5.2.12 | |
12 | Release: 1 | |
13 | License: LGPL v2.1 | |
14 | Group: Development/Languages/PHP | |
15 | Source0: https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz | |
16 | # Source0-md5: 5c2d02e6fc4a61c9ba8b20810b564b1c | |
17 | URL: https://github.com/PHPMailer/PHPMailer | |
18 | BuildRequires: php-pear-PhpDocumentor | |
19 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 | |
20 | BuildRequires: rpmbuild(macros) >= 1.663 | |
21 | %if %{with tests} | |
22 | BuildRequires: %{php_name}-cli | |
23 | BuildRequires: %{php_name}-mbstring | |
24 | BuildRequires: phpunit | |
25 | BuildRequires: which | |
26 | %endif | |
27 | Requires: php(core) >= %{php_min_version} | |
28 | Requires: php(date) | |
29 | Requires: php(pcre) | |
30 | Suggests: php(hash) | |
31 | Suggests: php(mbstring) | |
32 | Suggests: php(openssl) | |
33 | Obsoletes: phpmailer | |
34 | # Gmail XOAUTH2 authentication | |
35 | #Suggests: php-league-oauth2-client | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %define _appdir %{php_data_dir}/%{pkgname} | |
40 | %define _phpdocdir %{_docdir}/phpdoc | |
41 | ||
42 | # exclude optional php dependencies | |
43 | %define _noautophp php-openssl php-mbstring php-filter php-hash | |
44 | ||
45 | # bad depsolver | |
46 | %define _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php | |
47 | ||
48 | # put it together for rpmbuild | |
49 | %define _noautoreq %{?_noautophp} | |
50 | ||
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 | ||
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 | ||
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 | ||
75 | %prep | |
76 | %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}} | |
77 | ||
78 | %build | |
79 | # syntax lint | |
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 | |
101 | done | |
102 | ||
103 | %if %{with tests} | |
104 | cd test | |
105 | %{__php} $(which phpunit) . | |
106 | cd - | |
107 | %endif | |
108 | ||
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 | |
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 | |
116 | cp -p $sdir/Constant.png phpdoc/media/images | |
117 | cp -p $sdir/Variable.png phpdoc/media/images | |
118 | ||
119 | %install | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language} | |
122 | ||
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 | ||
126 | cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir} | |
127 | # language: translations of error messages | |
128 | cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language | |
129 | ||
130 | # extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php | |
131 | cp -a extras $RPM_BUILD_ROOT%{_appdir} | |
132 | ||
133 | # examples | |
134 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
135 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
136 | ||
137 | # api doc | |
138 | install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname} | |
139 | cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname} | |
140 | ||
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
144 | %files | |
145 | %defattr(644,root,root,755) | |
146 | %doc README.md changelog.md docs/* | |
147 | # public interfaces | |
148 | %{php_data_dir}/PHPMailerAutoload.php | |
149 | %{php_data_dir}/class.phpmailer.php | |
150 | ||
151 | %dir %{_appdir} | |
152 | %{_appdir}/PHPMailerAutoload.php | |
153 | %{_appdir}/class.oauth.php | |
154 | %{_appdir}/class.phpmailer.php | |
155 | %{_appdir}/class.phpmaileroauth.php | |
156 | %{_appdir}/class.pop3.php | |
157 | %{_appdir}/class.smtp.php | |
158 | %dir %{_appdir}/language | |
159 | %lang(am) %{_appdir}/language/phpmailer.lang-am.php | |
160 | %lang(ar) %{_appdir}/language/phpmailer.lang-ar.php | |
161 | %lang(az) %{_appdir}/language/phpmailer.lang-az.php | |
162 | %lang(be) %{_appdir}/language/phpmailer.lang-be.php | |
163 | %lang(bg) %{_appdir}/language/phpmailer.lang-bg.php | |
164 | %lang(ca) %{_appdir}/language/phpmailer.lang-ca.php | |
165 | %lang(ch) %{_appdir}/language/phpmailer.lang-ch.php | |
166 | %lang(cs) %{_appdir}/language/phpmailer.lang-cz.php | |
167 | %lang(da) %{_appdir}/language/phpmailer.lang-dk.php | |
168 | %lang(de) %{_appdir}/language/phpmailer.lang-de.php | |
169 | %lang(el) %{_appdir}/language/phpmailer.lang-el.php | |
170 | %lang(eo) %{_appdir}/language/phpmailer.lang-eo.php | |
171 | %lang(es) %{_appdir}/language/phpmailer.lang-es.php | |
172 | %lang(et) %{_appdir}/language/phpmailer.lang-et.php | |
173 | %lang(fa) %{_appdir}/language/phpmailer.lang-fa.php | |
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 | |
177 | %lang(gl) %{_appdir}/language/phpmailer.lang-gl.php | |
178 | %lang(he) %{_appdir}/language/phpmailer.lang-he.php | |
179 | %lang(hr) %{_appdir}/language/phpmailer.lang-hr.php | |
180 | %lang(hu) %{_appdir}/language/phpmailer.lang-hu.php | |
181 | %lang(id) %{_appdir}/language/phpmailer.lang-id.php | |
182 | %lang(it) %{_appdir}/language/phpmailer.lang-it.php | |
183 | %lang(ja) %{_appdir}/language/phpmailer.lang-ja.php | |
184 | %lang(ka) %{_appdir}/language/phpmailer.lang-ka.php | |
185 | %lang(ko) %{_appdir}/language/phpmailer.lang-ko.php | |
186 | %lang(lt) %{_appdir}/language/phpmailer.lang-lt.php | |
187 | %lang(lv) %{_appdir}/language/phpmailer.lang-lv.php | |
188 | %lang(ms) %{_appdir}/language/phpmailer.lang-ms.php | |
189 | %lang(nb) %{_appdir}/language/phpmailer.lang-no.php | |
190 | %lang(nl) %{_appdir}/language/phpmailer.lang-nl.php | |
191 | %lang(pl) %{_appdir}/language/phpmailer.lang-pl.php | |
192 | %lang(pt) %{_appdir}/language/phpmailer.lang-pt.php | |
193 | %lang(pt_BR) %{_appdir}/language/phpmailer.lang-br.php | |
194 | %lang(ro) %{_appdir}/language/phpmailer.lang-ro.php | |
195 | %lang(ru) %{_appdir}/language/phpmailer.lang-ru.php | |
196 | %lang(sk) %{_appdir}/language/phpmailer.lang-sk.php | |
197 | %lang(sl) %{_appdir}/language/phpmailer.lang-sl.php | |
198 | %lang(sr) %{_appdir}/language/phpmailer.lang-sr.php | |
199 | %lang(sv) %{_appdir}/language/phpmailer.lang-se.php | |
200 | %lang(tr) %{_appdir}/language/phpmailer.lang-tr.php | |
201 | %lang(uk) %{_appdir}/language/phpmailer.lang-uk.php | |
202 | %lang(vi) %{_appdir}/language/phpmailer.lang-vi.php | |
203 | %lang(zh) %{_appdir}/language/phpmailer.lang-zh.php | |
204 | %lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php | |
205 | ||
206 | %dir %{_appdir}/extras | |
207 | %{_appdir}/extras/README.md | |
208 | %{_appdir}/extras/EasyPeasyICS.php | |
209 | %{_appdir}/extras/htmlfilter.php | |
210 | %{_appdir}/extras/ntlm_sasl_client.php | |
211 | ||
212 | %{_examplesdir}/%{name}-%{version} | |
213 | ||
214 | %files phpdoc | |
215 | %defattr(644,root,root,755) | |
216 | %{_phpdocdir}/%{pkgname} |