%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: Registry server for Docker Name: docker-registry Version: 0.6.0 Release: 1%{?dist} License: ASL 2.0 URL: https://github.com/dotcloud/docker-registry Source: https://github.com/dotcloud/docker-registry/archive/%{version}.tar.gz Source1: docker-registry.service Source2: docker-registry.sysconfig BuildRequires: python2-devel BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires: python-boto Requires: python-flask Requires: PyYAML Requires: python-simplejson Requires: python-requests Requires: python-gunicorn Requires: python-gevent Requires: python-blinker Requires: python-glanceclient Requires: python-keystoneclient Requires: python-redis Requires: redis BuildArch: noarch %description Registry server for Docker (hosting/delivering of repositories and images). %prep %setup -q -n docker-registry-%{version} # Remove the golang implementation # It's not the main one (yet?) rm -rf contrib/golang_impl %install install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_unitdir} install -d %{buildroot}%{_sysconfdir} install -d %{buildroot}%{_sharedstatedir}/%{name} install -d %{buildroot}%{python_sitelib}/%{name} install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name} cp -r lib registry test %{buildroot}%{python_sitelib}/%{name} cp wsgi.py %{buildroot}%{python_sitelib}/%{name} cp config_sample.yml %{buildroot}%{_sysconfdir}/%{name}.yml echo "local: storage: local storage_path: %{_sharedstatedir}/%{name}" >> %{buildroot}%{_sysconfdir}/%{name}.yml %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %dir %{python_sitelib}/%{name} %config(noreplace) %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}.yml %{python_sitelib}/%{name}/lib/*.py %{python_sitelib}/%{name}/lib/*.pyc %{python_sitelib}/%{name}/lib/*.pyo %{python_sitelib}/%{name}/lib/storage/*.py %{python_sitelib}/%{name}/lib/storage/*.pyc %{python_sitelib}/%{name}/lib/storage/*.pyo %{python_sitelib}/%{name}/registry/*.py %{python_sitelib}/%{name}/registry/*.pyc %{python_sitelib}/%{name}/registry/*.pyo %{python_sitelib}/%{name}/test/*.py %{python_sitelib}/%{name}/test/*.pyc %{python_sitelib}/%{name}/test/*.pyo %{python_sitelib}/%{name}/*.py %{python_sitelib}/%{name}/*.pyc %{python_sitelib}/%{name}/*.pyo %{_unitdir}/%{name}.service %dir %{_sharedstatedir}/%{name} %changelog * Wed Nov 20 2013 Marek Goldmann - 0.6.0-1 - Initial packaging