Open Source RPM .spec file

This is an RPM .spec file for dojo, that will install it in /opt/os/dojo



%_topdir /home/account
%_buildroot %{_topdir}/BUILD
%_tmppath %{_topdir}/tmp



%define targetdir opt/os/dojo
%define version 1.1
%define release 1
%define name dojo
%define dojo %{name}-release-%{version}.%{release}
Summary: dojo Toolkit
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: GPL
Group: Development/Tools
#Source: dojo-release-1.1.1.tar.gz
Provides: %{name}
BuildRoot: %{_buildroot}
dojo Toolkit
%setup -q -n%{dojo}
tar tzf %{_topdir}/SOURCES/%{dojo}.tar.gz | grep -v "/$" | sed "s/dojo-release-1
.1.1//"| awk '{ print "\"/%{targetdir}"$0"\""; }' > %{_topdir}/outfile
mkdir -p $RPM_BUILD_ROOT/%{targetdir}
rm -rf $RPM_BUILD_ROOT/%{targetdir}/*
%build -n%{dojo}
%install -n%{dojo}
mv * $RPM_BUILD_ROOT/%{targetdir}
%clean -n%{dojo}
%files -f %{_topdir}/outfile

The same general approach will work for Zend, Smarty, Drupal and many others. Expect to have to adapt the name of the tar/gzip/zip file - hence the use of the %{dojo} macro. The tar tzf command allows the RPM to be installed in a directory with other code. Although it is unlikely dojo would be placed in a directory with other code, the tar listing allows you to place several tars in the same directory, and still manage them with RPMS.

Source RPM:

If you use the RPM to install dojo, use a symlink (ln -s /opt/os/dojo dojo) from DocumentRoot. This will allow a single installation of dojo to support all your sites.