Blob Blame History Raw
%define py_version %(%{__python} -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
%define py_prefix  %(%{__python} -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
%define py_libdir  %{py_prefix}/lib/python%{py_version}
%define py_incdir  %{py_prefix}/include/python%{py_version}
%define py_sitedir %{py_libdir}/site-packages
%define debug_package %{nil}

%define version 0.3.8
%define release 1
# set git to %{nil} (release) or to YYYYMMDD.123456 (git build)
%define git     %{nil}

%if "%{?git}" != ""
%define release_prefix 0.
%define release_suffix .git.%{git}
%endif

Name:           kobo
Version:        %{version}
Release:        %{?release_prefix}%{release}%{?release_suffix}%{?dist}
License:        LGPLv2
Summary:        Python modules for tools development
Group:          Development/Libraries
URL:            https://fedorahosted.org/kobo/
Source0:        https://fedorahosted.org/releases/k/o/kobo/%{name}-%{version}%{?release_suffix}.tar.bz2

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  python-devel >= 2.4

# require additional packages for python 2.4
%if "%{py_version}" == "2.4"
Requires:       python-hashlib
Requires:       python-ssl
%endif


%description
Kobo is a set of python modules designed for rapid tools development.


%package django
Summary:        Django components
Group:          Development/Libraries
Requires:       kobo = %{version}-%{release}

%description django
Django components.


%package client
Summary:        CLI client
Group:          Development/Libraries
Requires:       kobo = %{version}-%{release}
Requires:       python-simplejson

%description client
CLI client.


%package worker
Summary:        Worker daemon processing tasks submitted to the hub
Group:          Development/Libraries
Requires:       kobo = %{version}-%{release}

%description worker
Worker daemon processing tasks submitted to the hub.


%package hub
Summary:        Xml-rpc and web interface to a task database
Group:          Development/Libraries
Requires:       kobo = %{version}-%{release}
Requires:       Django >= 1
Requires:       gzip

%description hub
Hub is a xml-rpc and web interface to a task database.


%package rpmlib
Summary:        Functions to manipulate with RPM files
Group:          Development/Libraries
Requires:       kobo = %{version}-%{release}
Requires:       rpm-python
Requires:       koji

%description rpmlib
Rpmlib contains functions to manipulate with RPM files.


%package admin
Summary:        Kobo admin script for instant project deployment
Group:          Development/Tools
Requires:       kobo >= %{version}
Requires:       Django >= 1

%description admin
Kobo admin provides templates for various kobo-based projects,
incl. CLI, hub client, worker and hub.


%prep
%setup -q -n %{name}-%{version}%{?release_suffix}

%build
echo OK


%install
rm -rf ${RPM_BUILD_ROOT}
python setup.py install --root=${RPM_BUILD_ROOT}

# delete the egg-info file
egg_info=$RPM_BUILD_ROOT/%{py_sitedir}/%{name}-*.egg-info
if [ -f $egg_info ]; then
  rm $egg_info
fi


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(644,root,root,755)
%{py_sitedir}/kobo/*.py*
%exclude %{py_sitedir}/kobo/rpmlib.py*
%doc AUTHORS
%doc COPYING
%doc LICENSE


%files django
%defattr(644,root,root,755)
%{py_sitedir}/kobo/django


%files client
%defattr(644,root,root,755)
%{py_sitedir}/kobo/client


%files worker
%defattr(644,root,root,755)
%{py_sitedir}/kobo/worker


%files hub
%defattr(644,root,root,755)
%{py_sitedir}/kobo/hub


%files rpmlib
%defattr(644,root,root,755)
%{py_sitedir}/kobo/rpmlib.py*

%files admin
%defattr(644,root,root,755)
%{py_sitedir}/kobo/admin
%attr(755,root,root) /usr/bin/kobo-admin


%changelog
* Mon Feb 11 2013 Daniel Mach <dmach@redhat.com> - 0.3.8-1
- Don't catch and mask any exceptions in cli.CommandOptionParser.run(). (Daniel Mach)
- Set an empty keyring in rpmlib.get_rpm_header(). (Daniel Mach)
- Format Fault's output to be nicer. (Tomas Tomecek)
- Display error when cancelling task fails. (Tomas Tomecek)
- Fix task cancelation method name. (Tomas Tomecek)
- Add pkgset.SimpleRpmWrapper; support pickle by providing __getstate__() and __setstate__() methods. (Daniel Mach)
- Enable searching in task list by label. (Tomas Tomecek)
- Enable making custom queries in view task_list. (Tomas Tomecek)
- Limit value length to 200 characters in tback.Traceback. (Daniel Mach)
- Fix email.utils import to work with py2.4. (Daniel Mach)
- Backwards compatibility bugfix in hub.models. (Tomas Tomecek)

* Wed Jan 16 2013 Daniel Mach <dmach@redhat.com> - 0.3.7-1
- Proxy support enhancement (Tomas Mlcoch)
- Improve task ordering. (Daniel Mach)
- Better formatting in Traceback output. (Tomas Tomecek)
- Add JSONField.value_to_string() method. (Tomas Tomecek)
- Improve task dir deletion and task files view. (Tomas Tomecek)
- allow line buffering for shortcuts.run() (Tomas Kopecek)
- Allow to specify buffer_size in shortcuts.run(). (Daniel Mach)
- Add rpmlib.get_changelogs_from_header() and pkgset.RpmWrapper.changelogs. (Daniel Mach)
- Support https_proxy environ variable (Tomas Mlcoch)
- Create pid file in a more secure way. (Daniel Mach)
- Create empty kobo.django.auth.models module to fix crashes in Django 1.4. (Daniel Mach)
- Add shortcuts.makedirs() function which is identical to os.makedirs but doesn't fail on existing dirs. (Daniel Mach)
- Fix typo in the 404.html template. (Daniel Mach)
- Fix traceback on undefined workdir in kobo.shortcuts.run(). (Daniel Mach)
- Add help-rst command which generates rst documentation for all CommandOptionParser's commands. (Daniel Mach)

* Wed Dec 21 2011 Daniel Mach <dmach@redhat.com> - 0.3.6-1
- Clarify auth middleware ordering in the hub settings template. (Daniel Mach)
- Add kobo.threads -- a simple threading worker pool. (Daniel Mach)
- Fix force_list and force_tuple to work with sets. (Daniel Mach)
- Implement removing files from a file cache. (Daniel Mach)
- Make shortcuts.run() thread-safe. (Daniel Mach)

* Mon Oct 10 2011 Daniel Mach <dmach@redhat.com> - 0.3.5-1
- Bump version to 0.3.5. (Daniel Mach)
- Return tracebacks in the XML-RPC dispatcher as unicode. (Daniel Mach)
- Refactor MainMenu to be Django 1.3 compliant. (Martin Magr)
- Make StateEnumField Django 1.2 compliant. (Martin Magr)
- Add proxy support to XML-RPC transports. (Daniel Mach)
- Cache stat values in FileWrapper objects, add size and mtime properties. (Tomas Mlcoch)
- Fix unittest kobo.http for Python 2.4. (Tomas Mlcoch)
- Add unit test for kobo.pkgset. (Tomas Mlcoch)
- Rename pkgset.FileCache.__get__ to __getitem__. (Tomas Mlcoch)
- Add unit test for kobo.http. (Tomas Mlcoch)
- Add unit test for kobo.decorators. (Tomas Mlcoch)
- Add docstrings to kobo.http. (Tomas Mlcoch)
- Add UndoHardlink class to __all__. (Tomas Mlcoch)
- Add unit test for kobo.hardlink. (Tomas Mlcoch)
- Fix params for os.utime() call in UndoHardlink class. (Tomas Mlcoch)
- Fix tback.Traceback to work properly in interpreter. (Tomas Mlcoch)
- Use getattr to read Krb5Error.err_code to prevent possible AttributeError in HubProxy. (Daniel Mach)
- Add a new task state - CREATED. (Daniel Mach)
- Fix templates to work properly in debug mode. (Daniel Mach)
- Revamp log downloads - download as a stream, better support for other than .log files, enforce using UPLOAD_DIR in settings. (Daniel Mach)
- Delete empty directories on FileUpload.delete(). (Daniel Mach)
- Catch an exception when deleting an FileUpload object and target file is missing. (Daniel Mach)
- Make sure that xmlrpc.decode_xmlrpc_chunk() won't fail on existing directory. (Daniel Mach)
- Run task cleanup and notification for foreground tasks. (Daniel Mach)
- Enhance shortcuts.iter_chunks() to work with files. (Daniel Mach)
- Upload files in chunks in order to prevent client-side memory issues. (Daniel Mach)
- Exclude file uploads from CSRF protection. (Daniel Mach)
- Add assertRegexpMatches and assertIsInstance to tback tests to make them work on python < 2.7. (Daniel Mach)
- Fix processing unitialized variables in tback. (Martin Bukatovic)
- Fix a traceback in kobo-admin start-hub when a project name contained dashes. (Daniel Mach)
- Add -tt python interpreter argument to project templates. (Daniel Mach)
- Add kobo.rpmlib.parse_evr() to parse E:VR. (Daniel Mach)
- Fix parse_nvra() - arch must not contain '-'. (Daniel Mach)
- Add missing {{ project_name }} prefix to kobo admin templates. (Daniel Mach)
- Start daemons in "/" rather than in working dir. (Daniel Mach)
- Add TransactionMiddleware to the hub template's settings. (Daniel Mach)
- Add skip_broken argument to PluginContainer.register_module() class method. (Daniel Mach)

* Fri Feb 18 2011 Daniel Mach <dmach@redhat.com> - 0.3.4-1
- Add kobo.decorators.log_traceback() devel decorator to log function tracebacks to a file. (Daniel Mach)
- Fix tback.Traceback for py2.4. (Daniel Mach)

* Tue Feb  1 2011 Daniel Mach <dmach@redhat.com> - 0.3.3-1
- Replace double underscores with dots in xmlrpc method names. (Daniel Mach)
- Fix regex in test_tback.py so unit tests pass. (Daniel Mach)
- Fix session handling in worker. (Daniel Mach)
- Fix kobo.Traceback to return empty string on no exception. Add traceback tests. (Tomas Kopecek)
- Simplify hub deployment (add menu and template to default). Tweak kobo-admin templates. (Daniel Mach)
- Add a warning about a possibly read-only database to the worker middleware assert. (Daniel Mach)
- Add task notification() and cleanup() class methods. (Daniel Mach)
- Revamp hub urls and admin templates. (Daniel Mach)
- Prevent a race condition when using CookieTransport in threads in py2.7. (Daniel Mach)
- Add unit test for EnumItem.change_state() return value. (Daniel Mach)
- StateEnum.change_state() now returns bool as documented. (Martin Magr)
- Command argument in kobo.shortcuts.run() can be also a list now. (Daniel Mach)
- Strip path from nvr in kobo.rpmlib.parse_nvr() and parse_nvra(). (Daniel Mach)
- Exclude XML-RPC from CSRF processing. (Daniel Mach)
- Add stdin data support to kobo.shortcuts.run(). (Daniel Mach)
- Add kobo.shortcuts.iter_chunks() to iterate through a list, string or generator and yield chunks of defined size. (Daniel Mach)
- Raise an exception when spawn_subtask() or wait() method is called in a foreground task. (Daniel Mach)
- Add constructor to kobo.django.hacks.UserChangeForm to fix maximum recursion depth error. (Daniel Mach)
- Fix username max_length hack to work with Django 1.2.1. (Martin Bukatovic)
- Add kobo.notification module to send email notifications. (Daniel Mach)
- Process kobo.shortcuts.run() logging in chunks and print data immediately. (Daniel Mach)
- Subtasks have to follow parent's channel and arch. (Martin Magr)
- Compute elapsed time for running tasks. (Tomas Kopecek)

* Wed Oct 27 2010 Daniel Mach <dmach@redhat.com> - 0.3.2-1
- Fix XML-RPC transports to make them work in py2.5 and py2.6. (Daniel Mach)
- Automatically scroll the task log window when we're at the bottom of the page. (Daniel Mach)
- Show self.* attributes in extended tracebacks. (Daniel Mach)
- Compress logs with gzip when a task finishes. (Daniel Mach)
- Convert task logs to utf8 (with "replace" option) to prevent raising UnicodeDecodeError during template processing. (Daniel Mach)

* Tue Oct 19 2010 Daniel Mach <dmach@redhat.com> - 0.3.1-1
- Add help-admin command to display help for admin commands. (Daniel Mach)
- Add config parser support for glob matching on dict keys. (Tomas Kopecek)
- Implement timeout support in xmlrpc transports. (Daniel Mach)
- Improve kobo.xmlrpc.CookieTransport to work with python 2.7 as well. (Daniel Mach)
- Add kobo-admin utility. (Martin Bukatovic)
- Add missing HttpResponseForbidden import to kobo.hub.views. (Daniel Mach)
- Fix bug in "Show only my tasks" search option on Tasks page. (Daniel Mach)

* Fri Aug 13 2010 Daniel Mach <dmach@redhat.com> - 0.3.0-2
- Bump to new upstream version.
- Fix kobo.rpmlib.get_digest_algo_from_header() when RPMTAG_FILEDIGESTALGO contains None value. (Daniel Mach)
- Pass 'conf' argument do daemonized worker's main_loop. (Daniel Mach)

* Mon Feb 15 2010 Daniel Mach <dmach@redhat.com> - 0.2.1-1
- Split rpmlib to a subpackage.
- Add missing "compare_nvr" to __all__. (Daniel Mach)
- Remove duplicate subtask removal in Task.wait(). (Tomas Kopecek)
- Parent task didn't wake up even if all child tasks were finished. (Tomas Kopecek)
- Change 'make log' to use C locales and automatically fill name and email from GIT. (Daniel Mach)
- Fix spawn_subtask argument. (cherry picked from commit 374a4165c16d6b34fa486a38525753969e549415) (Tomas Kopecek)
- Fix XML-RPC method registration. (original patch by Xuqing Kuang) (Daniel Mach)
- Convert rpm.labelCompare's arguments to string to prevent segfaulting. Add compare_nvr tests. (Tomas Kopecek)
- Add Task.get_time_display() to get time spent in task in human readable form. (Daniel Mach)
- Use koji.get_sigpacket_key_id() to read sigkey id from a rpm header. (Daniel Mach)

* Thu Nov  5 2009 Daniel Mach <dmach@redhat.com> - 0.2.0-1
- Rewrite menu to get rid of tuples in menu definition. Always use MenuItem classes. (Daniel Mach)
- Send task logs to hub to enable realtime log watching. (Daniel Mach)
- Add menu_item helper. (Tomas Kopecek)
- New version of menu component. (Tomas Kopecek)
- Order tasks to assign by priority first. (Daniel Mach)
- Fix spacing errors to be more PEP 8 compliant. (Daniel Mach)
- Handle SystemExit in TaskManager.run_task(). (Daniel Mach)
- Add a shortcut and pkgset support for computing hashlib based hashes. (Daniel Mach)
- Add hack enabling 'VERBOSE' log level in the python logging module and Logger class. (Daniel Mach)
- Run tests in alphabetical order. (Daniel Mach)
- Fix TaskAdmin to search for user in correct db field. (Tomas Kopecek)
- More convenient admin listing for Worker model. (Tomas Kopecek)
- Add files to cache faster (skip stat call when possible). (Tomas Kopecek)
- Remove deps on postgresql, httpd, mod_auth_kerb and python-krbV.
- Add AUTHORS, COPYING and LICENSE to kobo.rpm.

* Tue Aug 18 2009 Daniel Mach <dmach@redhat.com> - 0.1.2-1
- Read default paginate_by value from settings in kobo.django.views.generic.object_list. (Tomas Kopecek)
- Add read_from_file() and rename save() to save_to_file() in kobo.shortcuts. (Daniel Mach)
- Reverse FileUpload default ordering. (Daniel Mach)
- Add kobo.conf.get_dict_value() to support dicts with default values. (Daniel Mach)
- Add direct access to files via pkgset.RpmWrapper. (Tomas Kopecek)
- Add documentation to django.auth.krb5. (Daniel Mach)
- Fix worker key generation in kobo.hub.models.Worker.save(). (Daniel Mach)
- Fix a security hole in krb5 middleware: a user was able to log in as different user to admin interface. (Daniel Mach)
- Change Makefile to run tests before creating source tarball. (Daniel Mach)
- Change HubProxy._hub verification to fix exceptions in Python2.6. (Martin Magr)
- Another SQL performance improvement in Task admin. (Tomas Kopecek)
- Set Task.parent as raw_id field to improve admin performance. (Daniel Mach)
- Add (spent) time method to Task and display it in the admin listing. (Tomas Kopecek)

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jul 22 2009 Daniel Mach <dmach@redhat.com> - 0.1.1-1
- Enhance types.Enum to support help_text and additonal options. Update tests for types module. (Daniel Mach)
- Remove temp directory after file upload. (Tomas Kopecek)
- Remove MANIFEST in make clean. (Daniel Mach)
- Fix shortcuts.run to read complete stdout. (Jan Blazek)
- Add rpmlib.get_file_list_from_header() which extracts file list, colors and checksums from a rpm header. (Daniel Mach)
- Add get_digest_algo_from_header() function to read rpm digest algorithm. (Daniel Mach)
- Update epydoc docstrings in kobo.rpmlib. (Daniel Mach)
- Fix deadlock in run(). Use proc.poll() instead of proc.wait(). (Daniel Mach)
- Update epydoc docstrings in kobo.shortcuts. (Daniel Mach)
- Fix AtributeError when active_submenu is None. (Daniel Mach)
- Return menu dict even if no menu is active. (Daniel Mach)
- Do not allow to register plugins to PluginContainer base class. Add several tests. (Daniel Mach)
- Add test runner. (Daniel Mach)
- Add support for empty submenus. (Martin Magr)

* Wed Jun 17 2009 Daniel Mach <dmach@redhat.com> - 0.1.0-1
- first release