File php4-pdflib.spec of Package php4-pdf

Name:		php4-pdflib
Version: 	2.1.4
Release:	1
License: 	Proprietary (http://www.pdflib.com/fileadmin/pdflib/pdf/license/PDFlib-Lite-license.pdf)
Group: 		Development/Libraries
Summary: 	php pdflib extension
Summary(de):	php pdflib Erweiterung
URL: 		http://www.pdflib.com/
Source0: 	pdflib-%{version}.tgz
BuildRoot: 	%{_tmppath}/%{name}-%{version}-build
Packager:       Carsten Schoene <cs@linux-administrator.com>
Vendor:         linux-administrator.com
BuildRequires:	PDFlib-Lite-devel autoconf automake php4-devel glibc-devel libgcc gcc gcc-c++
Requires:	php4 PDFlib-Lite sed grep

%description
This extension wraps the PDFlib programming library
for processing PDF on the fly, created by Thomas Merz. 

%description(de)
Diese Erweiterung nutzt die PDFlib bibliothek fuer das 
erstellen von PDF Dokumenten.

%prep
%setup -q -n pdflib-%{version}

export PHP_PREFIX=%{_prefix}
$PHP_PREFIX/bin/phpize
./configure --enable-pdflib=shared --with-php-config=$PHP_PREFIX/bin/php-config

%__make
%install
install -m 755 -d $RPM_BUILD_ROOT%{_libdir}/php/extensions/
install -m 755 modules/pdf.so $RPM_BUILD_ROOT%{_libdir}/php/extensions/
cd $RPM_BUILD_ROOT
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name}
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}


%post
if [ -f /etc/php.ini ] ; then
	if [ -z "`grep \"^extension=pdf.so\" /etc/php.ini`" ]; then
		echo "extension=pdf.so" >> /etc/php.ini
	fi
fi

%preun
sed -e s/"extension=pdf.so"//g /etc/php.ini > /etc/php.ini.new
if [ -s /etc/php.ini.new ] ; then
	mv /etc/php.ini.new /etc/php.ini
fi

%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/%{name}*
rm -rf ../file.list.%{name}

%files -f ../file.list.%{name}
%doc CREDITS
 
%changelog
* Wed Oct 17 2007 Carsten Schoene <cs@linux-administrator.com>
- version changed to 2.1.4

* Wed Jun 27 2007 Carsten Schoene <cs@linux-administrator.com>
- renamed the package from php4-pdf to php4-pdflib
- version changed to 2.1.3

* Tue Apr 25 2006 Carsten Schoene <cs@linux-administrator.com>
- version bump to 2.0.5

* Wed Feb 08 2006 Carsten Schoene <cs@linux-administrator.com>
- initial build, version 2.0.4
openSUSE Build Service is sponsored by