Topic: Build rpm from php.net for Cent OS 5

Hi. I try build rpm package, but included spec file in php archive is broken.
Try use REMI spec file, but rpmbuild stop with errors.

[root@localhost ~]# rpmbuild --rebuild /usr/src/redhat/SRPMS/php-5.3.5-1.remi.src.rpm Installing /usr/src/redhat/SRPMS/php-5.3.5-1.remi.src.rpm
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
warning: user remi does not exist - using root
error: /root/rpmbuild/SPECS/php.spec:592: parseExpressionBoolean returns -1
error: Failed build dependencies:
        sqlite2-devel >= 2.8.0 is needed by php-5.3.5-1.x86_64
        xorg-x11-devel is needed by php-5.3.5-1.x86_64

Where I can get this packages?
Second question: Do I need patches that are included in the REMI spec?

Re: Build rpm from php.net for Cent OS 5

- never build as root

- warning are only warning

- don't know where you can get this package as I don't know which distro / arch you are using (but probably from the ones I use, see the documentation)

- don't know if you need the patches

- why don't you use the binary RPM provided ?

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Build rpm from php.net for Cent OS 5

I use CentOS 5.5 with EPEL repository. I want to learn how to make binaries that do not depend on third-party repositories. Because I was have experience when repository is throwing or removed needed packages from him. For begin, I just want to compile PHP from php.net in the rpm package for CentOS 5.5.

Re: Build rpm from php.net for Cent OS 5

Only repositories required for EL5 build is EPEL and remi.

But your build environment is not safe (first because root account is used).
See (sorry in french) http://doc.fedora-fr.org/wiki/RPM_:_env … nstruction

To build from .src.rpm you also  need to define one of "fedora" or "rhel" macro.
The spec file use a lot of conditional stuff which requires one of this macro to be defined.

+

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

5 (edited by NT Man 2011-01-10 15:47:32)

Re: Build rpm from php.net for Cent OS 5

I add

%rhel 5

to .rpmmacros file and resolve all new dependency.
Now exist last problem:

[mikhail@localhost ~]$ rpmbuild --rebuild php-5.3.5-1.remi.src.rpm 
Installing php-5.3.5-1.remi.src.rpm
warning: user remi does not exist - using root
* * *
warning: user remi does not exist - using root
error: Failed build dependencies:
        sqlite2-devel >= 2.8.0 is needed by php-5.3.5-1.x86_64
[mikhail@localhost ~]$ 

Where you get or how you make sqlite2-devel?
Thanks.

Re: Build rpm from php.net for Cent OS 5

sqlite2 is available in remi repository.

+

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Build rpm from php.net for Cent OS 5

sqlite2-devel depends on sqlite2.
I found this packages in your repository.
But where src.rpm for sqlite2 I found only sqlite2-2.8.17-2.fc8.remi.src.rpm and sqlite2-2.8.17-3.fc9.remi.src.rpm that means fedora 8/9 packages. How you build sqlite2 and sqlite2-devel?
Thanks.

Re: Build rpm from php.net for Cent OS 5

AS I said in post #4, my spec use a lot of conditional stuff.
With this solution I always use the same spec (an so .src.rpm) for all distro.

+

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Build rpm from php.net for Cent OS 5

Question about patches.
Do I understand correct that the php-5.3.5-1.remi.src.rpm also includes patches for older PHP versions?
For example if I need PHP 5.3.5 only, applyed only php-5.3.5-aconf26x.patch?
All other patches I can safe remove from my building directory

Re: Build rpm from php.net for Cent OS 5

Do I understand correct that the php-5.3.5-1.remi.src.rpm also includes patches for older PHP versions?

No, all patches are for current version.

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Build rpm from php.net for Cent OS 5

Thanks!
Where I can get a information what does each patch?

Re: Build rpm from php.net for Cent OS 5

Must read the patch and understand what is doing.

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi