commit d9473a22c4e6f96a0a771070a4e0fd4737480c7d Author: Jacek Konieczny <j.koniec...@eggsoft.pl> Date: Tue Nov 17 10:02:19 2015 +0100
Version: 3.1.19, many updates - up to 3.1.19 - outdated init scripts removed (Celery is useful without them) - Python3 support added - api documentation added amqp-objects.inv | Bin 0 -> 2436 bytes celery.tmpfiles | 1 - celeryd.init | 131 ---------------------------- celeryd.sysconfig | 25 ------ cyme-objects.inv | Bin 0 -> 4203 bytes djcelery-objects.inv | Bin 0 -> 1123 bytes intersphinx.patch | 20 +++++ kombu-objects.inv | Bin 0 -> 10616 bytes python-celery.spec | 231 +++++++++++++++++++++++++++++++++++--------------- python-objects.inv | Bin 0 -> 131706 bytes pytz_dependency.patch | 8 ++ unittest2.patch | 7 ++ 12 files changed, 197 insertions(+), 226 deletions(-) --- diff --git a/python-celery.spec b/python-celery.spec index 5ed6940..fad2fb7 100644 --- a/python-celery.spec +++ b/python-celery.spec @@ -1,28 +1,58 @@ + +# TODO: +# - consider init script / systemd job (uid/gid celery 274 used to be used) +# NOTE: this must not be included and enabled by default in the default +# package! Real-life deployments will mostly be application-specific. + +# Conditional build: +%bcond_without doc # don't build doc +%bcond_with tests # run tests (broken) +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module +%bcond_without python3_default # Use Python 3.x for celery executables + +%if %{without python3} +%undefine python3_default +%endif + %define module celery -Summary: Distributed Task Query +Summary: Celery - Distributed Task Query Name: python-%{module} -Version: 2.5.1 -Release: 0.4 +Version: 3.1.19 +Release: 0.1 License: BSD-like Group: Development/Languages/Python Source0: http://pypi.python.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz -# Source0-md5: c0912f29b69929219b353c748e0bf936 -Source1: celeryd.sysconfig -Source2: celeryd.init -Source3: celery.tmpfiles +# Source0-md5: fba8c4b269814dc6dbc36abb0e66c384 +Source1: amqp-objects.inv +Source2: cyme-objects.inv +Source3: djcelery-objects.inv +Source4: kombu-objects.inv +Source5: python-objects.inv +Patch0: pytz_dependency.patch +Patch1: unittest2.patch +Patch2: intersphinx.patch URL: http://celeryproject.org/ -BuildRequires: python-distribute BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.228 -Requires: python-amqplib -Requires: python-anyjson >= 0.3.1 -Requires: python-dateutil >= 1.5 -Requires: python-dateutil < 2.0.0 -Requires(post,preun): /sbin/chkconfig -Requires: python-kombu >= 2.1.1 -Requires: python-modules -Requires: rc-scripts -Provides: user(celery) +BuildRequires: rpmbuild(macros) >= 1.612 +BuildRequires: sed >= 4.0 +%if %{with python2} +BuildRequires: python-setuptools +%if %{with tests} +BuildRequires: python-mock >= 1.0.1 +BuildRequires: python-modules >= 1:2.7 +BuildRequires: python-nose +%endif +%endif +%if %{with python3} +BuildRequires: python3-setuptools +%if %{with tests} +BuildRequires: python3-nose +%endif +%endif +Requires: python-billiard >= 3.3.0.21 +Requires: python-kombu >= 3.0.29 +Requires: python-pytz BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -31,72 +61,135 @@ Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well. +%package -n python3-%{module} +Summary: Celery - Distributed Task Query +Group: Development/Languages/Python +Requires: python3-billiard >= 3.3.0.21 +Requires: python3-billiard < 3.4 +Requires: python3-kombu >= 3.0.29 +Requires: python3-kombu < 3.1 +Requires: python3-pytz + +%description -n python3-%{module} +Celery is an asynchronous task queue/job queue based on distributed +message passing. It is focused on real-time operation, but supports +scheduling as well. + +%package -n celery +Summary: Celery - Distributed Task Query +Group: Development/Languages/Python +%if %{with python3_default} +Requires: python3-%{module} = %{version} +%else +Requires: python-%{module} = %{version} +%endif + +%description -n celery +Celery is an asynchronous task queue/job queue based on distributed +message passing. It is focused on real-time operation, but supports +scheduling as well. + +%package apidocs +Summary: %{module} API documentation +Summary(pl.UTF-8): Dokumentacja API %{module} +Group: Documentation + +%description apidocs +API documentation for %{module}. + +%description apidocs -l pl.UTF-8 +Dokumentacja API %{module}. + %prep %setup -q -n %{module}-%{version} -%build -%{__python} setup.py build +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 -%install -rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install \ - --skip-build \ - --optimize=2 \ - --root=$RPM_BUILD_ROOT - -install -d $RPM_BUILD_ROOT%{_localstatedir}/run/celery -install -d $RPM_BUILD_ROOT/var/log{,/archive}/celery -install -D %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/celery.conf -install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} +cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} docs -install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/celeryd -install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/celeryd +%build +%if %{with python2} +%{__python} setup.py build --build-base build-2 %{?with_tests:test} -%py_postclean +%if %{with doc} +cd docs +PYTHONPATH=../build-2/lib %{__make} -j1 html +rm -rf .build/html/_sources +cd .. +%endif +%endif +%if %{with python3} +%{__python3} setup.py build --build-base build-3 %{?with_tests:test} +%endif -%clean +%install rm -rf $RPM_BUILD_ROOT -%pre -%groupadd -g 274 celery -%useradd -u 274 -g celery -r -s /bin/false "Celery Daemon" celery +install_python2() { + %{__python} setup.py \ + build --build-base build-2 \ + install --skip-build \ + --optimize=2 \ + --root=$RPM_BUILD_ROOT -%post -/sbin/chkconfig --add celeryd -%service celeryd restart + %py_postclean +} +install_python3() { + %{__python3} setup.py \ + build --build-base build-3 \ + install --skip-build \ + --optimize=2 \ + --root=$RPM_BUILD_ROOT +} -%preun -if [ "$1" = "0" ]; then - %service -q celeryd stop - /sbin/chkconfig --del celeryd -fi +# install the right executables last +%if %{with python3} && %{without python3_default} +install_python3 +%endif +%if %{with python2} +install_python2 +%endif +%if %{with python3} && %{with python3_default} +install_python3 +%endif -%postun -if [ "$1" = "0" ]; then - %userremove celery - %groupremove celery -fi +%if %{with python2} +install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} +cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} +find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \ + | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' +%endif +%if %{with python3} +install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} +cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} +find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ + | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' +%endif + +%clean +rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc AUTHORS Changelog FAQ README THANKS TODO -%attr(755,root,root) %{_bindir}/camqadm -%attr(755,root,root) %{_bindir}/celerybeat -%attr(755,root,root) %{_bindir}/celeryctl -%attr(755,root,root) %{_bindir}/celeryd -%attr(755,root,root) %{_bindir}/celeryd-multi -%attr(755,root,root) %{_bindir}/celeryev - -%attr(754,root,root) /etc/rc.d/init.d/celeryd -%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/celeryd -%attr(750,celery,root) %dir %{_localstatedir}/run/celery -%attr(750,celery,logs) %dir /var/log/archive/celery -%attr(750,celery,logs) /var/log/celery -/usr/lib/tmpfiles.d/celery.conf - +%doc CONTRIBUTORS.txt Changelog LICENSE README.rst TODO extra %{py_sitescriptdir}/%{module} -%if "%{py_ver}" > "2.4" %{py_sitescriptdir}/celery-*.egg-info -%endif %{_examplesdir}/%{name}-%{version} + +%files -n python3-%{module} +%defattr(644,root,root,755) +%doc CONTRIBUTORS.txt Changelog LICENSE README.rst TODO extra +%{py3_sitescriptdir}/%{module} +%{py3_sitescriptdir}/celery-*.egg-info +%{_examplesdir}/python3-%{module}-%{version} + +%files -n celery +%attr(755,root,root) %{_bindir}/* + +%if %{with doc} +%files apidocs +%defattr(644,root,root,755) +%doc docs/.build/html/* +%endif diff --git a/amqp-objects.inv b/amqp-objects.inv new file mode 100644 index 0000000..ef43597 Binary files /dev/null and b/amqp-objects.inv differ diff --git a/celery.tmpfiles b/celery.tmpfiles deleted file mode 100644 index c78cdd0..0000000 --- a/celery.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -d /var/run/celery 0755 root root - diff --git a/celeryd.init b/celeryd.init deleted file mode 100644 index 3e71505..0000000 --- a/celeryd.init +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh -# -# celeryd Starts the Celery worker daemon. -# -# chkconfig: 2345 55 45 -# description: Celery worker daemon -# config: /etc/sysconfig/celeryd -# pidfile: /var/run/celeryd.pid - -### BEGIN INIT INFO -# Provides: celeryd -# Required-Start: $network $local_fs $remote_fs -# Required-Stop: $network $local_fs $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: celery task worker daemon -### END INIT INFO - -DEFAULT_NODES="celery" - -# Source function library -. /etc/rc.d/init.d/functions - -# Get service config -[ -f /etc/sysconfig/celeryd ] && . /etc/sysconfig/celeryd - -CELERYD_USER=${CELERYD_USER:-"celery"} -CELERYD_GROUP=${CELERYD_GROUP:-"users"} - -CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-"/var/log/celery/%n.log"}} -CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-"/var/run/celery/%n.pid"}} -CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-"INFO"}} - -CELERYD=${CELERYD:-"/usr/bin/celeryd"} - -CELERYD_MULTI=${CELERYD_MULTI:-"/usr/bin/celeryd-multi"} -CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES} - -if [ -n "$2" ]; then - CELERYD_OPTS="$CELERYD_OPTS $2" -fi - -if [ -n "$CELERY_PYTHONPATH" ]; then - PYTHONPATH=$CELERY_PYTHONPATH - export PYTHONPATH -fi - -if [ -n "$CELERY_CONFIG_MODULE" ]; then - CELERYD_OPTS="$CELERYD_OPTS --config=$CELERY_CONFIG_MODULE" -fi - -if [ -n "$CELERY_LOADER" ]; then - CELERYD_OPTS="$CELERYD_OPTS --loader=$CELERY_LOADER" -fi - -# Extra start-stop-daemon options, like user/group. -if [ -n "$CELERYD_CHDIR" ]; then - DAEMON_OPTS="$DAEMON_OPTS --chdir $CELERYD_CHDIR" -fi -if [ -n "$CELERYD_USER" ]; then - DAEMON_OPTS="$DAEMON_OPTS --chuid $CELERYD_USER" -fi -if [ -n "$CELERYD_GROUP" ]; then - DAEMON_OPTS="$DAEMON_OPTS --group $CELERYD_GROUP" -fi - -start() { - # Check if the service is already running? - if [ -f /var/lock/subsys/celeryd ]; then - msg_already_running "celeryd" - return - fi - - msg_starting "celeryd" - start-stop-daemon --start $DAEMON_OPTS --background \ - --exec $CELERYD_MULTI \ - start $CELERYD_NODES -- \ - --pidfile="$CELERYD_PID_FILE" \ - --logfile="$CELERYD_LOG_FILE" \ - --loglevel="$CELERYD_LOG_LEVEL" \ - $CELERYD_OPTS - ok - RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/celeryd -} - -stop() { - if [ ! -f /var/lock/subsys/celeryd ]; then - msg_not_running "celeryd" - return - fi - - msg_stopping "celeryd" - $CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE" >/dev/null 2>&1 - RETVAL=$? - if [ $RETVAL == 0 ]; then - ok - rm -f /var/lock/subsys/celeryd >/dev/null 2>&1 - else - fail - fi -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - try-restart) - stop - start - ;; - status) - cd $CELERYD_CHDIR - celeryctl status --config="$CELERY_CONFIG_MODULE" - ;; - *) - msg_usage "$0 {start|stop|restart|try-restart|kill}" - exit 3 - ;; -esac - -exit $RETVAL diff --git a/celeryd.sysconfig b/celeryd.sysconfig deleted file mode 100644 index a84fd24..0000000 --- a/celeryd.sysconfig +++ /dev/null @@ -1,25 +0,0 @@ -# Define nice level for celeryd -SERVICE_RUN_NICE_LEVEL="+0" - -# Config for celeryd - -# List of nodes to start -#CELERYD_NODES="worker1 worker2 worker3"k -# ... can also be a number of workers -#CELERYD_NODES=3 - -# Where to chdir at start -#CELERYD_CHDIR="/opt/Myproject/" - -# Extra arguments to celeryd -CELERYD_OPTS="-B -s /tmp/celerybeat-schedule" - -#CELERYD="$CELERYD_CHDIR/manage.pyc celeryd" - -#CELERY_LOADER= - -# Name of the celery config module. -#CELERY_CONFIG_MODULE="celeryconfig" -#export DJANGO_SETTINGS_MODULE="celeryconfig" - -#CELERY_PYTHONPATH= diff --git a/cyme-objects.inv b/cyme-objects.inv new file mode 100644 index 0000000..1a0b817 Binary files /dev/null and b/cyme-objects.inv differ diff --git a/djcelery-objects.inv b/djcelery-objects.inv new file mode 100644 index 0000000..341f3df Binary files /dev/null and b/djcelery-objects.inv differ diff --git a/intersphinx.patch b/intersphinx.patch new file mode 100644 index 0000000..c0f28cb --- /dev/null +++ b/intersphinx.patch @@ -0,0 +1,20 @@ +diff -dur celery-3.1.19.orig/docs/conf.py celery-3.1.19/docs/conf.py +--- celery-3.1.19.orig/docs/conf.py 2015-10-26 21:04:39.000000000 +0100 ++++ celery-3.1.19/docs/conf.py 2015-11-17 09:53:06.000000000 +0100 +@@ -76,11 +76,11 @@ + add_function_parentheses = True + + intersphinx_mapping = { +- 'python': ('http://docs.python.org/dev', None), +- 'kombu': ('http://kombu.readthedocs.org/en/latest/', None), +- 'djcelery': ('http://django-celery.readthedocs.org/en/latest', None), +- 'cyme': ('http://cyme.readthedocs.org/en/latest', None), +- 'amqp': ('http://amqp.readthedocs.org/en/latest', None), ++ 'python': ('http://docs.python.org/dev', "python-objects.inv"), ++ 'kombu': ('http://kombu.readthedocs.org/en/latest/', "kombu-objects.inv"), ++ 'djcelery': ('http://django-celery.readthedocs.org/en/latest', "djcelery-objects.inv"), ++ 'cyme': ('http://cyme.readthedocs.org/en/latest', "cyme-objects.inv"), ++ 'amqp': ('http://amqp.readthedocs.org/en/latest', "amqp-objects.inv"), + } + + # The name of the Pygments (syntax highlighting) style to use. diff --git a/kombu-objects.inv b/kombu-objects.inv new file mode 100644 index 0000000..ee53c6e Binary files /dev/null and b/kombu-objects.inv differ diff --git a/python-objects.inv b/python-objects.inv new file mode 100644 index 0000000..6f851b8 Binary files /dev/null and b/python-objects.inv differ diff --git a/pytz_dependency.patch b/pytz_dependency.patch new file mode 100644 index 0000000..ccd3c32 --- /dev/null +++ b/pytz_dependency.patch @@ -0,0 +1,8 @@ +diff -dur celery-3.1.19.orig/requirements/default.txt celery-3.1.19/requirements/default.txt +--- celery-3.1.19.orig/requirements/default.txt 2015-10-26 21:04:39.000000000 +0100 ++++ celery-3.1.19/requirements/default.txt 2015-11-16 15:15:38.000000000 +0100 +@@ -1,3 +1,3 @@ +-pytz>dev ++pytz + billiard>=3.3.0.21,<3.4 + kombu>=3.0.29,<3.1 diff --git a/unittest2.patch b/unittest2.patch new file mode 100644 index 0000000..0933b56 --- /dev/null +++ b/unittest2.patch @@ -0,0 +1,7 @@ +diff -dur celery-3.1.19.orig/requirements/test.txt celery-3.1.19/requirements/test.txt +--- celery-3.1.19.orig/requirements/test.txt 2015-10-26 21:04:39.000000000 +0100 ++++ celery-3.1.19/requirements/test.txt 2015-11-17 09:42:12.000000000 +0100 +@@ -1,3 +1,2 @@ +-unittest2>=0.5.1 + nose + mock>=1.0.1 ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/python-celery.git/commitdiff/d9473a22c4e6f96a0a771070a4e0fd4737480c7d _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit