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