Hi All,
I'm used to compile / make / make install my own Apache and Php Distributions from the
tarball. Now i want to move to RPM format and be able to deploy my own RPM.
I have already build a RPM for Apache from the sources and get it installed in my own
custom RPM database. Custom database is created in this way :
* rpm --initdb --dbpath $HOME/rpmdatabase
Now i want to build PHP from the tarball. There is two to perform such action :
- PHP is call throught Apache Fast CGI/FPM
- PHP is Load as an Apache Module
I'm blocking on the second case : PHP as an Apache Module
Please find the error, i'm facing :
Quote:
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.5M37PW
+ umask 022
+ cd /home/esedev12/rpmbuild/BUILD
+ cd php-5.2.17
+ rm -Rf /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64
+ make install INSTALL_ROOT=/home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64
Installing PHP SAPI module: apache2handler
/home/esedev12/base_apache/httpd-2.2.22_depl/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' libphp5.la /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64/home/esedev12/base_apache/httpd-2.2.22_depl/modules
/usr/lib64/apr-1/build/libtool --mode=install cp libphp5.la /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64/home/esedev12/base_apache/httpd-2.2.22_depl/modules/
libtool: install: cp .libs/libphp5.so /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64/home/esedev12/base_apache/httpd-2.2.22_depl/modules/libphp5.so
libtool: install: cp .libs/libphp5.lai /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64/home/esedev12/base_apache/httpd-2.2.22_depl/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/esedev12/rpmbuild/BUILD/php-5.2.17/libs'
chmod 755 /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64/home/esedev12/base_apache/httpd-2.2.22_depl/modules/libphp5.so
apxs:Error: Config file /home/esedev12/rpmbuild/BUILDROOT/php-5.2-17.x86_64/home/esedev12/base_apache/httpd-2.2.22_depl/conf/httpd.conf not found.
make: *** [install-sapi] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.5M37PW (%install)
|
Please find my spec file for PHP :
Quote:
%define _mytopdir /home/esedev12
%define _topdir %{_mytopdir}/rpmbuild
%define _prefix %{_mytopdir}/base_php/php-5.2.17_depl
%define _bindir %{_prefix}/bin
%define _sysconfdir %{_prefix}/etc
%define _includedir %{_prefix}/include
%define _libexecdir %{_prefix}/modules
%define _mandir %{_prefix}/man
%define _apachetopdir %{_mytopdir}/apache
%define _apacheversion 2.2.22
%define _apxs %{_apachetopdir}/bin/apxs
%define name php
%define release 17
%define version 5.2
Name: %{name}
Version: %{version}
Release: %{release}
Summary: Societe Generale PHP scripting language for creating dynamic web sites
Group: Development/Languages
Source0: %{name}-%{version}.%{release}.tar.gz
Patch0: php-5.2.17_configure.patch
License: PHP
URL: http://www.php.net/
Vendor: RESG/GTS/MKT/MDW/ACP
Packager: RESG/GTS/MKT/MDW/ACP
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd
#= %{_apacheversion}
Requires(pre): httpd
#= %{_apacheversion}
%description
PHP is an HTML-embedded scripting language. PHP attempts to make it
easy for developers to write dynamically generated web pages. PHP also
offers built-in database integration for several commercial and
non-commercial database management systems, so writing a
database-enabled webpage with PHP is fairly simple. The most common
use of PHP coding is probably as a replacement for CGI scripts.
The php package contains the module which adds support for the PHP
language to Apache HTTP Server.
%prep
%setup -q -n %{name}-%{version}.%{release}
%patch0 -p1 -b .apxs
%build
export SYSCONFDIR="/home/esedev12/apache/conf"
export LIBEXECDIR="/home/esedev12/apache/modules"
%configure \
--quiet \
--prefix=%{_prefix} \
--with-apxs2=%{_apxs} \
%ifarch %{ix86} x86_64
--with-libdir=lib64 \
%else
--with-libdir=lib \
%endif
--disable-all \
--disable-ipv6 \
--enable-bcmath \
--enable-calendar \
--enable-ctype \
--enable-debug \
--enable-dom \
--enable-filter \
--enable-fileinfo \
--enable-ftp \
--enable-hash \
--enable-libxml \
--enable-pdo \
--enable-posix \
--enable-soap \
--enable-xml \
--enable-session \
--with-curl \
--with-iconv \
--with-ldap \
--with-openssl \
--with-pcre-regex \
--with-pdo-sqlite \
--with-pear \
--with-sqlite \
--with-sqlite3 \
--with-xsl \
--with-zlib
make %{?_smp_mflags} EXTRA_CFLAGS="-Werror-implicit-function-declaration"
%install
rm -Rf %{buildroot}
make install INSTALL_ROOT=$RPM_BUILD_ROOT
%clean
rm -Rf $RPM_BUILD_ROOT
%files
%defattr(750,esedev12,esedev)
%dir %{_bindir}
%{_bindir}/php
%{_bindir}/php-cgi
%{_bindir}/php-config
%{_bindir}/phpize
%{_bindir}/pear
%{_bindir}/peardev
%{_bindir}/pecl
%defattr(750,esedev12,esedev)
%dir %{_sysconfdir}
%defattr(640,esedev12,esedev)
%{_sysconfdir}/pear.conf
%defattr(750,esedev12,esedev)
%{_libdir}/*
%defattr(750,esedev12,esedev)
%dir %{_mandir}
%dir %{_mandir}/man1
%{_mandir}/man1/php.1
%{_mandir}/man1/phpize.1
%{_mandir}/man1/php-config.1
%defattr(750,esedev12,esedev)
%{_includedir}/*
%defattr (750,esedev12,esedev)
%dir /.channels
%dir /.channels/.alias
%defattr (640,esedev12,esedev)
/.channels/.alias/pear.txt
/.channels/.alias/pecl.txt
/.channels/.alias/phpdocs.txt
/.channels/__uri.reg
/.channels/doc.php.net.reg
/.channels/pear.php.net.reg
/.channels/pecl.php.net.reg
/.depdb
/.depdblock
/.filemap
/.lock
|
Idea is to first having a PHP RPM. After every extension will be split into subpackage.
I'm currently blocked on the error. I'm building the RPM package in this way :
rpmbuild -ba -vv --dbpath $HOME/rpmdatabase php-5.2.17.spec
If you need Apache Spec file, i will provide it
Many thanks for all your help.
Regards,
Darkfiz