1 (edited by darkfiz 2012-07-27 21:42:50)

Topic: PHP Rpm and Apxs

Hi,

I d'like to build a custom RPM for PHP but i'm facing an error at the install stage of the build
apxs is not able to found httpd.conf file in the RPM_ROOTBUILD_DIR/%{prefix}
Can someone help me please ? I can provide SPEC file for Httpd and Php.
I'm sorry to give no so much detail, but i have spend two evening trying to post something detailled
but i get an error about too more link

Darkfiz

Re: PHP Rpm and Apxs

Not enough information to help.

Why do you need a "custom" build ?
Which spec file did you use as a model ?

Laptop:  Fedora 40 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: AlmaLinux 8 with EPEL, rpmfusion, remi

Re: PHP Rpm and Apxs

Hi,

I'm always facing an error when trying to paste the error i'm facing.
==> Too more links in message. Allowed 1 links. Reduce number of links and post it again.
Is there a way to attach text file to send you the error and the spec file ?

I have build my custom SPEC file for both PHP and Apache.
My goal is to have my own rpm database in user land mode.
Regards,

Darkfiz

Re: PHP Rpm and Apxs

You can try to change the links so that they are not clickable.
I.e. change http > hxxp
Or www > xxx or similar...

Re: PHP Rpm and Apxs

Hi,

Sorry for not responding earlier. Please find the error i'm facing :
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
Installing PHP SAPI module: apache2handler
/home/esedev12/base_apache/hxxpd-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/hxxpd-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/hxxpd-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/hxxpd-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/hxxpd-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/hxxpd-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/hxxpd-2.2.22_depl/conf/hxxpd.conf not found.
make: *** [install-sapi] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.5M37PW (%install)
Regards,

Darkfiz

6 (edited by darkfiz 2012-08-02 08:49:40)

Re: PHP Rpm and Apxs

Hi,

Please find the spec file i have written.

%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: Darkfiz
Packager: Darkfiz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: hxxpd

%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

Regards,

Darkfiz