Difference between revisions of "Creating an Eprints RPM"
Line 6: | Line 6: | ||
up2date rpm-build | up2date rpm-build | ||
− | yum install | + | yum install rpm-build |
Download the Eprints source file (eprints-x.x.x.tar.gz, version 3.0.1 and above). | Download the Eprints source file (eprints-x.x.x.tar.gz, version 3.0.1 and above). | ||
Line 15: | Line 15: | ||
The RPMs should be written to /usr/src/redhat/RPMS/ and /usr/src/redhat/SRPMS/. | The RPMs should be written to /usr/src/redhat/RPMS/ and /usr/src/redhat/SRPMS/. | ||
+ | |||
+ | ==.rpmmacros== | ||
+ | |||
+ | %_signature gpg | ||
+ | %_gpg_path /root/.gnupg | ||
+ | %_gpg_name rpm.eprints.org | ||
+ | |||
+ | %_rpmdir /root/rpm.eprints.org/repo/base | ||
+ | %_srcrpmdir /root/rpm.eprints.org/repo/base/SRPMS | ||
==Signing RPMs== | ==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 http://fedoranews.org/tchung/gpg/ 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. | See http://fedoranews.org/tchung/gpg/ 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. | ||
Line 22: | Line 45: | ||
==Building a Yum repository== | ==Building a Yum repository== | ||
− | Install createrepo from http://linux.duke.edu/projects/metadata/ | + | Install createrepo from http://linux.duke.edu/projects/metadata/: |
− | |||
− | |||
− | + | yum install createrepo | |
− | |||
− | |||
− | To create the repository | + | To create the repository structure: |
createrepo . | createrepo . | ||
− | + | Copy RPMs below /base/ | |
− | + | Re-run createrepo to update the metadata. | |
− | + | ==Create a yum configuration RPM== | |
− | yum- | + | Name: rpm-eprints-org |
+ | Version: 5 | ||
+ | Release: 1 | ||
+ | Summary: rpm.eprints.org Repository Configuration | ||
+ | Group: System Environment/Base | ||
+ | License: MIT | ||
+ | URL: http://www.eprints.org/software | ||
+ | Source0: RPM-GPG-KEY-rpm-eprints-org | ||
+ | Source1: rpm-eprints-org.repo | ||
+ | BuildRoot: %{_builddir}/%{name}-%{version}-rpmroot | ||
+ | BuildArch: noarch | ||
+ | Requires: redhat-release >= %{version} | ||
+ | |||
+ | %description | ||
+ | This package installs the repository GPG and repo files for the EPrints software repository. | ||
+ | |||
+ | %prep | ||
+ | %setup -c -T | ||
+ | |||
+ | %build | ||
+ | |||
+ | %install | ||
+ | rm -rf $RPM_BUILD_ROOT | ||
+ | |||
+ | # 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 | ||
+ | |||
+ | %clean | ||
+ | rm -rf $RPM_BUILD_ROOT | ||
+ | |||
+ | %files | ||
+ | %defattr(-,root,root,-) | ||
+ | %{_sysconfdir}/pki/rpm-gpg/* | ||
+ | %config %{_sysconfdir}/yum.repos.d/* | ||
+ | |||
+ | %changelog | ||
+ | * Thu Apr 29 2010 Tim Brody <tdb2@ecs.soton.ac.uk> | ||
+ | - Spec file for installing rpm.eprints.org repository |
Revision as of 15:33, 29 April 2010
Download an appropriate EPrints Release
Creating the Eprints RPM requires root, because the process involves creating the eprints user and group.
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/.
.rpmmacros
%_signature gpg %_gpg_path /root/.gnupg %_gpg_name rpm.eprints.org %_rpmdir /root/rpm.eprints.org/repo/base %_srcrpmdir /root/rpm.eprints.org/repo/base/SRPMS
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 http://fedoranews.org/tchung/gpg/ 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.
Building a Yum repository
Install createrepo from http://linux.duke.edu/projects/metadata/:
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: rpm.eprints.org Repository Configuration Group: System Environment/Base License: MIT URL: http://www.eprints.org/software Source0: RPM-GPG-KEY-rpm-eprints-org Source1: rpm-eprints-org.repo BuildRoot: %{_builddir}/%{name}-%{version}-rpmroot BuildArch: noarch Requires: redhat-release >= %{version} %description This package installs the repository GPG and repo files for the EPrints software repository. %prep %setup -c -T %build %install rm -rf $RPM_BUILD_ROOT # 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 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{_sysconfdir}/pki/rpm-gpg/* %config %{_sysconfdir}/yum.repos.d/* %changelog * Thu Apr 29 2010 Tim Brody <tdb2@ecs.soton.ac.uk> - Spec file for installing rpm.eprints.org repository