645bb5b
Summary:        Fedora package repositories
645bb5b
Name:           fedora-repos
26a3771
Version:        23
b94c15e
Release:        0.2
645bb5b
License:        MIT
645bb5b
Group:          System Environment/Base
645bb5b
URL:            https://git.fedorahosted.org/cgit/fedora-repos.git/
645bb5b
# tarball is created by running make archive in the git checkout
645bb5b
Source:         %{name}-%{version}.tar.bz2
645bb5b
Provides:       fedora-repos(%{version})
645bb5b
Requires:       system-release(%{version})
645bb5b
Requires:       fedora-repos-rawhide = %{version}-%{release}
26a3771
Obsoletes:      fedora-repos-anaconda < 22-0.3
645bb5b
BuildArch:      noarch
645bb5b
645bb5b
%description
645bb5b
Fedora package repository files for yum and dnf along with gpg public keys
645bb5b
645bb5b
%package rawhide
645bb5b
Summary:        Rawhide repo definitions
645bb5b
Requires:       fedora-repos = %{version}-%{release}
26a3771
Obsoletes:      fedora-release-rawhide <= 22-0.3
645bb5b
645bb5b
%description rawhide
645bb5b
This package provides the rawhide repo definitions.
645bb5b
645bb5b
645bb5b
%prep
645bb5b
%setup -q
645bb5b
645bb5b
%build
645bb5b
645bb5b
%install
645bb5b
# Install the keys
645bb5b
install -d -m 755 $RPM_BUILD_ROOT/etc/pki/rpm-gpg
645bb5b
install -m 644 RPM-GPG-KEY* $RPM_BUILD_ROOT/etc/pki/rpm-gpg/
645bb5b
645bb5b
# Link the primary/secondary keys to arch files, according to archmap.
645bb5b
# Ex: if there's a key named RPM-GPG-KEY-fedora-19-primary, and archmap
645bb5b
#     says "fedora-19-primary: i386 x86_64",
645bb5b
#     RPM-GPG-KEY-fedora-19-{i386,x86_64} will be symlinked to that key.
645bb5b
pushd $RPM_BUILD_ROOT/etc/pki/rpm-gpg/
645bb5b
for keyfile in RPM-GPG-KEY*; do
645bb5b
    key=${keyfile#RPM-GPG-KEY-} # e.g. 'fedora-20-primary'
645bb5b
    arches=$(sed -ne "s/^${key}://p" $RPM_BUILD_DIR/%{name}-%{version}/archmap) \
645bb5b
        || echo "WARNING: no archmap entry for $key"
645bb5b
    for arch in $arches; do
645bb5b
        # replace last part with $arch (fedora-20-primary -> fedora-20-$arch)
645bb5b
        ln -s $keyfile ${keyfile%%-*}-$arch # NOTE: RPM replaces %% with %
645bb5b
    done
645bb5b
done
645bb5b
# and add symlink for compat generic location
645bb5b
ln -s RPM-GPG-KEY-fedora-%{version}-primary RPM-GPG-KEY-%{version}-fedora
645bb5b
popd
645bb5b
645bb5b
install -d -m 755 $RPM_BUILD_ROOT/etc/yum.repos.d
645bb5b
for file in fedora*repo ; do
645bb5b
  install -m 644 $file $RPM_BUILD_ROOT/etc/yum.repos.d
645bb5b
done
645bb5b
645bb5b
645bb5b
%files
645bb5b
%defattr(-,root,root,-)
645bb5b
%dir /etc/yum.repos.d
645bb5b
%config(noreplace) /etc/yum.repos.d/fedora.repo
645bb5b
%config(noreplace) /etc/yum.repos.d/fedora-updates*.repo
645bb5b
%dir /etc/pki/rpm-gpg
645bb5b
/etc/pki/rpm-gpg/*
645bb5b
645bb5b
%files rawhide
645bb5b
%defattr(-,root,root,-)
645bb5b
%config(noreplace) /etc/yum.repos.d/fedora-rawhide.repo
645bb5b
645bb5b
%changelog
b94c15e
* Wed Feb 18 2015 Dennis Gilmore <dennis@ausil.us> - 23-0.2
b94c15e
- add the Fedora 23 gpg keys
b94c15e
26a3771
* Tue Feb 10 2015 Peter Robinson <pbrobinson@fedoraproject.org> 23-0.1
26a3771
- Setup for f23 rawhide