Creating an Eprints RPM

From EPrints Documentation
Jump to: navigation, search

Download an appropriate EPrints Release

Most of this page assumes you are running as the root user, which is because we run our package building on virtual machines. You probably want to use a non-root user if you are on a shared machine.

Install rpm-build (depending on your package manager):

up2date rpm-build
yum install rpm-build

Download the Eprints source file (eprints-x.x.x.tar.gz, version 3.0.1 and above).

Create the RPM and source RPMs (will error if there are any missing dependencies):

rpmbuild -ta eprints-x.x.x.tar.gz

The RPMs should be written to /usr/src/redhat/RPMS/ and /usr/src/redhat/SRPMS/.


%_signature     gpg
%_gpg_path      /root/.gnupg

%_rpmdir        /root/
%_srcrpmdir     /root/

Signing RPMs

Install GPG if not already:

yum install gnupg

Create a personal key:

gpg --gen-key

Add the key name to .rpmmacros.

Sign one or more RPM packages:

rpm --resign xxx.rpm

See for how to create a GPG key pair and signing an RPM. To avoid key warnings when using up2date or Yum all RPMs need to be signed, and the public key imported into the local system.

Exporting the GPG key(s)

Exporting the public key (publish this somewhere):

gpg --export -a my-key-name > RPM-GPG-KEY-my-key-name

Exporting the private key (keep this somewhere safe):

gpg --export-secret-key -a my-key-name > my-key-name.key

Building a Yum repository

Install createrepo from

yum install createrepo

To create the repository structure:

createrepo .

Copy RPMs below /base/

Re-run createrepo to update the metadata.

Create a yum configuration RPM

Name:           rpm-eprints-org
Version:        5
Release:        1
Summary: Repository Configuration
Group:          System Environment/Base
License:        MIT
Source0:        RPM-GPG-KEY-rpm-eprints-org
Source1:        rpm-eprints-org.repo
BuildRoot:      %{_builddir}/%{name}-%{version}-rpmroot
BuildArch:      noarch
Requires:       redhat-release >= %{version}  

This package installs the repository GPG and repo files for the EPrints software repository.

%setup -c -T



# gpg
install -Dpm 644 %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-rpm-eprints-org

# yum
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d


%config %{_sysconfdir}/yum.repos.d/*

* Thu Apr 29 2010 Tim Brody <>
- Spec file for installing repository