[CentOS] How to handle updates after rebuilding PHP?

Tue Apr 29 10:10:27 UTC 2008
John <jses27 at gmail.com>

-----Original Message-----
From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On Behalf
Of Niki Kovacs
Sent: Tuesday, April 29, 2008 5:02 AM
To: centos at centos.org
Subject: [CentOS] How to handle updates after rebuilding PHP?


One of our applications has some very specific requirements regarding PHP,
so I had to rebuild it to add some functionality that's not included in the
default configuration.

First thing I removed every PHP-related package that was installed on the

# yum remove `rpm -qa | grep php`

Then I downloaded the PHP SRPM from
http://mirror.centos.org/centos/5.1/os/SRPMS/ and installed it.

Next I installed all the build dependencies using yum-builddep.

I edited php.spec according to my needs and then built PHP:

# rpmbuild -bb --clean php.spec

Finally, I installed the resulting packages using 'rpm -ivh', in that order:

- php-common
- php-cli
- php
- php-ldap

Problem: when I run 'yum check-update', Yum wants to update these php
packages immediately, with some packages coming from [base] (not from
[updates]). I'm puzzled, because PHP is not in [updates], only in [base].

Now I know I could simply add a line to /etc/yum.conf, something like:


But I *do* want to be notified somehow in case there's an update to PHP, so
I can download the new SRPM from the updates/ directory and then rebuild it

Any suggestions about this?


PS: on my desktop I use Arch Linux, where I have some individually rebuilt
packages. When I do this, I simply increase the build number, so my packages
don't get squashed, but I get an update notification when a new version is
available. Maybe this is the way to go, but I don't know how I would do this
with RPM.
I think Yum is doing what is called replacing the package because it thinks
it is not a centos built rpm. This does infact happen if when RHEL OS is
pointed to use and update from the centos repo. Even the base packages get
replaced with the centos one even though they are the same build binary and
by version number.

Maybe an option for updated source rpms is point yum to the sources repo
instead of binary. Optionally you could specify wget with the file list
option to fetch the named src.rpm new version then attach that to a cron
job. Maybe someone else has an easier way of doing this?

John Stanley

CentOS mailing list
CentOS at centos.org