1

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

./configure
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
%description
PHP.What more is there to say?
%prep
yum -y install bzip2 libxml2-devel httpd-devel curl-devel php-mysql gd-devel freetds-devel mysql-devel postgresql-devel
%setup -q
%build
./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
%install
make install -j2
%clean
rm -rf $RPM_BUILD_ROOT
%post
echo " "
echo "PHP 5.3.3 installed!"
%files

1 Answer 1

4

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.

2
  • 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. Nov 12, 2010 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... Nov 13, 2010 at 7:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .