yum repositories, was: Just some ideas for upcoming MailScanner releases

Richard Siddall richard.siddall at elirion.net
Wed Sep 5 20:43:15 IST 2007


Julian Field wrote:
> Does someone want to tell me how to set up a yum repository so you can 
> do this?
> 

It's a little more complicated than setting up "a" repository.  There
are multiple RPM-based distros (anyone want anything other than
CentOS/RHEL and SUSE?), multiple versions of said distros (anyone still
using CentOS/RHEL 4.x?), and you'll want a stable and a testing repo for
each distro version.

Having said that, it's something along these lines for each distro version:

# Build a distro-specific version of mailscanner-<version>.rpm
rpmbuild -ba mailscanner.spec # Or use your mailscanner-requires

# Build all the distro-specific RPMs, most of which won't be used.
tar zxvf MailScanner-<version>.rpm.tar.gz
cd MailScanner-<version>
./install.sh

# Copy everything up to the repo.
cp -up /usr/src/redhat/RPMs/*.rpm /var/www/html/repo/stable/

# Sign the RPMs
cd /var/www/html/repo/stable
rpm --addsign *.rpm

# Create the repo metafiles
createrepo .

# scp it to the main web server...
scp -pr /var/www/html/repo/stable jules at mailscanner.info:/...

Which isn't that bad if you've got a VPS for each distro version, or a
volunteer to maintain that version for you.

And, of course, you have to provide your PGP signing key and a repo
config file for each repo on the downloads page at
http://mailscanner.info/downloads.html

Another approach that might work would be to join RPMForge, or give Dag
Wieers (etc.) an updated mailscanner.spec or SRPM to build from. 
Offloading repo support to RPMForge (and a few other entities) would 
make your life easier in some respects.  I don't know if they operate a 
shared build farm.

I've attached a slightly updated (and not very clean) version of your
mailscanner-requires.spec, but I'd recommend merging it into the
core mailscanner-<version>.spec so you can produce a
distro-version-specific RPM with the correct dependencies for the
distro version.  For the old MailScanner-<version>.rpm.tar.gz you could 
just turn off all the dependencies by not defining a distro flag.

Regards,

	Richard Siddall

-------------- next part --------------
#
# Build with
#	rpmbuild -ba --define 'oscode 1' mailscanner-requires.spec
# Where oscode is:
#	rh6	RedHat Linux 6.x
#	fc2	Fedora Core 2
#	rhel5	RedHat Enterprise Linux 5 (and clones)
#
%define version 4.60.1
%define release 2
%define name    mailscanner-requires

Name:        %{name}
Version:     %{version}
Release:     %{release}
Summary:     E-Mail Gateway Virus Scanner and Spam Detector
Group:       System Environment/Daemons
License:   GPL
Vendor:      Electronics and Computer Science, University of Southampton
Packager:    Julian Field <mailscanner at ecs.soton.ac.uk>
URL:         http://www.mailscanner.info/
Requires:    mailscanner >= 4.60.1, perl >= 5.6.1, tnef >= 1.1.1, perl-MIME-tools >= 5.412, perl-Archive-Zip, perl-Compress-Zlib, perl-Convert-BinHex, perl-Convert-TNEF, perl-DBD-SQLite, perl-DBI, perl-Filesys-Df, perl-Getopt-Long, perl-IO-stringy, perl-HTML-Parser, perl-HTML-Tagset, perl-MailTools, perl-Net-CIDR, perl-Net-IP, perl-Sys-Hostname-Long, perl-TimeDate
#BuildRoot:   %{_tmppath}/%{name}-root
BuildArchitectures: noarch
# On some OSes, required Perl modules are built into the core Perl RPM
%{?rh6:Requires:	perl-File-Temp}
%{?rh6:Requires:	perl-MIME-Base64}
%{?rh6:Requires:	perl-Time-HiRes}
#%{?rh6:Requires:	perl-Sys-Syslog} 
#%{?fc2:Requires:	perl-File-Temp}
#%{?fc2:Requires:	perl-MIME-Base64}
%{?fc2:Requires:	perl-Time-HiRes}
#%{?fc2:Requires:	perl-Sys-Syslog} 
#%{?rhel5:Requires:	perl-File-Temp}
#%{?rhel5:Requires:	perl-MIME-Base64}
#%{?rhel5:Requires:	perl-Time-HiRes}
#%{?rhel5:Requires:	perl-Sys-Syslog} 

%description
This is an RPM that exists solely for use by 'yum' to list all the
requirements of MailScanner. If you 'yum localinstall' this package, then
yum will go and fetch all the required packages and Perl modules.
See the 'mailscanner' rpm for more information about MailScanner itself.

#%prep
#%setup
#%build
#%install
%clean
rm -rf ${RPM_BUILD_ROOT}

%files

%changelog
* Fri Jun 1 2007 Richard Siddall <richard.siddall at elirion.net>
- Started hacking up for OS-dependent dependencies.

* Thu May 24 2007 Julian Field <mailscanner at ecs.soton.ac.uk>
- Created.





More information about the MailScanner mailing list