2381a07
%define py_version %(%{__python} -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
2381a07
%define py_prefix  %(%{__python} -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
2381a07
%define py_libdir  %{py_prefix}/lib/python%{py_version}
2381a07
%define py_incdir  %{py_prefix}/include/python%{py_version}
2381a07
%define py_sitedir %{py_libdir}/site-packages
2381a07
%define debug_package %{nil}
2381a07
cf5932d
%define version 0.3.8
8626b69
%define release 1
2381a07
# set git to %{nil} (release) or to YYYYMMDD.123456 (git build)
2381a07
%define git     %{nil}
2381a07
2381a07
%if "%{?git}" != ""
2381a07
%define release_prefix 0.
2381a07
%define release_suffix .git.%{git}
2381a07
%endif
2381a07
2381a07
Name:           kobo
2381a07
Version:        %{version}
2381a07
Release:        %{?release_prefix}%{release}%{?release_suffix}%{?dist}
2381a07
License:        LGPLv2
2381a07
Summary:        Python modules for tools development
2381a07
Group:          Development/Libraries
a9c3263
URL:            https://fedorahosted.org/kobo/
a9c3263
Source0:        https://fedorahosted.org/releases/k/o/kobo/%{name}-%{version}%{?release_suffix}.tar.bz2
2381a07
2381a07
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2381a07
BuildArch:      noarch
2381a07
BuildRequires:  python-devel >= 2.4
2381a07
a79a744
# require additional packages for python 2.4
2381a07
%if "%{py_version}" == "2.4"
2381a07
Requires:       python-hashlib
a79a744
Requires:       python-ssl
2381a07
%endif
2381a07
2381a07
2381a07
%description
2381a07
Kobo is a set of python modules designed for rapid tools development.
2381a07
2381a07
2381a07
%package django
2381a07
Summary:        Django components
2381a07
Group:          Development/Libraries
2381a07
Requires:       kobo = %{version}-%{release}
2381a07
2381a07
%description django
2381a07
Django components.
2381a07
2381a07
2381a07
%package client
2381a07
Summary:        CLI client
2381a07
Group:          Development/Libraries
2381a07
Requires:       kobo = %{version}-%{release}
653437c
Requires:       python-simplejson
2381a07
2381a07
%description client
2381a07
CLI client.
2381a07
2381a07
2381a07
%package worker
2381a07
Summary:        Worker daemon processing tasks submitted to the hub
2381a07
Group:          Development/Libraries
2381a07
Requires:       kobo = %{version}-%{release}
2381a07
2381a07
%description worker
2381a07
Worker daemon processing tasks submitted to the hub.
2381a07
2381a07
2381a07
%package hub
2381a07
Summary:        Xml-rpc and web interface to a task database
2381a07
Group:          Development/Libraries
2381a07
Requires:       kobo = %{version}-%{release}
2381a07
Requires:       Django >= 1
653437c
Requires:       gzip
2381a07
2381a07
%description hub
2381a07
Hub is a xml-rpc and web interface to a task database.
2381a07
2381a07
0d2f53f
%package rpmlib
0d2f53f
Summary:        Functions to manipulate with RPM files
0d2f53f
Group:          Development/Libraries
0d2f53f
Requires:       kobo = %{version}-%{release}
0d2f53f
Requires:       rpm-python
0d2f53f
Requires:       koji
0d2f53f
0d2f53f
%description rpmlib
0d2f53f
Rpmlib contains functions to manipulate with RPM files.
0d2f53f
0d2f53f
653437c
%package admin
653437c
Summary:        Kobo admin script for instant project deployment
653437c
Group:          Development/Tools
653437c
Requires:       kobo >= %{version}
653437c
Requires:       Django >= 1
653437c
653437c
%description admin
653437c
Kobo admin provides templates for various kobo-based projects,
653437c
incl. CLI, hub client, worker and hub.
653437c
653437c
2381a07
%prep
2381a07
%setup -q -n %{name}-%{version}%{?release_suffix}
2381a07
2381a07
%build
2381a07
echo OK
2381a07
2381a07
2381a07
%install
2381a07
rm -rf ${RPM_BUILD_ROOT}
2381a07
python setup.py install --root=${RPM_BUILD_ROOT}
2381a07
2381a07
# delete the egg-info file
2381a07
egg_info=$RPM_BUILD_ROOT/%{py_sitedir}/%{name}-*.egg-info
2381a07
if [ -f $egg_info ]; then
2381a07
  rm $egg_info
2381a07
fi
2381a07
2381a07
2381a07
%clean
2381a07
rm -rf $RPM_BUILD_ROOT
2381a07
2381a07
2381a07
%files
2381a07
%defattr(644,root,root,755)
2381a07
%{py_sitedir}/kobo/*.py*
0d2f53f
%exclude %{py_sitedir}/kobo/rpmlib.py*
db2fd82
%doc AUTHORS
db2fd82
%doc COPYING
db2fd82
%doc LICENSE
2381a07
2381a07
2381a07
%files django
2381a07
%defattr(644,root,root,755)
2381a07
%{py_sitedir}/kobo/django
2381a07
2381a07
2381a07
%files client
2381a07
%defattr(644,root,root,755)
2381a07
%{py_sitedir}/kobo/client
2381a07
2381a07
2381a07
%files worker
2381a07
%defattr(644,root,root,755)
2381a07
%{py_sitedir}/kobo/worker
2381a07
2381a07
2381a07
%files hub
2381a07
%defattr(644,root,root,755)
2381a07
%{py_sitedir}/kobo/hub
2381a07
2381a07
0d2f53f
%files rpmlib
0d2f53f
%defattr(644,root,root,755)
0d2f53f
%{py_sitedir}/kobo/rpmlib.py*
0d2f53f
653437c
%files admin
653437c
%defattr(644,root,root,755)
653437c
%{py_sitedir}/kobo/admin
653437c
%attr(755,root,root) /usr/bin/kobo-admin
653437c
0d2f53f
2381a07
%changelog
cf5932d
* Mon Feb 11 2013 Daniel Mach <dmach@redhat.com> - 0.3.8-1
cf5932d
- Don't catch and mask any exceptions in cli.CommandOptionParser.run(). (Daniel Mach)
cf5932d
- Set an empty keyring in rpmlib.get_rpm_header(). (Daniel Mach)
cf5932d
- Format Fault's output to be nicer. (Tomas Tomecek)
cf5932d
- Display error when cancelling task fails. (Tomas Tomecek)
cf5932d
- Fix task cancelation method name. (Tomas Tomecek)
cf5932d
- Add pkgset.SimpleRpmWrapper; support pickle by providing __getstate__() and __setstate__() methods. (Daniel Mach)
cf5932d
- Enable searching in task list by label. (Tomas Tomecek)
cf5932d
- Enable making custom queries in view task_list. (Tomas Tomecek)
cf5932d
- Limit value length to 200 characters in tback.Traceback. (Daniel Mach)
cf5932d
- Fix email.utils import to work with py2.4. (Daniel Mach)
cf5932d
- Backwards compatibility bugfix in hub.models. (Tomas Tomecek)
cf5932d
8626b69
* Wed Jan 16 2013 Daniel Mach <dmach@redhat.com> - 0.3.7-1
8626b69
- Proxy support enhancement (Tomas Mlcoch)
8626b69
- Improve task ordering. (Daniel Mach)
8626b69
- Better formatting in Traceback output. (Tomas Tomecek)
8626b69
- Add JSONField.value_to_string() method. (Tomas Tomecek)
8626b69
- Improve task dir deletion and task files view. (Tomas Tomecek)
8626b69
- allow line buffering for shortcuts.run() (Tomas Kopecek)
8626b69
- Allow to specify buffer_size in shortcuts.run(). (Daniel Mach)
8626b69
- Add rpmlib.get_changelogs_from_header() and pkgset.RpmWrapper.changelogs. (Daniel Mach)
8626b69
- Support https_proxy environ variable (Tomas Mlcoch)
8626b69
- Create pid file in a more secure way. (Daniel Mach)
8626b69
- Create empty kobo.django.auth.models module to fix crashes in Django 1.4. (Daniel Mach)
8626b69
- Add shortcuts.makedirs() function which is identical to os.makedirs but doesn't fail on existing dirs. (Daniel Mach)
8626b69
- Fix typo in the 404.html template. (Daniel Mach)
8626b69
- Fix traceback on undefined workdir in kobo.shortcuts.run(). (Daniel Mach)
8626b69
- Add help-rst command which generates rst documentation for all CommandOptionParser's commands. (Daniel Mach)
3dba077
a79a744
* Wed Dec 21 2011 Daniel Mach <dmach@redhat.com> - 0.3.6-1
a79a744
- Clarify auth middleware ordering in the hub settings template. (Daniel Mach)
a79a744
- Add kobo.threads -- a simple threading worker pool. (Daniel Mach)
a79a744
- Fix force_list and force_tuple to work with sets. (Daniel Mach)
a79a744
- Implement removing files from a file cache. (Daniel Mach)
a79a744
- Make shortcuts.run() thread-safe. (Daniel Mach)
a79a744
6dd2a7c
* Mon Oct 10 2011 Daniel Mach <dmach@redhat.com> - 0.3.5-1
6dd2a7c
- Bump version to 0.3.5. (Daniel Mach)
6dd2a7c
- Return tracebacks in the XML-RPC dispatcher as unicode. (Daniel Mach)
6dd2a7c
- Refactor MainMenu to be Django 1.3 compliant. (Martin Magr)
6dd2a7c
- Make StateEnumField Django 1.2 compliant. (Martin Magr)
6dd2a7c
- Add proxy support to XML-RPC transports. (Daniel Mach)
6dd2a7c
- Cache stat values in FileWrapper objects, add size and mtime properties. (Tomas Mlcoch)
6dd2a7c
- Fix unittest kobo.http for Python 2.4. (Tomas Mlcoch)
6dd2a7c
- Add unit test for kobo.pkgset. (Tomas Mlcoch)
6dd2a7c
- Rename pkgset.FileCache.__get__ to __getitem__. (Tomas Mlcoch)
6dd2a7c
- Add unit test for kobo.http. (Tomas Mlcoch)
6dd2a7c
- Add unit test for kobo.decorators. (Tomas Mlcoch)
6dd2a7c
- Add docstrings to kobo.http. (Tomas Mlcoch)
6dd2a7c
- Add UndoHardlink class to __all__. (Tomas Mlcoch)
6dd2a7c
- Add unit test for kobo.hardlink. (Tomas Mlcoch)
6dd2a7c
- Fix params for os.utime() call in UndoHardlink class. (Tomas Mlcoch)
6dd2a7c
- Fix tback.Traceback to work properly in interpreter. (Tomas Mlcoch)
6dd2a7c
- Use getattr to read Krb5Error.err_code to prevent possible AttributeError in HubProxy. (Daniel Mach)
6dd2a7c
- Add a new task state - CREATED. (Daniel Mach)
6dd2a7c
- Fix templates to work properly in debug mode. (Daniel Mach)
6dd2a7c
- Revamp log downloads - download as a stream, better support for other than .log files, enforce using UPLOAD_DIR in settings. (Daniel Mach)
6dd2a7c
- Delete empty directories on FileUpload.delete(). (Daniel Mach)
6dd2a7c
- Catch an exception when deleting an FileUpload object and target file is missing. (Daniel Mach)
6dd2a7c
- Make sure that xmlrpc.decode_xmlrpc_chunk() won't fail on existing directory. (Daniel Mach)
6dd2a7c
- Run task cleanup and notification for foreground tasks. (Daniel Mach)
6dd2a7c
- Enhance shortcuts.iter_chunks() to work with files. (Daniel Mach)
6dd2a7c
- Upload files in chunks in order to prevent client-side memory issues. (Daniel Mach)
6dd2a7c
- Exclude file uploads from CSRF protection. (Daniel Mach)
6dd2a7c
- Add assertRegexpMatches and assertIsInstance to tback tests to make them work on python < 2.7. (Daniel Mach)
6dd2a7c
- Fix processing unitialized variables in tback. (Martin Bukatovic)
6dd2a7c
- Fix a traceback in kobo-admin start-hub when a project name contained dashes. (Daniel Mach)
6dd2a7c
- Add -tt python interpreter argument to project templates. (Daniel Mach)
6dd2a7c
- Add kobo.rpmlib.parse_evr() to parse E:VR. (Daniel Mach)
6dd2a7c
- Fix parse_nvra() - arch must not contain '-'. (Daniel Mach)
6dd2a7c
- Add missing {{ project_name }} prefix to kobo admin templates. (Daniel Mach)
6dd2a7c
- Start daemons in "/" rather than in working dir. (Daniel Mach)
6dd2a7c
- Add TransactionMiddleware to the hub template's settings. (Daniel Mach)
6dd2a7c
- Add skip_broken argument to PluginContainer.register_module() class method. (Daniel Mach)
6dd2a7c
b833b0b
* Fri Feb 18 2011 Daniel Mach <dmach@redhat.com> - 0.3.4-1
b833b0b
- Add kobo.decorators.log_traceback() devel decorator to log function tracebacks to a file. (Daniel Mach)
b833b0b
- Fix tback.Traceback for py2.4. (Daniel Mach)
b833b0b
653437c
* Tue Feb  1 2011 Daniel Mach <dmach@redhat.com> - 0.3.3-1
653437c
- Replace double underscores with dots in xmlrpc method names. (Daniel Mach)
653437c
- Fix regex in test_tback.py so unit tests pass. (Daniel Mach)
653437c
- Fix session handling in worker. (Daniel Mach)
653437c
- Fix kobo.Traceback to return empty string on no exception. Add traceback tests. (Tomas Kopecek)
653437c
- Simplify hub deployment (add menu and template to default). Tweak kobo-admin templates. (Daniel Mach)
653437c
- Add a warning about a possibly read-only database to the worker middleware assert. (Daniel Mach)
653437c
- Add task notification() and cleanup() class methods. (Daniel Mach)
653437c
- Revamp hub urls and admin templates. (Daniel Mach)
653437c
- Prevent a race condition when using CookieTransport in threads in py2.7. (Daniel Mach)
653437c
- Add unit test for EnumItem.change_state() return value. (Daniel Mach)
653437c
- StateEnum.change_state() now returns bool as documented. (Martin Magr)
653437c
- Command argument in kobo.shortcuts.run() can be also a list now. (Daniel Mach)
653437c
- Strip path from nvr in kobo.rpmlib.parse_nvr() and parse_nvra(). (Daniel Mach)
653437c
- Exclude XML-RPC from CSRF processing. (Daniel Mach)
653437c
- Add stdin data support to kobo.shortcuts.run(). (Daniel Mach)
653437c
- Add kobo.shortcuts.iter_chunks() to iterate through a list, string or generator and yield chunks of defined size. (Daniel Mach)
653437c
- Raise an exception when spawn_subtask() or wait() method is called in a foreground task. (Daniel Mach)
653437c
- Add constructor to kobo.django.hacks.UserChangeForm to fix maximum recursion depth error. (Daniel Mach)
653437c
- Fix username max_length hack to work with Django 1.2.1. (Martin Bukatovic)
653437c
- Add kobo.notification module to send email notifications. (Daniel Mach)
653437c
- Process kobo.shortcuts.run() logging in chunks and print data immediately. (Daniel Mach)
653437c
- Subtasks have to follow parent's channel and arch. (Martin Magr)
653437c
- Compute elapsed time for running tasks. (Tomas Kopecek)
653437c
653437c
* Wed Oct 27 2010 Daniel Mach <dmach@redhat.com> - 0.3.2-1
653437c
- Fix XML-RPC transports to make them work in py2.5 and py2.6. (Daniel Mach)
653437c
- Automatically scroll the task log window when we're at the bottom of the page. (Daniel Mach)
653437c
- Show self.* attributes in extended tracebacks. (Daniel Mach)
653437c
- Compress logs with gzip when a task finishes. (Daniel Mach)
653437c
- Convert task logs to utf8 (with "replace" option) to prevent raising UnicodeDecodeError during template processing. (Daniel Mach)
653437c
653437c
* Tue Oct 19 2010 Daniel Mach <dmach@redhat.com> - 0.3.1-1
653437c
- Add help-admin command to display help for admin commands. (Daniel Mach)
653437c
- Add config parser support for glob matching on dict keys. (Tomas Kopecek)
653437c
- Implement timeout support in xmlrpc transports. (Daniel Mach)
653437c
- Improve kobo.xmlrpc.CookieTransport to work with python 2.7 as well. (Daniel Mach)
653437c
- Add kobo-admin utility. (Martin Bukatovic)
653437c
- Add missing HttpResponseForbidden import to kobo.hub.views. (Daniel Mach)
653437c
- Fix bug in "Show only my tasks" search option on Tasks page. (Daniel Mach)
653437c
653437c
* Fri Aug 13 2010 Daniel Mach <dmach@redhat.com> - 0.3.0-2
653437c
- Bump to new upstream version.
653437c
- Fix kobo.rpmlib.get_digest_algo_from_header() when RPMTAG_FILEDIGESTALGO contains None value. (Daniel Mach)
653437c
- Pass 'conf' argument do daemonized worker's main_loop. (Daniel Mach)
b6809bb
0d2f53f
* Mon Feb 15 2010 Daniel Mach <dmach@redhat.com> - 0.2.1-1
0d2f53f
- Split rpmlib to a subpackage.
0d2f53f
- Add missing "compare_nvr" to __all__. (Daniel Mach)
0d2f53f
- Remove duplicate subtask removal in Task.wait(). (Tomas Kopecek)
0d2f53f
- Parent task didn't wake up even if all child tasks were finished. (Tomas Kopecek)
0d2f53f
- Change 'make log' to use C locales and automatically fill name and email from GIT. (Daniel Mach)
0d2f53f
- Fix spawn_subtask argument. (cherry picked from commit 374a4165c16d6b34fa486a38525753969e549415) (Tomas Kopecek)
0d2f53f
- Fix XML-RPC method registration. (original patch by Xuqing Kuang) (Daniel Mach)
0d2f53f
- Convert rpm.labelCompare's arguments to string to prevent segfaulting. Add compare_nvr tests. (Tomas Kopecek)
0d2f53f
- Add Task.get_time_display() to get time spent in task in human readable form. (Daniel Mach)
0d2f53f
- Use koji.get_sigpacket_key_id() to read sigkey id from a rpm header. (Daniel Mach)
0d2f53f
db2fd82
* Thu Nov  5 2009 Daniel Mach <dmach@redhat.com> - 0.2.0-1
db2fd82
- Rewrite menu to get rid of tuples in menu definition. Always use MenuItem classes. (Daniel Mach)
db2fd82
- Send task logs to hub to enable realtime log watching. (Daniel Mach)
db2fd82
- Add menu_item helper. (Tomas Kopecek)
db2fd82
- New version of menu component. (Tomas Kopecek)
db2fd82
- Order tasks to assign by priority first. (Daniel Mach)
db2fd82
- Fix spacing errors to be more PEP 8 compliant. (Daniel Mach)
db2fd82
- Handle SystemExit in TaskManager.run_task(). (Daniel Mach)
db2fd82
- Add a shortcut and pkgset support for computing hashlib based hashes. (Daniel Mach)
db2fd82
- Add hack enabling 'VERBOSE' log level in the python logging module and Logger class. (Daniel Mach)
db2fd82
- Run tests in alphabetical order. (Daniel Mach)
db2fd82
- Fix TaskAdmin to search for user in correct db field. (Tomas Kopecek)
db2fd82
- More convenient admin listing for Worker model. (Tomas Kopecek)
db2fd82
- Add files to cache faster (skip stat call when possible). (Tomas Kopecek)
db2fd82
- Remove deps on postgresql, httpd, mod_auth_kerb and python-krbV.
db2fd82
- Add AUTHORS, COPYING and LICENSE to kobo.rpm.
db2fd82
6f9e15d
* Tue Aug 18 2009 Daniel Mach <dmach@redhat.com> - 0.1.2-1
6f9e15d
- Read default paginate_by value from settings in kobo.django.views.generic.object_list. (Tomas Kopecek)
6f9e15d
- Add read_from_file() and rename save() to save_to_file() in kobo.shortcuts. (Daniel Mach)
6f9e15d
- Reverse FileUpload default ordering. (Daniel Mach)
6f9e15d
- Add kobo.conf.get_dict_value() to support dicts with default values. (Daniel Mach)
6f9e15d
- Add direct access to files via pkgset.RpmWrapper. (Tomas Kopecek)
6f9e15d
- Add documentation to django.auth.krb5. (Daniel Mach)
6f9e15d
- Fix worker key generation in kobo.hub.models.Worker.save(). (Daniel Mach)
6f9e15d
- Fix a security hole in krb5 middleware: a user was able to log in as different user to admin interface. (Daniel Mach)
6f9e15d
- Change Makefile to run tests before creating source tarball. (Daniel Mach)
6f9e15d
- Change HubProxy._hub verification to fix exceptions in Python2.6. (Martin Magr)
6f9e15d
- Another SQL performance improvement in Task admin. (Tomas Kopecek)
6f9e15d
- Set Task.parent as raw_id field to improve admin performance. (Daniel Mach)
6f9e15d
- Add (spent) time method to Task and display it in the admin listing. (Tomas Kopecek)
6f9e15d
c1f7d81
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-2
c1f7d81
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c1f7d81
a9c3263
* Wed Jul 22 2009 Daniel Mach <dmach@redhat.com> - 0.1.1-1
a9c3263
- Enhance types.Enum to support help_text and additonal options. Update tests for types module. (Daniel Mach)
a9c3263
- Remove temp directory after file upload. (Tomas Kopecek)
a9c3263
- Remove MANIFEST in make clean. (Daniel Mach)
a9c3263
- Fix shortcuts.run to read complete stdout. (Jan Blazek)
a9c3263
- Add rpmlib.get_file_list_from_header() which extracts file list, colors and checksums from a rpm header. (Daniel Mach)
a9c3263
- Add get_digest_algo_from_header() function to read rpm digest algorithm. (Daniel Mach)
a9c3263
- Update epydoc docstrings in kobo.rpmlib. (Daniel Mach)
a9c3263
- Fix deadlock in run(). Use proc.poll() instead of proc.wait(). (Daniel Mach)
a9c3263
- Update epydoc docstrings in kobo.shortcuts. (Daniel Mach)
a9c3263
- Fix AtributeError when active_submenu is None. (Daniel Mach)
a9c3263
- Return menu dict even if no menu is active. (Daniel Mach)
a9c3263
- Do not allow to register plugins to PluginContainer base class. Add several tests. (Daniel Mach)
a9c3263
- Add test runner. (Daniel Mach)
a9c3263
- Add support for empty submenus. (Martin Magr)
db2fd82
2381a07
* Wed Jun 17 2009 Daniel Mach <dmach@redhat.com> - 0.1.0-1
2381a07
- first release