]> git.pld-linux.org Git - packages/php-phpmailer.git/blame_incremental - php-phpmailer.spec
fix syntax linting for various php versions
[packages/php-phpmailer.git] / php-phpmailer.spec
... / ...
CommitLineData
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
8Summary: Full featured email transfer class for PHP
9Summary(pl.UTF-8): W pełni funkcjonalna klasa PHP do przesyłania e-maili
10Name: php-%{pkgname}
11Version: 5.2.12
12Release: 1
13License: LGPL v2.1
14Group: Development/Languages/PHP
15Source0: https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz
16# Source0-md5: 5c2d02e6fc4a61c9ba8b20810b564b1c
17URL: https://github.com/PHPMailer/PHPMailer
18BuildRequires: php-pear-PhpDocumentor
19BuildRequires: rpm-php-pearprov >= 4.4.2-11
20BuildRequires: rpmbuild(macros) >= 1.663
21%if %{with tests}
22BuildRequires: %{php_name}-cli
23BuildRequires: %{php_name}-mbstring
24BuildRequires: phpunit
25BuildRequires: which
26%endif
27Requires: php(core) >= %{php_min_version}
28Requires: php(date)
29Requires: php(pcre)
30Suggests: php(hash)
31Suggests: php(mbstring)
32Suggests: php(openssl)
33Obsoletes: phpmailer
34# Gmail XOAUTH2 authentication
35#Suggests: php-league-oauth2-client
36BuildArch: noarch
37BuildRoot: %{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
52PHP email transport class featuring multiple file attachments, SMTP
53servers, CCs, BCCs, HTML messages, and word wrap, and more. It can
54send email via sendmail, PHP mail(), or with SMTP. Methods are based
55on the popular AspEmail active server component.
56
57%description -l pl.UTF-8
58Klasa PHP do przesyłania e-mail obsługująca wiele załączników
59plikowych, serwery SMTP, CC, BCC, wiadomości HTML, zawijanie linii
60itp. Potrafi wysyłać pocztę przez sendmaila, funkcją PHP mail() albo
61poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail.
62
63%package phpdoc
64Summary: Online manual for %{name}
65Summary(pl.UTF-8): Dokumentacja online do %{name}
66Group: Documentation
67Requires: php-dirs
68
69%description phpdoc
70Documentation for %{name}.
71
72%description phpdoc -l pl.UTF-8
73Dokumentacja do %{name}.
74
75%prep
76%setup -q -n PHPMailer-%{version}%{?subver:-%{subver}}
77
78%build
79# syntax lint
80for 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
101done
102
103%if %{with tests}
104cd test
105%{__php} $(which phpunit) .
106cd -
107%endif
108
109rm -rf phpdoc
110phpdoc --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
114sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images
115install -d phpdoc/media/images
116cp -p $sdir/Constant.png phpdoc/media/images
117cp -p $sdir/Variable.png phpdoc/media/images
118
119%install
120rm -rf $RPM_BUILD_ROOT
121install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language}
122
123ln -s %{_appdir}/class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir}
124ln -s %{_appdir}/PHPMailerAutoload.php $RPM_BUILD_ROOT%{php_data_dir}
125
126cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir}
127# language: translations of error messages
128cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language
129
130# extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php
131cp -a extras $RPM_BUILD_ROOT%{_appdir}
132
133# examples
134install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
135cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136
137# api doc
138install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
139cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
140
141%clean
142rm -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}
This page took 0.108343 seconds and 4 git commands to generate.