From e554eca873c6bfc3a963be80825fa35fa85f3767 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Jul 31 2018 11:44:45 +0000
Subject: [PATCH 1/6] requirements.txt: bump pygit2 to 0.24.0


As spec file says.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---

diff --git a/requirements.txt b/requirements.txt
index f83dfd3..8e434ca 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -17,7 +17,7 @@ markdown
 munch
 Pillow
 psutil
-pygit2 >= 0.22.1
+pygit2 >= 0.24.0
 pygments
 python-openid
 python-openid-cla

From 838f69d141bd49ecf37af2e4eb9f35b07d5330c7 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Jul 31 2018 11:44:45 +0000
Subject: [PATCH 2/6] packaging: sync with spec from fedora


Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---

diff --git a/files/pagure.spec b/files/pagure.spec
index 66dfec9..74b62cd 100644
--- a/files/pagure.spec
+++ b/files/pagure.spec
@@ -1,16 +1,14 @@
+%{?python_enable_dependency_generator}
 %if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
 %global python_pkgversion %{nil}
 %else
 %global python_pkgversion 2
 %endif
 
-# Minimum pygit2 version we support
-%global min_pygit2_version 0.24.0
-
 
 Name:               pagure
-Version:            4.0.1
-Release:            1%{?dist}
+Version:            4.0.4
+Release:            2%{?dist}
 Summary:            A git-centered forge
 
 License:            GPLv2+
@@ -23,38 +21,29 @@ BuildRequires:      systemd-devel
 BuildRequires:      systemd
 BuildRequires:      python%{python_pkgversion}-devel
 BuildRequires:      python%{python_pkgversion}-setuptools
-BuildRequires:      python%{python_pkgversion}-bcrypt
-
-BuildRequires:      python%{python_pkgversion}-alembic
-BuildRequires:      python%{python_pkgversion}-arrow
-BuildRequires:      python%{python_pkgversion}-binaryornot
-BuildRequires:      python%{python_pkgversion}-bleach
-BuildRequires:      python%{python_pkgversion}-blinker
-BuildRequires:      python%{python_pkgversion}-chardet
-BuildRequires:      python%{python_pkgversion}-cryptography
-BuildRequires:      python%{python_pkgversion}-docutils
-BuildRequires:      python%{python_pkgversion}-flask
-BuildRequires:      python%{python_pkgversion}-flask-wtf
-BuildRequires:      python%{python_pkgversion}-flask-multistatic
-BuildRequires:      python%{python_pkgversion}-markdown
-BuildRequires:      python%{python_pkgversion}-nose
-BuildRequires:      python%{python_pkgversion}-psutil
-BuildRequires:      python%{python_pkgversion}-pygit2 >= %{min_pygit2_version}
-BuildRequires:      python%{python_pkgversion}-pygments
-BuildRequires:      python%{python_pkgversion}-fedora
-BuildRequires:      python%{python_pkgversion}-openid
-BuildRequires:      python%{python_pkgversion}-openid-cla
-BuildRequires:      python%{python_pkgversion}-openid-teams
-BuildRequires:      python%{python_pkgversion}-straight-plugin
-BuildRequires:      python%{python_pkgversion}-wtforms
-BuildRequires:      python%{python_pkgversion}-munch
-BuildRequires:      python%{python_pkgversion}-enum34
-BuildRequires:      python%{python_pkgversion}-redis
-
-BuildRequires:      python%{python_pkgversion}-sqlalchemy > 0.8
-Requires:           python%{python_pkgversion}-sqlalchemy > 0.8
+%if 0%{?el6}
+BuildRequires:      python%{python_pkgversion}-sqlalchemy >= 0.8
+BuildRequires:      python%{python_pkgversion}-jinja2 >= 2.4
+%endif
 
+%if 0%{?el6}
+# Needed only for local authentication and/or Pagure CI
+Requires:           python%{python_pkgversion}-cryptography
+# Required only for the `local` authentication backend
 Requires:           python%{python_pkgversion}-bcrypt
+# Required only for the `fas` and `openid` authentication backends
+Requires:           python%{python_pkgversion}-fedora
+# Required only for the `oidc` authentication backend
+# flask-oidc
+# Required only if `USE_FLASK_SESSION_EXT` is set to `True`
+# flask-session
+%else
+Recommends:         python%{python_pkgversion}-cryptography
+Recommends:         python%{python_pkgversion}-bcrypt
+Recommends:         python%{python_pkgversion}-fedora
+%endif
+
+%if %{undefined python_enable_dependency_generator}
 Requires:           python%{python_pkgversion}-alembic
 Requires:           python%{python_pkgversion}-arrow
 Requires:           python%{python_pkgversion}-binaryornot
@@ -62,25 +51,27 @@ Requires:           python%{python_pkgversion}-bleach
 Requires:           python%{python_pkgversion}-blinker
 Requires:           python%{python_pkgversion}-celery
 Requires:           python%{python_pkgversion}-chardet
-Requires:           python%{python_pkgversion}-cryptography
 Requires:           python%{python_pkgversion}-docutils
 Requires:           python%{python_pkgversion}-enum34
 Requires:           python%{python_pkgversion}-flask
-Requires:           python%{python_pkgversion}-flask-wtf
 Requires:           python%{python_pkgversion}-flask-multistatic
+Requires:           python%{python_pkgversion}-flask-wtf
 Requires:           python%{python_pkgversion}-markdown
+Requires:           python%{python_pkgversion}-munch
 Requires:           python%{python_pkgversion}-pillow
 Requires:           python%{python_pkgversion}-psutil
-Requires:           python%{python_pkgversion}-pygit2 >= %{min_pygit2_version}
+Requires:           python%{python_pkgversion}-pygit2 >= 0.24.0
 Requires:           python%{python_pkgversion}-pygments
-Requires:           python%{python_pkgversion}-fedora
 Requires:           python%{python_pkgversion}-openid
 Requires:           python%{python_pkgversion}-openid-cla
 Requires:           python%{python_pkgversion}-openid-teams
+Requires:           python%{python_pkgversion}-redis
+Requires:           python%{python_pkgversion}-requests
+Requires:           python%{python_pkgversion}-six
+Requires:           python%{python_pkgversion}-sqlalchemy >= 0.8
 Requires:           python%{python_pkgversion}-straight-plugin
 Requires:           python%{python_pkgversion}-wtforms
-Requires:           python%{python_pkgversion}-munch
-Requires:           python%{python_pkgversion}-redis
+%endif
 
 %if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
 Requires:           mod_wsgi
@@ -119,6 +110,7 @@ This is useful for example to allow commenting on a ticket by email.
 Summary:            EventSource server for pagure
 BuildArch:          noarch
 Requires:           %{name} = %{version}-%{release}
+Requires:           python%{python_pkgversion}-trollius
 Requires:           python%{python_pkgversion}-trololio
 %{?systemd_requires}
 %description        ev
@@ -129,6 +121,8 @@ supporting it. This package provides it.
 %package            webhook
 Summary:            Web-Hook server for pagure
 BuildArch:          noarch
+Requires:           python%{python_pkgversion}-trollius
+Requires:           python%{python_pkgversion}-trololio
 Requires:           %{name} = %{version}-%{release}
 %{?systemd_requires}
 %description        webhook
@@ -140,7 +134,10 @@ done on a project. This package provides it.
 Summary:            A CI service for pagure
 BuildArch:          noarch
 Requires:           %{name} = %{version}-%{release}
+Requires:           python%{python_pkgversion}-cryptography
 Requires:           python%{python_pkgversion}-jenkins
+Requires:           python%{python_pkgversion}-trollius
+Requires:           python%{python_pkgversion}-trololio
 %{?systemd_requires}
 %description        ci
 Pagure comes with a continuous integration service, currently supporting
@@ -171,7 +168,10 @@ in the future pull-requests) git repo.
 
 
 %prep
-%setup -q
+%autosetup -p1
+%if ! 0%{?el6}
+sed -i -e "/__requires__/d" setup.py
+%endif
 
 # In case it gets broken in git at least the rpm will be good
 chmod +x pagure/hooks/files/*

From 5d979b255eb5b6aa07cb466a349ae31011d3eee6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Jul 31 2018 11:44:45 +0000
Subject: [PATCH 3/6] drop el6 bits


Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---

diff --git a/files/pagure.spec b/files/pagure.spec
index 74b62cd..1bed23b 100644
--- a/files/pagure.spec
+++ b/files/pagure.spec
@@ -21,12 +21,8 @@ BuildRequires:      systemd-devel
 BuildRequires:      systemd
 BuildRequires:      python%{python_pkgversion}-devel
 BuildRequires:      python%{python_pkgversion}-setuptools
-%if 0%{?el6}
-BuildRequires:      python%{python_pkgversion}-sqlalchemy >= 0.8
-BuildRequires:      python%{python_pkgversion}-jinja2 >= 2.4
-%endif
 
-%if 0%{?el6}
+%if 0%{?rhel} && 0%{?rhel} <= 7
 # Needed only for local authentication and/or Pagure CI
 Requires:           python%{python_pkgversion}-cryptography
 # Required only for the `local` authentication backend
@@ -169,9 +165,6 @@ in the future pull-requests) git repo.
 
 %prep
 %autosetup -p1
-%if ! 0%{?el6}
-sed -i -e "/__requires__/d" setup.py
-%endif
 
 # In case it gets broken in git at least the rpm will be good
 chmod +x pagure/hooks/files/*
diff --git a/setup.py b/setup.py
index 64f8804..2e971c6 100644
--- a/setup.py
+++ b/setup.py
@@ -4,9 +4,6 @@
 Setup script
 """
 
-# Required to build on EL6
-__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']
-import pkg_resources
 import os
 import re
 

From c4067c7ddb72c569542ccece3ad4a5f33f467f7d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Jul 31 2018 11:44:45 +0000
Subject: [PATCH 4/6] trollius → trololio


Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---

diff --git a/dev/ansible/roles/pagure-dev/tasks/eventsource.yml b/dev/ansible/roles/pagure-dev/tasks/eventsource.yml
index ddca01e..943f986 100644
--- a/dev/ansible/roles/pagure-dev/tasks/eventsource.yml
+++ b/dev/ansible/roles/pagure-dev/tasks/eventsource.yml
@@ -4,7 +4,7 @@
   dnf: name={{ item }} state=present
   with_items:
     - python-redis
-    - python-trollius
+    - python-trololio
     - redis
 
 
diff --git a/dev/docker/ev b/dev/docker/ev
index 82268a9..856992b 100644
--- a/dev/docker/ev
+++ b/dev/docker/ev
@@ -11,7 +11,7 @@ RUN dnf install -y python2-devel python-setuptools python-nose py-bcrypt python-
                    python-pygit2 python-pygments python-fedora python-openid python-openid-cla \
                    python-openid-teams python-straight-plugin python-wtforms python-munch \
                    python-enum34 python-redis python-sqlalchemy systemd gitolite3 python-filelock \
-                   python-fedora-flask python2-pillow python2-psycopg2 python-trollius \
+                   python-fedora-flask python2-pillow python2-psycopg2 python-trololio \
                    python-celery
 
 WORKDIR /code
diff --git a/dev/run-tests-docker.py b/dev/run-tests-docker.py
index cba53eb..c328dda 100755
--- a/dev/run-tests-docker.py
+++ b/dev/run-tests-docker.py
@@ -14,7 +14,7 @@ PKG_LIST = 'python-alembic python-arrow python-binaryornot \ \n'\
            'python-psutil python-pygit2 python-pygments python2-pillow \ \n'\
            'python-sqlalchemy python-straight-plugin python-wtforms python-nose \ \n'\
            'python-coverage python-mock python-mock python-eventlet python2-flask-oidc \ \n'\
-           'python-flake8 python-celery python-redis python-trollius python-beautifulsoup4 redis vim git'
+           'python-flake8 python-celery python-redis python-trololio python-beautifulsoup4 redis vim git'
 
 
 def setup_parser():
diff --git a/doc/install_pagure_ci.rst b/doc/install_pagure_ci.rst
index 9f663f9..3b9ae78 100644
--- a/doc/install_pagure_ci.rst
+++ b/doc/install_pagure_ci.rst
@@ -22,7 +22,7 @@ Configure your system
 
     python-jenkins
     python-redis
-    python-trollius
+    python-trololio
 
 .. note:: We ship a systemd unit file for pagure_ci but we welcome patches
         for scripts for other init systems.
diff --git a/doc/install_pagure_ev.rst b/doc/install_pagure_ev.rst
index 11322c1..614f312 100644
--- a/doc/install_pagure_ev.rst
+++ b/doc/install_pagure_ev.rst
@@ -16,7 +16,7 @@ The eventsource server is easy to set-up.
 ::
 
     python-redis
-    python-trollius
+    python-trololio
 
 .. note:: We ship a systemd unit file for pagure_milter but we welcome patches
         for scripts for other init systems.
diff --git a/doc/install_pagure_loadjson.rst b/doc/install_pagure_loadjson.rst
index b942baa..4b13f06 100644
--- a/doc/install_pagure_loadjson.rst
+++ b/doc/install_pagure_loadjson.rst
@@ -14,7 +14,7 @@ Configure your system
 ::
 
     python-redis
-    python-trollius
+    python-trololio
 
 .. note:: We ship a systemd unit file for pagure_loadjson but we welcome patches
         for scripts for other init systems.
diff --git a/doc/install_pagure_logcom.rst b/doc/install_pagure_logcom.rst
index e1d0859..f92e0b3 100644
--- a/doc/install_pagure_logcom.rst
+++ b/doc/install_pagure_logcom.rst
@@ -14,7 +14,7 @@ Configure your system
 ::
 
     python-redis
-    python-trollius
+    python-trololio
 
 .. note:: We ship a systemd unit file for pagure_logcom but we welcome patches
         for scripts for other init systems.
diff --git a/doc/install_pagure_webhooks.rst b/doc/install_pagure_webhooks.rst
index d2c7ba5..9aff374 100644
--- a/doc/install_pagure_webhooks.rst
+++ b/doc/install_pagure_webhooks.rst
@@ -17,7 +17,7 @@ Configure your system
 ::
 
     python-redis
-    python-trollius
+    python-trololio
 
 .. note:: We ship a systemd unit file for pagure_webhook but we welcome patches
         for scripts for other init systems.
diff --git a/files/pagure.spec b/files/pagure.spec
index 1bed23b..ac4f617 100644
--- a/files/pagure.spec
+++ b/files/pagure.spec
@@ -106,7 +106,6 @@ This is useful for example to allow commenting on a ticket by email.
 Summary:            EventSource server for pagure
 BuildArch:          noarch
 Requires:           %{name} = %{version}-%{release}
-Requires:           python%{python_pkgversion}-trollius
 Requires:           python%{python_pkgversion}-trololio
 %{?systemd_requires}
 %description        ev
@@ -117,8 +116,6 @@ supporting it. This package provides it.
 %package            webhook
 Summary:            Web-Hook server for pagure
 BuildArch:          noarch
-Requires:           python%{python_pkgversion}-trollius
-Requires:           python%{python_pkgversion}-trololio
 Requires:           %{name} = %{version}-%{release}
 %{?systemd_requires}
 %description        webhook
@@ -132,8 +129,6 @@ BuildArch:          noarch
 Requires:           %{name} = %{version}-%{release}
 Requires:           python%{python_pkgversion}-cryptography
 Requires:           python%{python_pkgversion}-jenkins
-Requires:           python%{python_pkgversion}-trollius
-Requires:           python%{python_pkgversion}-trololio
 %{?systemd_requires}
 %description        ci
 Pagure comes with a continuous integration service, currently supporting
diff --git a/requirements-ci.txt b/requirements-ci.txt
index edc7d3b..ce1ba14 100644
--- a/requirements-ci.txt
+++ b/requirements-ci.txt
@@ -1,4 +1,2 @@
 cryptography
 python-jenkins
-trollius
-trololio
diff --git a/requirements-ev.txt b/requirements-ev.txt
index 867a09f..a3d98e4 100644
--- a/requirements-ev.txt
+++ b/requirements-ev.txt
@@ -1,2 +1 @@
-trollius
 trololio
diff --git a/requirements-webhook.txt b/requirements-webhook.txt
index 867a09f..e69de29 100644
--- a/requirements-webhook.txt
+++ b/requirements-webhook.txt
@@ -1,2 +0,0 @@
-trollius
-trololio
diff --git a/tests_requirements.txt b/tests_requirements.txt
index fa39fbb..cffa622 100644
--- a/tests_requirements.txt
+++ b/tests_requirements.txt
@@ -7,7 +7,6 @@ mock
 nose>=0.10.4
 nosexcover
 python-fedora
-trollius
 trololio
 fedmsg
 

From 6da3ef065eddb58769c98f3fb2a3f543e2e5fda0 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Jul 31 2018 11:44:46 +0000
Subject: [PATCH 5/6] packaging: bcrypt and cryptography are not optional


Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---

diff --git a/files/pagure.spec b/files/pagure.spec
index ac4f617..a5e96bb 100644
--- a/files/pagure.spec
+++ b/files/pagure.spec
@@ -23,10 +23,6 @@ BuildRequires:      python%{python_pkgversion}-devel
 BuildRequires:      python%{python_pkgversion}-setuptools
 
 %if 0%{?rhel} && 0%{?rhel} <= 7
-# Needed only for local authentication and/or Pagure CI
-Requires:           python%{python_pkgversion}-cryptography
-# Required only for the `local` authentication backend
-Requires:           python%{python_pkgversion}-bcrypt
 # Required only for the `fas` and `openid` authentication backends
 Requires:           python%{python_pkgversion}-fedora
 # Required only for the `oidc` authentication backend
@@ -34,19 +30,19 @@ Requires:           python%{python_pkgversion}-fedora
 # Required only if `USE_FLASK_SESSION_EXT` is set to `True`
 # flask-session
 %else
-Recommends:         python%{python_pkgversion}-cryptography
-Recommends:         python%{python_pkgversion}-bcrypt
 Recommends:         python%{python_pkgversion}-fedora
 %endif
 
 %if %{undefined python_enable_dependency_generator}
 Requires:           python%{python_pkgversion}-alembic
 Requires:           python%{python_pkgversion}-arrow
+Requires:           python%{python_pkgversion}-bcrypt
 Requires:           python%{python_pkgversion}-binaryornot
 Requires:           python%{python_pkgversion}-bleach
 Requires:           python%{python_pkgversion}-blinker
 Requires:           python%{python_pkgversion}-celery
 Requires:           python%{python_pkgversion}-chardet
+Requires:           python%{python_pkgversion}-cryptography
 Requires:           python%{python_pkgversion}-docutils
 Requires:           python%{python_pkgversion}-enum34
 Requires:           python%{python_pkgversion}-flask
diff --git a/requirements.txt b/requirements.txt
index 8e434ca..87fc751 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,11 +2,13 @@
 # Use this file by running "$ pip install -r requirements.txt"
 alembic
 arrow
+bcrypt
 binaryornot
 bleach
 blinker
 celery
 chardet
+cryptography
 docutils
 enum34
 flask<1.0
@@ -31,9 +33,6 @@ sqlalchemy >= 0.8
 straight.plugin
 wtforms
 
-# Needed only for local authentication and/or Pagure CI
-# cryptography
-
 # Required only for the `oidc` authentication backend
 # flask-oidc
 
@@ -42,7 +41,3 @@ wtforms
 
 # Required only for the `fas` and `openid` authentication backends
 # python-fedora
-
-# Required only for the `local` authentication backend
-# bcrypt
-

From c5f817c0e91a4795a45bf6199c9baaaaa6f0da91 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Jul 31 2018 11:46:40 +0000
Subject: [PATCH 6/6] python-fedora → python-fedora-flask


Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

---

diff --git a/files/pagure.spec b/files/pagure.spec
index a5e96bb..8d0e93e 100644
--- a/files/pagure.spec
+++ b/files/pagure.spec
@@ -24,13 +24,13 @@ BuildRequires:      python%{python_pkgversion}-setuptools
 
 %if 0%{?rhel} && 0%{?rhel} <= 7
 # Required only for the `fas` and `openid` authentication backends
-Requires:           python%{python_pkgversion}-fedora
+Requires:           python%{python_pkgversion}-fedora-flask
 # Required only for the `oidc` authentication backend
 # flask-oidc
 # Required only if `USE_FLASK_SESSION_EXT` is set to `True`
 # flask-session
 %else
-Recommends:         python%{python_pkgversion}-fedora
+Recommends:         python%{python_pkgversion}-fedora-flask
 %endif
 
 %if %{undefined python_enable_dependency_generator}

