96a1e34
%global gitrev 683dd
d2826e3
%global posttag git%{gitrev}
d2826e3
%global snapshot %{version}-%{posttag}
d2826e3
d2826e3
Name:       pybugz
d2826e3
Summary:    Command line interface for Bugzilla written in Python
d2826e3
Version:    0.10
7fcb169
Release:    4.%{posttag}%{?dist}
d2826e3
Group:      Applications/Communications
d2826e3
License:    GPLv2
d2826e3
URL:        https://github.com/williamh/pybugz
d2826e3
BuildArch:  noarch
d2826e3
d2826e3
Requires:       python2
d2826e3
BuildRequires:  python2-devel
d2826e3
d2826e3
%if ! 0%{?rhel}
d2826e3
# no bash-completion for RHEL
d2826e3
%global bash_completion 1
d2826e3
%endif
d2826e3
7fcb169
%if 0%{?bash_completion}
d2826e3
BuildRequires: bash-completion pkgconfig
d2826e3
%endif
d2826e3
d2826e3
# There is possible to download upstream tarball generated by github, but it is
d2826e3
# quite old now.  For HOWTO obtain correct tarball see the "prepare-tarball.sh"
d2826e3
# script (in dist-git).
d2826e3
Source0: %{name}-%{snapshot}.tar.gz
d2826e3
96a1e34
# make the installation better useful for bugzilla.redhat.com users
96a1e34
# ~> downstream
96a1e34
Patch0: %{name}-0.10-git683dd-rh-specific.patch
d2826e3
d2826e3
%description
d2826e3
Pybugz was conceived as a tool to speed up the work-flow for Gentoo Linux
d2826e3
contributors when dealing with bugs using Bugzilla.  By avoiding the clunky web
d2826e3
interface, the user can search, isolate and contribute to the project very
d2826e3
quickly.  Developers alike can easily extract attachments and close bugs
d2826e3
comfortably from the command line.
d2826e3
d2826e3
%prep
d2826e3
%setup -q -n %{name}-%{snapshot}
96a1e34
%patch0 -p1 -b .rh-specific
d2826e3
d2826e3
%build
d2826e3
%{__python} setup.py build
d2826e3
d2826e3
%install
d2826e3
# default install process
d2826e3
%{__python} setup.py install --root=%{buildroot}
d2826e3
d2826e3
%global bash_cmpl_dir %(pkg-config --variable=completionsdir bash-completion)
7fcb169
%if 0%{?bash_completion}
d2826e3
  # find the proper directory to install bash-completion script
d2826e3
  mkdir -p %{buildroot}%{bash_cmpl_dir}
d2826e3
  cp %{_builddir}/%{name}-%{snapshot}/contrib/bash-completion \
d2826e3
     %{buildroot}%{bash_cmpl_dir}/bugz
d2826e3
%endif
d2826e3
d2826e3
mkdir -p %{buildroot}%{_mandir}/man1
d2826e3
mv man/bugz.1 %{buildroot}%{_mandir}/man1/bugz.1
d2826e3
mkdir -p %{buildroot}%{_docdir}
d2826e3
d2826e3
%clean
d2826e3
d2826e3
%files
d2826e3
%{_bindir}/bugz
d2826e3
%{python_sitelib}/bugz
7fcb169
%if 0%{?bash_completion}
d2826e3
  %{bash_cmpl_dir}/bugz
d2826e3
%endif
d2826e3
%{python_sitelib}/%{name}-*.egg-info
d2826e3
%{_mandir}/man1/bugz.1.gz
96a1e34
%doc README LICENSE bugzrc.example
d2826e3
d2826e3
%changelog
7fcb169
* Wed Mar 13 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10-4.git683dd
7fcb169
- fix the macro problem for epel
7fcb169
96a1e34
* Wed Mar 13 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10-3.git683dd
96a1e34
- remove downstream patches for now - I'll reapply again if it becomes upstream
96a1e34
- package the latest git version
96a1e34
d57b44d
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-2.git89df2
d57b44d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
d57b44d
d2826e3
* Sun Jan 20 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10-1.git89df2
d2826e3
- changes for problems spotted/fixed by Scott Tsai in merge-review bug:
d2826e3
- important change - move git revision behind the release number
d2826e3
- reflect that ^^^ change in changelog
d2826e3
- remove statement disabling debuginfo (it is not needed)
d2826e3
d2826e3
* Sun Jan 20 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10git69cd7-1
d2826e3
- apply downstream patches to reflect https://github.com/praiskup/pybugz
d2826e3
  it allows hierarchy of configuration files and a bit better error handling
d2826e3
- update URL as upstream is now on github
d2826e3
- make the RedHat bugzilla default, s/bugz/pybugz/ in manpage
d2826e3
- fedora-review fixes: s/define/global/, BR python2-devel, noreplace
d2826e3
- mention in documentation the ~/.bugzrc file
d2826e3
- switch the binary name to 'bugz' again, it would mislead users (see merge
d2826e3
  review bug comment)
d2826e3
d2826e3
* Mon Oct 01 2012 Pavel Raiskup <praiskup@redhat.com> - 0.10-1
d2826e3
- rebase to 0.10
d2826e3
- use the 'pybugz' rather then bugz which collides a little with 'bugzilla'
d2826e3
d2826e3
* Tue Nov 30 2010 Pierre Carrier <prc@redhat.com> - 0.8.0-1
d2826e3
- Initial packaging