]> git.pld-linux.org Git - packages/php-phpmailer.git/blame - php-phpmailer.spec
requires ctype ext
[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}
4c8a0a82 11Version: 5.2.21
91a9c489 12Release: 2
6a698734 13License: LGPL v2.1
46bf6096 14Group: Development/Languages/PHP
1e429e6f 15Source0: https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz
4c8a0a82 16# Source0-md5: fe38b2046da78ebe9faa995cc6d1f306
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
c5893738 164%lang(be) %{_appdir}/language/phpmailer.lang-be.php
d3732919 165%lang(bg) %{_appdir}/language/phpmailer.lang-bg.php
13bc6b87 166%lang(ca) %{_appdir}/language/phpmailer.lang-ca.php
6a698734 167%lang(ch) %{_appdir}/language/phpmailer.lang-ch.php
6b46fa01
ER
168%lang(cs) %{_appdir}/language/phpmailer.lang-cs.php
169%lang(da) %{_appdir}/language/phpmailer.lang-da.php
19f5ccc5 170%lang(de) %{_appdir}/language/phpmailer.lang-de.php
c5893738 171%lang(el) %{_appdir}/language/phpmailer.lang-el.php
2765a7e5 172%lang(eo) %{_appdir}/language/phpmailer.lang-eo.php
13bc6b87
ER
173%lang(es) %{_appdir}/language/phpmailer.lang-es.php
174%lang(et) %{_appdir}/language/phpmailer.lang-et.php
1e429e6f 175%lang(fa) %{_appdir}/language/phpmailer.lang-fa.php
13bc6b87
ER
176%lang(fi) %{_appdir}/language/phpmailer.lang-fi.php
177%lang(fo) %{_appdir}/language/phpmailer.lang-fo.php
178%lang(fr) %{_appdir}/language/phpmailer.lang-fr.php
c5893738 179%lang(gl) %{_appdir}/language/phpmailer.lang-gl.php
2765a7e5 180%lang(he) %{_appdir}/language/phpmailer.lang-he.php
c5893738 181%lang(hr) %{_appdir}/language/phpmailer.lang-hr.php
13bc6b87 182%lang(hu) %{_appdir}/language/phpmailer.lang-hu.php
d3732919 183%lang(id) %{_appdir}/language/phpmailer.lang-id.php
13bc6b87
ER
184%lang(it) %{_appdir}/language/phpmailer.lang-it.php
185%lang(ja) %{_appdir}/language/phpmailer.lang-ja.php
c5893738 186%lang(ka) %{_appdir}/language/phpmailer.lang-ka.php
d3732919 187%lang(ko) %{_appdir}/language/phpmailer.lang-ko.php
1e429e6f 188%lang(lt) %{_appdir}/language/phpmailer.lang-lt.php
c5893738 189%lang(lv) %{_appdir}/language/phpmailer.lang-lv.php
d3732919 190%lang(ms) %{_appdir}/language/phpmailer.lang-ms.php
6b46fa01 191%lang(nb) %{_appdir}/language/phpmailer.lang-nb.php
19f5ccc5 192%lang(nl) %{_appdir}/language/phpmailer.lang-nl.php
13bc6b87 193%lang(pl) %{_appdir}/language/phpmailer.lang-pl.php
c5893738 194%lang(pt) %{_appdir}/language/phpmailer.lang-pt.php
6b46fa01 195%lang(pt_BR) %{_appdir}/language/phpmailer.lang-pt_br.php
13bc6b87
ER
196%lang(ro) %{_appdir}/language/phpmailer.lang-ro.php
197%lang(ru) %{_appdir}/language/phpmailer.lang-ru.php
b904c15d 198%lang(sk) %{_appdir}/language/phpmailer.lang-sk.php
d3732919 199%lang(sl) %{_appdir}/language/phpmailer.lang-sl.php
c5893738 200%lang(sr) %{_appdir}/language/phpmailer.lang-sr.php
6b46fa01 201%lang(sv) %{_appdir}/language/phpmailer.lang-sv.php
13bc6b87 202%lang(tr) %{_appdir}/language/phpmailer.lang-tr.php
1e429e6f 203%lang(uk) %{_appdir}/language/phpmailer.lang-uk.php
c5893738 204%lang(vi) %{_appdir}/language/phpmailer.lang-vi.php
6a698734
ER
205%lang(zh) %{_appdir}/language/phpmailer.lang-zh.php
206%lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php
13bc6b87 207
26058974 208%dir %{_appdir}/extras
1c7e4594 209%{_appdir}/extras/README.md
1e429e6f 210%{_appdir}/extras/EasyPeasyICS.php
26058974 211%{_appdir}/extras/htmlfilter.php
b15df9b0 212%{_appdir}/extras/ntlm_sasl_client.php
26058974 213
13bc6b87 214%{_examplesdir}/%{name}-%{version}
7605f8f0
ER
215
216%files phpdoc
217%defattr(644,root,root,755)
218%{_phpdocdir}/%{pkgname}
This page took 0.064713 seconds and 4 git commands to generate.