PEAR and PECL
What is PECL?
PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.
The packaging and distribution system used by PECL is shared with its sister, PEAR.
What is PEAR?
PEAR is short for „PHP Extension and Application Repository“ and is pronounced just like the fruit.
pear makerpm
'pear' archive http://pear.php.net (the PHP equivalent of perl's CPAN).
Once you've installed the later PHP, you can use the 'pear makerpm' command to generate a specfile to build an RPM.
If pear makerpm generates corrupt spec-files, you can alternatively specify your own template.spec file:
Summary: PEAR: @summary@
Name: @rpm_package@
Version: @version@
Release: 1
License: @release_license@
Group: Produktivität/Netzwerk/Web/Server
Source: http://@master_server@/get/@package@-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-root
URL: http://@master_server@/
Prefix: %{_prefix}
Docdir: @doc_dir@/@package@
BuildArchitectures: @arch@
@extra_headers@
%description
@description@
%prep
rm -rf %{buildroot}/*
%build
echo BuildRoot=%{buildroot}
%postun
pear uninstall --nodeps -r @package@
# rm @rpm_xml_dir@/@package@.xml
%post
pear install --nodeps -r @rpm_xml_dir@/@package@.xml
%install
pear install --nodeps -R %{buildroot} \
$RPM_SOURCE_DIR/@package@-%{version}.tgz
PEAR_PHP_DIR=`pear config-get php_dir | cut -f2 -d=`
rm -f %{buildroot}$PEAR_PHP_DIR/.filemap
rm -f %{buildroot}$PEAR_PHP_DIR/.lock
rm -rf %{buildroot}$PEAR_PHP_DIR/.registry
mkdir -p %{buildroot}@rpm_xml_dir@
tar -xzf $RPM_SOURCE_DIR/@package@-%{version}.tgz package.xml
cp -p package.xml %{buildroot}@rpm_xml_dir@/@package@.xml
# Build a file list, minus the docs
find %{buildroot} -type f -print | sed "s@^$RPM_BUILD_ROOT@@g" > filelist.@package@
%clean
rm -rf $RPM_BUILD_ROOT
rm filelist.@package@
# Could use the \@doc_files\@ macro to install the docs in the
# standard RPM docs location, but I'd rather keep pear docs in the same
# place that they would have gone of the package had been installed manually
%files -f filelist.@package@
%defattr(-,root,root)
%docdir %(pear config-get doc_dir | cut -f2 -d=)
Then after downloading eg. the pear tarball bla.tgz into ../SOURCES directory:
pear makerpm -t pear-template.spec -p pear-%s ../SOURCES/bla.tgz rpmbuild -ba pear-bla.spec
The option „group=Produktivität/Netzwerk/Web/Server“ is valid for openSUSE 10.2, and can differ.
← index