Blob Blame History Raw
%global gitrev 3459d
%global posttag git%{gitrev}
%global snapshot %{version}-%{posttag}

Name:       pybugz
Summary:    Command line interface for Bugzilla written in Python
Version:    0.11
Release:    3.%{posttag}%{?dist}
Group:      Applications/Communications
License:    GPLv2
URL:        https://github.com/williamh/pybugz
BuildArch:  noarch

Requires:       python3
BuildRequires:  python3-devel

Patch0:     rh-default.patch

%if ! 0%{?rhel}
# no bash-completion for RHEL
%global bash_completion 1
%endif

%if 0%{?bash_completion}
BuildRequires: bash-completion pkgconfig
%endif

# There is possible to download upstream tarball generated by github, but it is
# quite old now.  For HOWTO obtain correct tarball see the "prepare-tarball.sh"
# script (in dist-git).
Source0: %{name}-%{snapshot}.tar.gz

%description
Pybugz was conceived as a tool to speed up the work-flow for Gentoo Linux
contributors when dealing with bugs using Bugzilla.  By avoiding the clunky web
interface, the user can search, isolate and contribute to the project very
quickly.  Developers alike can easily extract attachments and close bugs
comfortably from the command line.

%prep
%autosetup -p1 -n %{name}-%{snapshot}

%build
%{__python3} setup.py build

%install
# default install process
%{__python3} setup.py install --root=%{buildroot}

%global bash_cmpl_dir %(pkg-config --variable=completionsdir bash-completion)
%if 0%{?bash_completion}
  # find the proper directory to install bash-completion script
  mkdir -p %{buildroot}%{bash_cmpl_dir}
  cp %{_builddir}/%{name}-%{snapshot}/contrib/bash-completion \
     %{buildroot}%{bash_cmpl_dir}/bugz
%endif

mkdir -p %{buildroot}%{_mandir}/man1
mv man/bugz.1 %{buildroot}%{_mandir}/man1/bugz.1
mkdir -p %{buildroot}%{_docdir}

%clean

%files
%{_bindir}/bugz
%{python3_sitelib}/bugz
%if 0%{?bash_completion}
  %{bash_cmpl_dir}/bugz
%endif
%{python3_sitelib}/%{name}-*.egg-info
%{_mandir}/man1/bugz.1.gz
%{_datadir}/pybugz.d/
%{_mandir}/man5/*
%doc README LICENSE

%changelog
* Mon Oct 19 2015 Pavel Raiskup <praiskup@redhat.com> - 0.11-3.git3459d
- setup default connection to 'RedHat'

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-2.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Dec 18 2014 Pavel Raiskup <praiskup@redhat.com> - 0.11-1.git3459d
- rebase to recent git HEAD pybugz version

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-6.git683dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-5.git683dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Mar 13 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10-4.git683dd
- fix the macro problem for epel

* Wed Mar 13 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10-3.git683dd
- remove downstream patches for now - I'll reapply again if it becomes upstream
- package the latest git version

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-2.git89df2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Jan 20 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10-1.git89df2
- changes for problems spotted/fixed by Scott Tsai in merge-review bug:
- important change - move git revision behind the release number
- reflect that ^^^ change in changelog
- remove statement disabling debuginfo (it is not needed)

* Sun Jan 20 2013 Pavel Raiskup <praiskup@redhat.com> - 0.10git69cd7-1
- apply downstream patches to reflect https://github.com/praiskup/pybugz
  it allows hierarchy of configuration files and a bit better error handling
- update URL as upstream is now on github
- make the RedHat bugzilla default, s/bugz/pybugz/ in manpage
- fedora-review fixes: s/define/global/, BR python2-devel, noreplace
- mention in documentation the ~/.bugzrc file
- switch the binary name to 'bugz' again, it would mislead users (see merge
  review bug comment)

* Mon Oct 01 2012 Pavel Raiskup <praiskup@redhat.com> - 0.10-1
- rebase to 0.10
- use the 'pybugz' rather then bugz which collides a little with 'bugzilla'

* Tue Nov 30 2010 Pierre Carrier <prc@redhat.com> - 0.8.0-1
- Initial packaging