]> git.pld-linux.org Git - packages/php-phpmailer.git/blobdiff - php-phpmailer.spec
- build phpdoc, bundled one is incomplete and too old
[packages/php-phpmailer.git] / php-phpmailer.spec
index 4f5f75c8a3a3a8f597ca6a5e4f6a3e9bef036c14..a3ca3944f34f4b197a21cb85a85c3651f35b240c 100644 (file)
@@ -1,8 +1,9 @@
+%define                pkgname phpmailer
 %define                php_min_version 5.2.0
 %include       /usr/lib/rpm/macros.php
 Summary:       Full featured email transfer class for PHP
 Summary(pl.UTF-8):     W pełni funkcjonalna klasa PHP do przesyłania e-maili
-Name:          php-phpmailer
+Name:          php-%{pkgname}
 Version:       5.2.1
 Release:       2
 License:       LGPL v2.1
@@ -13,6 +14,7 @@ Patch0:               paths.patch
 Patch1:                phpmailer-update-et.patch
 Patch2:                tests.patch
 URL:           http://code.google.com/a/apache-extras.org/p/phpmailer/
+BuildRequires: php-pear-PhpDocumentor
 BuildRequires: rpm-php-pearprov >= 4.4.2-11
 BuildRequires: rpmbuild(macros) >= 1.553
 Requires:      php-common >= 4:%{php_min_version}
@@ -24,7 +26,8 @@ Obsoletes:    phpmailer
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _appdir         %{php_data_dir}/phpmailer
+%define                _appdir         %{php_data_dir}/%{pkgname}
+%define                _phpdocdir      %{_docdir}/phpdoc
 
 # exclude optional php dependencies
 %define                _noautophp      php-openssl php-mbstring php-filter
@@ -44,6 +47,18 @@ plikowych, serwery SMTP, CC, BCC, wiadomości HTML, zawijanie linii
 itp. Potrafi wysyłać pocztę przez sendmaila, funkcją PHP mail() albo
 poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail.
 
+%package phpdoc
+Summary:       Online manual for %{name}
+Summary(pl.UTF-8):     Dokumentacja online do %{name}
+Group:         Documentation
+Requires:      php-dirs
+
+%description phpdoc
+Documentation for %{name}.
+
+%description phpdoc -l pl.UTF-8
+Dokumentacja do %{name}.
+
 %prep
 %setup -q -n PHPMailer_%{version}
 %patch0 -p1
@@ -52,6 +67,20 @@ poprzez SMTP. Metody są oparte na popularnym komponencie AspEmail.
 
 %undos -f php,html,txt README LICENSE
 
+mv docs/5.0-phpdocs phpdoc.orig
+
+%build
+phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer -f 'class.*.php'
+# nuke smarty cache
+rm -rf phpdoc/????????????????????????????????
+rm -rf phpdoc/*/????????????????????????????????
+
+# copy images, phpdoc is likely buggy not doing itself
+sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images
+install -d phpdoc/media/images
+cp -a $sdir/Constant.png phpdoc/media/images
+cp -a $sdir/Variable.png phpdoc/media/images
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_appdir}/language
@@ -69,6 +98,10 @@ cp -a extras $RPM_BUILD_ROOT%{_appdir}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
+# api doc
+install -d $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
+cp -a phpdoc/* $RPM_BUILD_ROOT%{_phpdocdir}/%{pkgname}
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -110,3 +143,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_appdir}/extras/htmlfilter.php
 
 %{_examplesdir}/%{name}-%{version}
+
+%files phpdoc
+%defattr(644,root,root,755)
+%{_phpdocdir}/%{pkgname}
This page took 0.053978 seconds and 4 git commands to generate.