I am trying to compile my own RPM packages of some various existing software. Most of this software is normally installed by doing

make install

I followed a tutorial here and attempted to adapt things: http://www.lamolabs.org/blog/164/centos-rpm-tutorial-1/

I am assuming for the build step in this SPEC I just run a ./configure and make, and for the install step in the SPEC I just run make install. I wanted to confirm this is correct? (currently waiting a long time for a compile)

I also wanted to check, if one desires to update a custom RPM in the future do I have to do anything special to cover updating/removal for an RPM? Is this managed for me?

Addition: The builds are failing with an error: find: /var/tmp/php-buildroot: No such file or directory

My build tree is in ~/rpmbuild/

The following is a sample spec I tried for PHP

Summary: x86 PHP Package
Name: php
Version: 5.3.3
Release: 1
Source0: php-5.3.3.tar.gz
License: GPL
Group: Language
BuildArch: i386
BuildRoot: %{_tmppath}/%{name}-buildroot
PHP.What more is there to say?
yum -y install bzip2 libxml2-devel httpd-devel curl-devel php-mysql gd-devel freetds-devel mysql-devel postgresql-devel
%setup -q
./configure --with-apxs2=/usr/sbin/apxs --with-mysql --with-pgsql --with-mssql=/usr --prefix=/usr/local/php5 --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-ldap --with-curl --with-gd --disable-ereg --disable-fileinfo --disable-phar
make install -j2
echo " "
echo "PHP 5.3.3 installed!"

You should not be running ./configure directly (use the %configure macro instead), and you should not be building as root since mistakes in the spec file (as you have) can damage the system.

  • But if I run configure via the macro how would I pass in the configure parameters? I've read some installs require root privleges to be created. I've run into some permission issues running as a restricted user. I am running this inside a dev VM so if I blow it up I can always restore a snapshot or start fresh. – Joshua Enfield Nov 12 '10 at 16:53
  • 1
    You add the parameters after the macro. Installation when generating a package doesn't require root since it installs into the buildroot. Or it would if you used %configure... – Ignacio Vazquez-Abrams Nov 13 '10 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.