Blob Blame 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:    14.%{posttag}%{?dist}
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
cp man/bugz.1 %{buildroot}%{_mandir}/man1/bugz.1
mkdir -p %{buildroot}%{_docdir}


%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
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-14.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-13.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.11-12.git3459d
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-11.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-10.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-9.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.11-8.git3459d
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-7.git3459d
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-6.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Dec 03 2015 Pavel Raiskup <praiskup@redhat.com> - 0.11-5.git3459d
- fix rpmbuild --short-circuit

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-4.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* 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