Blame SPECS/docker-registry.spec

da6803
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
da6803
da6803
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
da6803
%bcond_without  systemd
da6803
%endif
da6803
da6803
%global commit 097381d336017ba772dffd439e316120b639ffbd
da6803
%global shortcommit %(c=%{commit}; echo ${c:0:7})
da6803
da6803
Summary:        Registry server for Docker
da6803
Name:           docker-registry
da6803
Version:        0.6.8
da6803
Release:        8%{?dist}
da6803
License:        ASL 2.0
da6803
URL:            https://github.com/dotcloud/docker-registry
da6803
Source:         https://github.com/lsm5/docker-registry/archive/%{commit}/docker-registry-%{shortcommit}.tar.gz
da6803
Source1:        docker-registry.service
da6803
Source2:        docker-registry.sysconfig
da6803
Source3:        docker-registry.sysvinit
da6803
da6803
# Support for older Redis Python binding in EPEL
da6803
Patch0:         Support-for-older-Redis-Python-binding.patch
da6803
da6803
BuildRequires:    python2-devel
da6803
da6803
%if %{with systemd}
da6803
BuildRequires:      systemd
da6803
Requires(post):     systemd
da6803
Requires(preun):    systemd
da6803
Requires(postun):   systemd
da6803
%else
da6803
Requires(post):     chkconfig
da6803
Requires(preun):    chkconfig
da6803
Requires(postun):   initscripts
da6803
%endif
da6803
da6803
Requires:       m2crypto
da6803
Requires:       PyYAML
da6803
Requires:       python-requests
da6803
Requires:       python-gunicorn
da6803
Requires:       python-gevent
da6803
Requires:       python-blinker
da6803
Requires:       python-backports-lzma
da6803
Requires:       python-jinja2
da6803
Requires:       python-flask
da6803
da6803
BuildArch:      noarch
da6803
da6803
%description
da6803
Registry server for Docker (hosting/delivering of repositories and images).
da6803
da6803
%prep
da6803
%setup -q -n docker-registry-%{commit}
da6803
da6803
# Remove the golang implementation
da6803
# It's not the main one (yet?)
da6803
rm -rf contrib/golang_impl
da6803
da6803
%if !%{with systemd}
da6803
%patch0 -p1
da6803
%endif
da6803
da6803
%install
da6803
install -d %{buildroot}%{_bindir}
da6803
install -d %{buildroot}%{_sysconfdir}/sysconfig
da6803
install -d %{buildroot}%{_sharedstatedir}/%{name}
da6803
install -d %{buildroot}%{python_sitelib}/%{name}
da6803
da6803
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
da6803
da6803
%if %{with systemd}
da6803
install -d %{buildroot}%{_unitdir}
da6803
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
da6803
da6803
# Make sure we set proper WorkingDir in the systemd service file
da6803
sed -i "s|#WORKDIR#|%{python_sitelib}/%{name}|" %{buildroot}%{_unitdir}/%{name}.service
da6803
%else
da6803
install -d %{buildroot}%{_initddir}
da6803
install -p -m 755 %{SOURCE3} %{buildroot}%{_initddir}/%{name}
da6803
da6803
# Make sure we set proper wrking dir in the sysvinit file
da6803
sed -i "s|#WORKDIR#|%{python_sitelib}/%{name}|" %{buildroot}%{_initddir}/%{name}
da6803
%endif
da6803
da6803
cp -r docker_registry test %{buildroot}%{python_sitelib}/%{name}
da6803
#cp wsgi.py %{buildroot}%{python_sitelib}/%{name}
da6803
cp config/config_sample.yml %{buildroot}%{_sysconfdir}/%{name}.yml
da6803
da6803
echo "local:
da6803
    storage: local
da6803
    storage_path: %{_sharedstatedir}/%{name}" >> %{buildroot}%{_sysconfdir}/%{name}.yml
da6803
da6803
%post
da6803
%if %{with systemd}
da6803
%systemd_post %{name}.service
da6803
%else
da6803
/sbin/chkconfig --add %{name}
da6803
%endif
da6803
da6803
%preun
da6803
%if %{with systemd}
da6803
%systemd_preun %{name}.service
da6803
%else
da6803
if [ $1 -eq 0 ] ; then
da6803
    /sbin/service %{name} stop >/dev/null 2>&1
da6803
    /sbin/chkconfig --del %{name}
da6803
fi
da6803
%endif
da6803
da6803
%postun
da6803
%if %{with systemd}
da6803
%systemd_postun_with_restart %{name}.service
da6803
%else
da6803
if [ "$1" -ge "1" ] ; then
da6803
    /sbin/service %{name} condrestart >/dev/null 2>&1 || :
da6803
fi
da6803
%endif
da6803
da6803
%files
da6803
%dir %{python_sitelib}/%{name}
da6803
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
da6803
%config(noreplace) %{_sysconfdir}/%{name}.yml
da6803
%{python_sitelib}/%{name}/docker_registry/*.py
da6803
%{python_sitelib}/%{name}/docker_registry/*.pyc
da6803
%{python_sitelib}/%{name}/docker_registry/*.pyo
da6803
%{python_sitelib}/%{name}/docker_registry/lib/*.py
da6803
%{python_sitelib}/%{name}/docker_registry/lib/*.pyc
da6803
%{python_sitelib}/%{name}/docker_registry/lib/*.pyo
da6803
%{python_sitelib}/%{name}/docker_registry/lib/index/*.py
da6803
%{python_sitelib}/%{name}/docker_registry/lib/index/*.pyc
da6803
%{python_sitelib}/%{name}/docker_registry/lib/index/*.pyo
da6803
%{python_sitelib}/%{name}/docker_registry/storage/*.py
da6803
%{python_sitelib}/%{name}/docker_registry/storage/*.pyc
da6803
%{python_sitelib}/%{name}/docker_registry/storage/*.pyo
da6803
%{python_sitelib}/%{name}/test/*.py
da6803
%{python_sitelib}/%{name}/test/*.pyc
da6803
%{python_sitelib}/%{name}/test/*.pyo
da6803
%{python_sitelib}/%{name}/test/Dockerfile
da6803
%{python_sitelib}/%{name}/test/dockertest.sh
da6803
%{python_sitelib}/%{name}/test/utils/*.py
da6803
%{python_sitelib}/%{name}/test/utils/*.pyc
da6803
%{python_sitelib}/%{name}/test/utils/*.pyo
da6803
%dir %{_sharedstatedir}/%{name}
da6803
%doc LICENSE README.md
da6803
%if %{with systemd}
da6803
%{_unitdir}/%{name}.service
da6803
%else
da6803
%{_initddir}/%{name}
da6803
%endif
da6803
da6803
%changelog
da6803
* Tue May 06 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-8
da6803
- import lzma if no backports.lzma
da6803
da6803
* Fri May 02 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-7
da6803
- do not complain if redis absent
da6803
da6803
* Wed Apr 30 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-6
da6803
- import json if simplejson fails
da6803
da6803
* Wed Apr 30 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-5
da6803
- Add python-flask to requires
da6803
da6803
* Tue Apr 29 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-4
da6803
- remove python-simplejson runtime requirement
da6803
da6803
* Tue Apr 29 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-3
da6803
- remove redis requirement from unitfile
da6803
da6803
* Wed Apr 23 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.6.8-2
da6803
- M2Crypto branch used: https://github.com/lsm5/docker-registry/tree/m2crypto
da6803
- Built for RHEL7
da6803
da6803
* Fri Apr 18 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.8-1
da6803
- Upstream release 0.6.8
da6803
da6803
* Mon Apr 07 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.6-2
da6803
- docker-registry settings in /etc/sysconfig/docker-registry not honored,
da6803
  RHBZ#1072523
da6803
da6803
* Thu Mar 20 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.6-1
da6803
- Upstream release 0.6.6
da6803
- docker-registry cannot import module jinja2, RHBZ#1077630
da6803
da6803
* Mon Feb 17 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.5-1
da6803
- Upstream release 0.6.5
da6803
da6803
* Tue Jan 07 2014 Marek Goldmann <mgoldman@redhat.com> - 0.6.3-1
da6803
- Upstream release 0.6.3
da6803
- Added python-backports-lzma and python-rsa to R
da6803
- Removed configuration file path patch, it's in upstream
da6803
da6803
* Fri Dec 06 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-4
da6803
- Docker-registry does not currently support moving the config file, RHBZ#1038874
da6803
da6803
* Mon Dec 02 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-3
da6803
- EPEL support
da6803
- Comments in the sysconfig/docker-registry file
da6803
da6803
* Wed Nov 27 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-2
da6803
- Added license and readme
da6803
da6803
* Wed Nov 20 2013 Marek Goldmann <mgoldman@redhat.com> - 0.6.0-1
da6803
- Initial packaging
da6803