From 61bb8986704454c854b150fb63287c5a46b513d5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 02:11:06 +0000 Subject: import docker-registry-0.6.8-13.el7 --- diff --git a/SOURCES/Support-for-older-Redis-Python-binding.patch b/SOURCES/Support-for-older-Redis-Python-binding.patch deleted file mode 100644 index 60a8db8..0000000 --- a/SOURCES/Support-for-older-Redis-Python-binding.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8167153cc069eacd041b0b0d6bb19150f291d881 Mon Sep 17 00:00:00 2001 -From: Marek Goldmann -Date: Thu, 21 Nov 2013 11:12:22 +0100 -Subject: [PATCH] Support for older Redis Python binding - ---- - lib/cache.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/cache.py b/lib/cache.py -index 4b0f93d..534eb55 100644 ---- a/lib/cache.py -+++ b/lib/cache.py -@@ -29,7 +29,7 @@ def init(): - for k, v in cache.iteritems(): - redis_opts[k] = v - logging.info('Redis config: {0}'.format(redis_opts)) -- redis_conn = redis.StrictRedis(host=redis_opts['host'], -+ redis_conn = redis.Redis(host=redis_opts['host'], - port=int(redis_opts['port']), - db=int(redis_opts['db']), - password=redis_opts['password']) --- -1.8.5.3 - diff --git a/SOURCES/docker-registry.sysvinit b/SOURCES/docker-registry.sysvinit deleted file mode 100644 index 832a933..0000000 --- a/SOURCES/docker-registry.sysvinit +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# -# /etc/rc.d/init.d/docker-registry -# -# Registry server for Docker -# -# chkconfig: 2345 93 93 -# description: Registry server for Docker - -### BEGIN INIT INFO -# Provides: docker-registry -# Required-Start: $network -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop Docker registry -# Description: Registry server for Docker -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec="/usr/bin/python" -prog="docker-registry" -pidfile="/var/run/$prog.pid" -lockfile="/var/lock/subsys/$prog" -logfile="/var/log/$prog" - -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -export DOCKER_REGISTRY_CONFIG=${DOCKER_REGISTRY_CONFIG:-"/etc/docker-registry.yml"} -export SETTINGS_FLAVOR=${SETTINGS_FLAVOR:-"dev"} - -start() { - [ -x $exec ] || exit 5 - - if ! [ -f $pidfile ]; then - cd #WORKDIR# - printf "Starting $prog:\t" - $exec /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b ${REGISTRY_ADDRESS}:${REGISTRY_PORT} -w $GUNICORN_WORKERS wsgi:application &>> $logfile & - pid=$! - echo $pid > $pidfile - touch $lockfile - success - echo - else - failure - echo - printf "$pidfile still exists...\n" - exit 7 - fi -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p $pidfile $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - status -p $pidfile $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac - -exit $? diff --git a/SPECS/docker-registry.spec b/SPECS/docker-registry.spec index 2791fe1..e4763e0 100644 --- a/SPECS/docker-registry.spec +++ b/SPECS/docker-registry.spec @@ -1,65 +1,46 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 -%bcond_without systemd -%endif - %global commit 097381d336017ba772dffd439e316120b639ffbd %global shortcommit %(c=%{commit}; echo ${c:0:7}) -Summary: Registry server for Docker -Name: docker-registry -Version: 0.6.8 -Release: 8%{?dist} -License: ASL 2.0 -URL: https://github.com/dotcloud/docker-registry -Source: https://github.com/lsm5/docker-registry/archive/%{commit}/docker-registry-%{shortcommit}.tar.gz -Source1: docker-registry.service -Source2: docker-registry.sysconfig -Source3: docker-registry.sysvinit - -# Support for older Redis Python binding in EPEL -Patch0: Support-for-older-Redis-Python-binding.patch +Summary: Registry server for Docker +Name: docker-registry +Version: 0.6.8 +Release: 13%{?dist} +License: ASL 2.0 +URL: https://github.com/dotcloud/docker-registry +Source: https://github.com/lsm5/docker-registry/archive/%{commit}/docker-registry-%{shortcommit}.tar.gz +Source1: %{name}.service +Source2: %{name}.sysconfig -BuildRequires: python2-devel +BuildRequires: python2-devel +BuildRequires: pkgconfig(systemd) -%if %{with systemd} -BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd -%else -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(postun): initscripts -%endif - -Requires: m2crypto -Requires: PyYAML -Requires: python-requests -Requires: python-gunicorn -Requires: python-gevent -Requires: python-blinker -Requires: python-backports-lzma -Requires: python-jinja2 -Requires: python-flask - -BuildArch: noarch + +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-jinja2 +Requires: python-flask %description Registry server for Docker (hosting/delivering of repositories and images). %prep -%setup -q -n docker-registry-%{commit} +%setup -qn docker-registry-%{commit} # Remove the golang implementation # It's not the main one (yet?) rm -rf contrib/golang_impl -%if !%{with systemd} -%patch0 -p1 -%endif - %install install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_sysconfdir}/sysconfig @@ -68,21 +49,13 @@ install -d %{buildroot}%{python_sitelib}/%{name} install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} -%if %{with systemd} 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 -%else -install -d %{buildroot}%{_initddir} -install -p -m 755 %{SOURCE3} %{buildroot}%{_initddir}/%{name} -# Make sure we set proper wrking dir in the sysvinit file -sed -i "s|#WORKDIR#|%{python_sitelib}/%{name}|" %{buildroot}%{_initddir}/%{name} -%endif - -cp -r docker_registry test %{buildroot}%{python_sitelib}/%{name} +cp -pr docker_registry test %{buildroot}%{python_sitelib}/%{name} #cp wsgi.py %{buildroot}%{python_sitelib}/%{name} cp config/config_sample.yml %{buildroot}%{_sysconfdir}/%{name}.yml @@ -90,34 +63,22 @@ echo "local: storage: local storage_path: %{_sharedstatedir}/%{name}" >> %{buildroot}%{_sysconfdir}/%{name}.yml +#do not authenticate with docker hub by default +sed -i 's/common:/common:\n standalone: true/' %{buildroot}%{_sysconfdir}/%{name}.yml + %post -%if %{with systemd} %systemd_post %{name}.service -%else -/sbin/chkconfig --add %{name} -%endif %preun -%if %{with systemd} %systemd_preun %{name}.service -%else -if [ $1 -eq 0 ] ; then - /sbin/service %{name} stop >/dev/null 2>&1 - /sbin/chkconfig --del %{name} -fi -%endif %postun -%if %{with systemd} %systemd_postun_with_restart %{name}.service -%else -if [ "$1" -ge "1" ] ; then - /sbin/service %{name} condrestart >/dev/null 2>&1 || : -fi -%endif %files +%doc LICENSE README.md %dir %{python_sitelib}/%{name} +%dir %{_sharedstatedir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/%{name}.yml %{python_sitelib}/%{name}/docker_registry/*.py @@ -140,15 +101,30 @@ fi %{python_sitelib}/%{name}/test/utils/*.py %{python_sitelib}/%{name}/test/utils/*.pyc %{python_sitelib}/%{name}/test/utils/*.pyo -%dir %{_sharedstatedir}/%{name} -%doc LICENSE README.md -%if %{with systemd} %{_unitdir}/%{name}.service -%else -%{_initddir}/%{name} -%endif %changelog +* Thu Jan 29 2015 Lokesh Mandvekar - 0.6.8-13 +- use correct min NVR of python-backports +- preserver timestamps of copied files + +* Wed Dec 17 2014 Lokesh Mandvekar - 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 - 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 - 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 - 0.6.8-9 +- Set standalone:true in docker_registry.yml + * Tue May 06 2014 Lokesh Mandvekar - 0.6.8-8 - import lzma if no backports.lzma