cleanup bundled fonts in prep, install addfont tool
authorElan Ruusamäe <glen@delfi.ee>
Tue, 31 Mar 2015 19:30:40 +0000 (22:30 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 31 Mar 2015 19:30:40 +0000 (22:30 +0300)
php-tcpdf.spec

index 46a617d01d3f64344fc72019b48a522e56e36b63..c8db10188f0c5bb7c16afdc116b2d78d767db0e2 100644 (file)
@@ -1,8 +1,9 @@
 # TODO
 # - config to /etc
+%define                pkgname tcpdf
 %define                ver     %(echo %{version} | tr . _)
 Summary:       TCPDF - PHP class for PDF
-Name:          php-tcpdf
+Name:          php-%{pkgname}
 Version:       6.2.6
 Release:       1
 License:       LGPL v2.1
@@ -10,6 +11,7 @@ Group:                Development/Languages/PHP
 Source0:       http://downloads.sourceforge.net/tcpdf/tcpdf_%{ver}.zip
 # Source0-md5: 9185f0ca4ecc65fb8a1dc115ab96b52b
 URL:           http://www.tcpdf.org/
+BuildRequires: %{php_name}-zlib
 BuildRequires: fonts-TTF-DejaVu
 BuildRequires: rpmbuild(macros) >= 1.268
 BuildRequires: unzip
@@ -17,7 +19,7 @@ Requires:     php(core) >= 5.0
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _appdir         %{php_data_dir}/tcpdf
+%define                _appdir         %{php_data_dir}/%{pkgname}
 
 %description
 Generic TCPDF screenshot TCPDF is a PHP class for generating PDF
@@ -40,27 +42,29 @@ TCPDF - przykładowe programy.
 %setup -q -n tcpdf
 %undos *.TXT
 
+# remove bundled fonts
+rm -r fonts/dejavu-fonts-ttf-* fonts/freefont-*
+
 %build
-for a in %{_datadir}/fonts/TTF/DejaVuS*; do
-       php tools/tcpdf_addfont.php -t TrueTypeUnicode -i $a
+for a in %{_fontsdir}/TTF/DejaVuS*; do
+       %{__php} tools/tcpdf_addfont.php -t TrueTypeUnicode -i $a
 done
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_appdir},%{_examplesdir}/%{name}-%{version}}
+install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_examplesdir}/%{name}-%{version}}
 
 cp -a *.php config fonts include $RPM_BUILD_ROOT%{_appdir}
+install -p tools/tcpdf_addfont.php $RPM_BUILD_ROOT%{_bindir}/tcpdf_addfont
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
-rm -r $RPM_BUILD_ROOT%{_appdir}/fonts/*-*
-rm -rf $RPM_BUILD_ROOT%{_appdir}/fonts/utils
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
 %doc CHANGELOG.TXT README.TXT
+%attr(755,root,root) %{_bindir}/tcpdf_addfont
 %{_appdir}
 
 %files examples
This page took 0.102306 seconds and 4 git commands to generate.