Solution: Creating rpm packages

Description

You might want to create custom rpm packages of your own supported eZ publish requirements.

As many distributions have poor support for PHP 4.4 branch (atm) many users find themselves installing their own software to provide PHP 4.4 or greater.

Examples

Examples of software possibly worth packaging for production server software management.

  • eZ
  • PHP
  • Apache
  • MySQL

Commands

No command summary provided at this time.

The basic process is as follows

  • Create spec file
  • Build rpm and srpm
  • Install PHP

Create PHP4.4.6 RPM

Create Spec File

root@lotta:~/> vim /usr/src/packages/SPECS/.spec

Build rpm and srpm

root@lotta:~/> cd /usr/src/packages/BUILD
root@lotta:/usr/src/packages/BUILD> rpmbuild -ba .spec

Install PHP rpm

root@lotta:~/> rpm -i /usr/src/packages/RPMS/i586/php-4.4.6-1.i586.rpm

Example Spec Files

Create PHP4.4.6 RPM for Suse Linux Enterprise Server 10

Paste this into the file /usr/src/packages/SPECS/.spec

%define name php
%define version 4.4.6
%define release 1
%define _prefix /usr
%define var --with-apxs2=/usr/sbin/apxs2-prefork --with-gd --with-t1lib --with-jpeg-dir --with-png-dir --with-zlib-dir --with-ttf --with-freetype-dir --with-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --enable-bcmath --enable-calendar --with-curl --with-dom --with-xmlrpc --enable-ftp --with-iconv --with-gettext --enable-mbstring --with-mcrypt --with-mhash --enable-sockets

Summary: PHP is a server-side scripting language for creating dynamic Web pages
Name: %{name}
Version: %{version}
Release: %{release}
Source: http://no.php.net/distributions/%{name}-%{version}.tar.gz
Vendor: The PHP Group
URL: http://www.php.net/
License: The PHP License
Group: System Environment/Libraries
Prefix: != %{_prefix}
BuildRoot: /tmp/%{name}-buildroot


%files
/bin
/include
/lib
/etc
/man
%defattr(-,root,root)

%description
PHP is a server-side scripting language for creating dynamic Web pages.

%prep
%setup -q

%build
echo %{_prefix}
./configure --prefix=$RPM_BUILD_ROOT %{var}
make

%install
rm -rf $RPM_BUILD_ROOT
make ROOT="$RPM_BUILD_ROOT" install

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Thu Mar 6 2007 Kim Johansen <[email protected]>
- First draft of the spec file

Create PHP4.4.6 RPM for CentOS 4.4

Paste this into the file /usr/src/packages/SPECS/.spec

%define name php
%define version 4.4.6
%define release 1
%define _prefix /usr
%define var --with-apxs2=/usr/sbin/apxs --with-gd --with-t1lib --with-jpeg-dir --with-pn\
g-dir --with-zlib-dir --with-ttf=/usr/include/freetype1 --with-freetype-dir=/usr/include/freetype2 --with\
-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --enable-bcmath --enable-calendar --with-curl --with-d\
om --with-xmlrpc --enable-ftp --with-iconv --with-gettext --enable-mbstring --with-mcrypt --with-mhash --\
enable-sockets

Summary: PHP is a server-side scripting language for creating dynamic Web pages
Name: %{name}
Version: %{version}
Release: %{release}
Source: http://no.php.net/distributions/%{name}-%{version}.tar.gz
Vendor: The PHP Group
URL: http://www.php.net/
License: The PHP License
Group: System Environment/Libraries
Prefix: != %{_prefix}
BuildRoot: /tmp/%{name}-buildroot


%files
/bin
/include
/lib
/etc
/man
%defattr(-,root,root)

%description
PHP is a server-side scripting language for creating dynamic Web pages.

%prep
%setup -q

%build
echo %{_prefix}
./configure --prefix=$RPM_BUILD_ROOT %{var}
make

%install
rm -rf $RPM_BUILD_ROOT
make ROOT="$RPM_BUILD_ROOT" install

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Thu Mar 9 2007 Graham Brookins <[email protected]>
- First draft of the spec file

External reference