]> git.pld-linux.org Git - packages/php-phpmailer.git/blob - php-phpmailer.spec
requires ctype ext
[packages/php-phpmailer.git] / php-phpmailer.spec
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.21
12 Release:        2
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:  fe38b2046da78ebe9faa995cc6d1f306
17 URL:            https://github.com/PHPMailer/PHPMailer
18 BuildRequires:  php-devel
19 BuildRequires:  php-pear-PhpDocumentor
20 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
21 BuildRequires:  rpmbuild(macros) >= 1.663
22 %if %{with tests}
23 BuildRequires:  %{php_name}-cli
24 BuildRequires:  %{php_name}-mbstring
25 BuildRequires:  phpunit
26 BuildRequires:  which
27 %endif
28 Requires:       php(core) >= %{php_min_version}
29 Requires:       php(ctype)
30 Requires:       php(date)
31 Requires:       php(pcre)
32 Suggests:       php(hash)
33 Suggests:       php(mbstring)
34 Suggests:       php(openssl)
35 Obsoletes:      phpmailer
36 # Gmail XOAUTH2 authentication
37 #Suggests:      php-league-oauth2-client
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %define         _appdir         %{php_data_dir}/%{pkgname}
42 %define         _phpdocdir      %{_docdir}/phpdoc
43
44 # exclude optional php dependencies
45 %define         _noautophp      php-openssl php-mbstring php-filter php-hash
46
47 # bad depsolver
48 %define         _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php extras/.*
49
50 # put it together for rpmbuild
51 %define         _noautoreq      %{?_noautophp}
52
53 %description
54 PHP email transport class featuring multiple file attachments, SMTP
55 servers, CCs, BCCs, HTML messages, and word wrap, and more. It can
56 send email via sendmail, PHP mail(), or with SMTP. Methods are based
57 on the popular AspEmail active server component.
58
59 %description -l pl.UTF-8
60 Klasa PHP do przesyłania e-mail obsługująca wiele załączników
61 plikowych, serwery SMTP, CC, BCC, wiadomości HTML, zawijanie linii
62 itp. Potrafi wysyłać pocztę przez sendmaila, funkcją PHP mail() albo
63 poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail.
64
65 %package phpdoc
66 Summary:        Online manual for %{name}
67 Summary(pl.UTF-8):      Dokumentacja online do %{name}
68 Group:          Documentation
69 Requires:       php-dirs
70
71 %description phpdoc
72 Documentation for %{name}.
73
74 %description phpdoc -l pl.UTF-8
75 Dokumentacja do %{name}.
76
77 %prep
78 %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}}
79
80 %build
81 # syntax lint
82 for 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
86         class.phpmaileroauthgoogle.php|get_oauth_token.php)
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
103 done
104
105 %if %{with tests}
106 cd test
107 %{__php} $(which phpunit) .
108 cd -
109 %endif
110
111 rm -rf phpdoc
112 phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \
113         --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode
114
115 # copy images, phpdoc is likely buggy not doing itself
116 sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images
117 install -d phpdoc/media/images
118 cp -p $sdir/Constant.png phpdoc/media/images
119 cp -p $sdir/Variable.png phpdoc/media/images
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_appdir}/language}
124
125 ln -s %{_appdir}/class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir}
126 ln -s %{_appdir}/PHPMailerAutoload.php $RPM_BUILD_ROOT%{php_data_dir}
127
128 cp -p class.*.php PHPMailerAutoload.php $RPM_BUILD_ROOT%{_appdir}
129 # language: translations of error messages
130 cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language
131
132 # extras: htmlfilter.php, ntlm_sasl_client.php, EasyPeasyICS.php
133 cp -a extras $RPM_BUILD_ROOT%{_appdir}
134
135 # examples
136 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
137 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
138
139 # api doc
140 install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
141 cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
142
143 %clean
144 rm -rf $RPM_BUILD_ROOT
145
146 %files
147 %defattr(644,root,root,755)
148 #%doc README.md changelog.md docs/*
149 # public interfaces
150 %{php_data_dir}/PHPMailerAutoload.php
151 %{php_data_dir}/class.phpmailer.php
152
153 %dir %{_appdir}
154 %{_appdir}/PHPMailerAutoload.php
155 %{_appdir}/class.phpmailer.php
156 %{_appdir}/class.phpmaileroauth.php
157 %{_appdir}/class.phpmaileroauthgoogle.php
158 %{_appdir}/class.pop3.php
159 %{_appdir}/class.smtp.php
160 %dir %{_appdir}/language
161 %lang(am) %{_appdir}/language/phpmailer.lang-am.php
162 %lang(ar) %{_appdir}/language/phpmailer.lang-ar.php
163 %lang(az) %{_appdir}/language/phpmailer.lang-az.php
164 %lang(be) %{_appdir}/language/phpmailer.lang-be.php
165 %lang(bg) %{_appdir}/language/phpmailer.lang-bg.php
166 %lang(ca) %{_appdir}/language/phpmailer.lang-ca.php
167 %lang(ch) %{_appdir}/language/phpmailer.lang-ch.php
168 %lang(cs) %{_appdir}/language/phpmailer.lang-cs.php
169 %lang(da) %{_appdir}/language/phpmailer.lang-da.php
170 %lang(de) %{_appdir}/language/phpmailer.lang-de.php
171 %lang(el) %{_appdir}/language/phpmailer.lang-el.php
172 %lang(eo) %{_appdir}/language/phpmailer.lang-eo.php
173 %lang(es) %{_appdir}/language/phpmailer.lang-es.php
174 %lang(et) %{_appdir}/language/phpmailer.lang-et.php
175 %lang(fa) %{_appdir}/language/phpmailer.lang-fa.php
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
179 %lang(gl) %{_appdir}/language/phpmailer.lang-gl.php
180 %lang(he) %{_appdir}/language/phpmailer.lang-he.php
181 %lang(hr) %{_appdir}/language/phpmailer.lang-hr.php
182 %lang(hu) %{_appdir}/language/phpmailer.lang-hu.php
183 %lang(id) %{_appdir}/language/phpmailer.lang-id.php
184 %lang(it) %{_appdir}/language/phpmailer.lang-it.php
185 %lang(ja) %{_appdir}/language/phpmailer.lang-ja.php
186 %lang(ka) %{_appdir}/language/phpmailer.lang-ka.php
187 %lang(ko) %{_appdir}/language/phpmailer.lang-ko.php
188 %lang(lt) %{_appdir}/language/phpmailer.lang-lt.php
189 %lang(lv) %{_appdir}/language/phpmailer.lang-lv.php
190 %lang(ms) %{_appdir}/language/phpmailer.lang-ms.php
191 %lang(nb) %{_appdir}/language/phpmailer.lang-nb.php
192 %lang(nl) %{_appdir}/language/phpmailer.lang-nl.php
193 %lang(pl) %{_appdir}/language/phpmailer.lang-pl.php
194 %lang(pt) %{_appdir}/language/phpmailer.lang-pt.php
195 %lang(pt_BR) %{_appdir}/language/phpmailer.lang-pt_br.php
196 %lang(ro) %{_appdir}/language/phpmailer.lang-ro.php
197 %lang(ru) %{_appdir}/language/phpmailer.lang-ru.php
198 %lang(sk) %{_appdir}/language/phpmailer.lang-sk.php
199 %lang(sl) %{_appdir}/language/phpmailer.lang-sl.php
200 %lang(sr) %{_appdir}/language/phpmailer.lang-sr.php
201 %lang(sv) %{_appdir}/language/phpmailer.lang-sv.php
202 %lang(tr) %{_appdir}/language/phpmailer.lang-tr.php
203 %lang(uk) %{_appdir}/language/phpmailer.lang-uk.php
204 %lang(vi) %{_appdir}/language/phpmailer.lang-vi.php
205 %lang(zh) %{_appdir}/language/phpmailer.lang-zh.php
206 %lang(zh_CN) %{_appdir}/language/phpmailer.lang-zh_cn.php
207
208 %dir %{_appdir}/extras
209 %{_appdir}/extras/README.md
210 %{_appdir}/extras/EasyPeasyICS.php
211 %{_appdir}/extras/htmlfilter.php
212 %{_appdir}/extras/ntlm_sasl_client.php
213
214 %{_examplesdir}/%{name}-%{version}
215
216 %files phpdoc
217 %defattr(644,root,root,755)
218 %{_phpdocdir}/%{pkgname}
This page took 0.056291 seconds and 3 git commands to generate.