The source distributions include an RPM spec file that can be
used to build RPM packages for your Linux distribution. The
rpmbuild command is used to build from the tar
files:

rpmbuild -ta cups-version-source.tar.gz

or:

rpmbuild -ta cups-version-source.tar.bz2

At a minimum, you'll need the gcc, libjpeg,
libjpeg-devel, libpng, libpng-devel,
libtiff, libtiff-devel, pam-devel, zlib,
and zlib-devel packages installed to compile CUPS with all
of the standard functionality. The krb5-devel,
krb5-libs, openldap, openldap,
openslp, openslp-devel, avahi, and
avahi-devel packages will allow support for Kerberos
(CUPS 1.3.x and later only), LDAP, SLP, and DNS-SD respectively.

The spec file supports two options, --without php and
--without dbus, that control whether the PHP and DBUS
support is compiled into the packages. For example, if you are
compiling CUPS 1.2.4 or earlier on Red Hat Enterprise Linux, you
will need to provide the --without dbus option since
that distribution does not have a compatible version of the DBUS
libraries available:

rpmbuild -ta cups-version-source.tar.gz --without dbus

Similarly, if you don't have the php-devel package
installed, use the --without php option to omit the PHP
support from the generated RPMs.