Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%global with_python3 0
%global debug_package %{nil}

%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 %{__python}}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

Name: docker-registry
Version: 0.9.1
Release: 7%{?dist}
Summary: Registry server for Docker
License: ASL 2.0
URL: https://github.com/docker/%{name}
Source0: https://github.com/docker/%{name}/archive/%{version}.tar.gz
Source1: %{name}.service
Source2: %{name}.sysconfig
Patch0: 0001-remove-python-redis-requirement.patch
BuildRequires: python2-devel
BuildRequires: pkgconfig(systemd)
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: m2crypto
Requires: PyYAML
Requires: python-requests
Requires: python-gunicorn
Requires: python-gevent
Requires: python-blinker
Requires: python-backports >= 1.0-8
Requires: python-backports-lzma >= 0.0.2-8
Requires: python-flask
Requires: python-sqlalchemy >= 0.9.8-1

%description
Registry server for Docker (hosting/delivering of repositories and images).

%prep
%setup -qn %{name}-%{version}
%patch0 -p1

%build
# Remove the golang implementation
# It's not the main one (yet?)
rm -rf contrib/golang_impl

%install
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{python_sitelib}/%{name}
install -d %{buildroot}%{python_sitelib}/docker_registry

install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}

install -d %{buildroot}%{_unitdir}
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

# Make sure we set proper WorkingDir in the systemd service file
sed -i "s|#WORKDIR#|%{python_sitelib}/%{name}|" %{buildroot}%{_unitdir}/%{name}.service

cp -pr docker_registry %{buildroot}%{python_sitelib}/%{name}
cp -pr depends/docker-registry-core/docker_registry %{buildroot}%{python_sitelib}/
cp config/config_sample.yml %{buildroot}%{_sysconfdir}/%{name}.yml

# set storage path to /var/lib/docker-registry
sed -i 's/tmp\/registry/var\/lib\/docker-registry/g' \
%{buildroot}%{_sysconfdir}/%{name}.yml

%post
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service

%files
%doc LICENSE README.md
%{python_sitelib}/%{name}
%{python_sitelib}/docker_registry
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.yml
%{_unitdir}/%{name}.service

%changelog
* Wed Jul 08 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.9.1-7
- disable empty debuginfo package

* Wed Jul 08 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.9.1-6
- remove python-sqlalchemy subpackage, use it from extras repo

* Fri May 01 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.9.1-5
- Resolves: rhbz#1217628
- include python-sqlalchemy as a subpackage

* Mon Mar 09 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.9.1-4
- Resolves: rhbz#1171295 - update to 0.9.1
- Resolves: rhbz#1187101 - set storage path to /var/lib/docker-registry
to ensure the same storage path is looked up after update
- Don't install or own /var/lib/docker-registry

* Thu Jan 29 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-13
- use correct min NVR of python-backports
- preserver timestamps of copied files

* Wed Dec 17 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-12
- No longer noarch because python-backports isn't noarch anymore
- remove unused redis python binding patch

* Wed Dec 17 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-11
- Resolves: rhbz#1175305 - should require python-backports-lzma >= 0.0.2-8
- use systemd and not systemd-units

* Fri Nov 21 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-10
- Resolves: rhbz#1158538 - use python-backports instead of
python-backports-lzma
- remove systemd/sysvinit conditionals, only systemd used in RHEL7
- BR: pkgconfig(systemd)

* Fri Oct 24 2014 Tomas Hrcka <thrcka@redhat.com> - 0.6.8-9
- Set standalone:true in docker_registry.yml

* Tue May 06 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-8
- import lzma if no backports.lzma

* Fri May 02 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-7
- do not complain if redis absent

* Wed Apr 30 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-6
- import json if simplejson fails

* Wed Apr 30 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-5
- Add python-flask to requires

* Tue Apr 29 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-4
- remove python-simplejson runtime requirement

* Tue Apr 29 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-3
- remove redis requirement from unitfile

* Wed Apr 23 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-2
- M2Crypto branch used: https://github.com/lsm5/docker-registry/tree/m2crypto
- Built for RHEL7

* Fri Apr 18 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.8-1
- Upstream release 0.6.8

* Mon Apr 07 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.6-2
- docker-registry settings in /etc/sysconfig/docker-registry not honored,
  RHBZ#1072523

* Thu Mar 20 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.6-1
- Upstream release 0.6.6
- docker-registry cannot import module jinja2, RHBZ#1077630

* Mon Feb 17 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.5-1
- Upstream release 0.6.5

* Tue Jan 07 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.3-1
- Upstream release 0.6.3
- Added python-backports-lzma and python-rsa to R
- Removed configuration file path patch, it's in upstream

* Fri Dec 06 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-4
- Docker-registry does not currently support moving the config file, RHBZ#1038874

* Mon Dec 02 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-3
- EPEL support
- Comments in the sysconfig/docker-registry file

* Wed Nov 27 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-2
- Added license and readme

* Wed Nov 20 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-1
- Initial packaging