From 2860fea937acb75d5a5a22a40803fe89d08a4394 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 9 May 2013 17:13:06 +0200 Subject: php-tcpdf: more work --- php-tcpdf.spec | 74 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 30 deletions(-) (limited to 'php-tcpdf.spec') diff --git a/php-tcpdf.spec b/php-tcpdf.spec index 4b4dd00..5cd2d82 100644 --- a/php-tcpdf.spec +++ b/php-tcpdf.spec @@ -12,7 +12,7 @@ License: LGPLv3+ Group: Development/Libraries Patch0: php-tcpdf_badpath.patch -Patch1: php-tcpdf_cachepath.patch +Patch1: php-tcpdf_config.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -74,44 +74,53 @@ PHP class for generating PDF documents. * PDF/A-1b (ISO 19005-1:2005) support. By default, TCPDF uses the GD library which is know as slower than ImageMagick -solution. You can optionally install php-pecl(imagick); TCPDF will use it. +solution. You can optionally install php-pecl-imagick; TCPDF will use it. %prep %setup -qn %{real_name} -%patch0 -p1 -%patch1 -p1 +%patch0 -p1 -b .badpath +%patch1 -p1 -b .config + : globally fix permissions, always broken... -chmod 755 `find ./ -type d` -chmod 644 `find ./ -type f` +find ./ -type d -exec chmod 755 {} \; +find ./ -type f -exec chmod 644 {} \; + : remove composer rm -f composer.json + : langs are not config... mv config/lang . + : move certs in examples mv config/cert examples/ -: some files in config are relevant for examples only -mv images examples/ -mkdir examples/cache -mv cache/* examples/cache/ + +: some files are relevant for examples only +mv cache examples/cache +mv config/tcpdf_config_alt.php examples/ + + : change examples include paths sed -i examples/*.php examples/barcodes/*.php \ -e "s|../config/cert/|./cert/|" \ -e "s|../config/lang|%{_datadir}/php/%{real_name}/lang|g" \ - -e "s|../%{real_name}.php|%{real_name}.php|" \ - -e "s|../config/tcpdf_config_alt.php|%{_sysconfdir}/%{name}/%{real_name}_config_alt.php|" \ - -e "s|../cache/|./cache/|" \ - -e "s|../images/|./images/|" \ - -e "s|dirname(__FILE__).'/../../|'|" + -e "s|../%{real_name}.php|%{real_name}/%{real_name}.php|" \ + -e "s|../config/%{real_name}_config_alt.php|%{real_name}_config_alt.php|" \ + -e "s|../cache/|cache/|" \ + -e "s|../images/|images/|" \ + -e "s|dirname(__FILE__).'/../../|'%{real_name}/|" + : wrong end-of-line encoding sed -i 's/\r//' \ lang/bul.php \ - examples/images/bug.eps \ - examples/images/tiger.ai \ - examples/images/pelican.ai -pushd examples + images/bug.eps \ + images/tiger.ai \ + images/pelican.ai + : non UTF8 files -iconv -f iso8859-1 -t utf-8 example_030.php > example_030.php.conv && mv -f example_030.php.conv example_030.php +pushd examples +iconv -f iso8859-1 -t utf-8 example_030.php > example_030.php.conv \ + && mv -f example_030.php.conv example_030.php popd @@ -121,14 +130,19 @@ popd %install rm -rf $RPM_BUILD_ROOT -# install -install -d $RPM_BUILD_ROOT%{_datadir}/php/%{name} -cp -a *.php $RPM_BUILD_ROOT%{_datadir}/php/%{name}/ -cp -a include $RPM_BUILD_ROOT%{_datadir}/php/%{name}/ -cp -a fonts $RPM_BUILD_ROOT%{_datadir}/php/%{name}/ -install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name} -cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}/%{name} -ln -s ../../../..%{_sysconfdir}/%{name} $RPM_BUILD_ROOT%{_datadir}/php/%{name}/config +# Library +install -d $RPM_BUILD_ROOT%{_datadir}/php/%{real_name} +cp -a *.php $RPM_BUILD_ROOT%{_datadir}/php/%{real_name}/ +cp -a images $RPM_BUILD_ROOT%{_datadir}/php/%{real_name}/ +cp -a include $RPM_BUILD_ROOT%{_datadir}/php/%{real_name}/ +cp -a fonts $RPM_BUILD_ROOT%{_datadir}/php/%{real_name}/ +cp -a lang $RPM_BUILD_ROOT%{_datadir}/php/%{real_name}/ + +# Config +install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name} +cp -a config/*.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name} + +# Cache install -d $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name} @@ -139,12 +153,12 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE.TXT README.TXT CHANGELOG.TXT doc/* examples -%{_datadir}/php/%{name} +%{_datadir}/php/%{real_name} %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/* %dir %attr(-,apache,apache) %{_localstatedir}/cache/%{name} %changelog -* Thu May 09 2013 Johan Cwiklinski - 6.0.012-1.trashy +* Thu May 09 2013 Johan Cwiklinski - 6.0.012-1 - Initial packaging -- cgit