#68 Revise the pagure-dist-git spec to build similarly to Pagure itself
Merged 7 years ago by pingou. Opened 7 years ago by ngompa.
ngompa/pagure-dist-git spec-rework-and-reqs-update  into  master

file modified
+2 -2
@@ -3,8 +3,8 @@ 

  

  .. split here

  

- This project implements a dynamic Git auth backend for Pagure for Fedora and CentOS

- dist-git setups, which have slightly different access models than standard on Pagure.

+ This project implements a dynamic Git auth backend for Pagure for Dist-Git,

+ which has a slightly different access model than regular Pagure Git systems.

  

  Configuration

  =============

file modified
+47 -83
@@ -1,93 +1,65 @@ 

- # Python3 packaging is turned off until pagure itself is ported to python3.

- %global with_python3 1

- 

- # Current EL releases & older Fedora use "python-*"

- %if 0%{?el6} || 0%{?el7} || 0%{?fedora} < 25

- %define py_prefix python

- %global with_python3 0

- %if 0%{?el6} || 0%{?el7}

- BuildRequires: python-devel

+ %{?python_enable_dependency_generator}

+ 

+ %if 0%{?rhel} && 0%{?rhel} < 8

+ # Since the Python 3 stack in EPEL is missing too many dependencies,

+ # we're sticking with Python 2 there for now.

+ # And Pagure in Fedora 28 and lower is built for Python 2...

+ %global __python %{__python2}

+ %global python_pkgversion 2

+ %global python_version %{python2_version}

  %else

- BuildRequires: python2-devel

+ # Default to Python 3 when F29+

+ %global __python %{__python3}

+ %global python_pkgversion %{python3_pkgversion}

+ %global python_version %{python3_version}

  %endif

- %else

- # Newer Fedora releases use "pythonX-*"

- %define py_prefix python2

- BuildRequires: python2-devel

- %endif

- 

  

- %{!?_licensedir: %global license %%doc}

- 

- %global modname pagure-dist-git

- %global sum     Pagure Git auth backend for Fedora and CentOS dist-git setups

+ # For now, to keep behavior consistent (and matching pagure package)

+ %global _python_bytecompile_extra 1

  

  Name:               pagure-dist-git

  Version:            1.2

  Release:            1%{?dist}

- Summary:            %{sum}

+ Summary:            Pagure Git auth backend for Dist-Git setups

  

  License:            GPLv2+

- URL:                http://pypi.python.org/pypi/pagure-dist-git

- Source0:            https://pypi.io/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz

+ URL:                https://pagure.io/pagure-dist-git

+ Source0:            https://releases.pagure.org/%{name}/%{name}-%{version}.tar.gz

  BuildArch:          noarch

- # https://fedoraproject.org/wiki/Packaging:Guidelines#Noarch_with_Unported_Dependencies

- ExclusiveArch:      x86_64 noarch

- 

- 

- %description

- This implements access control list checks for Fedora and CentOS dist-git.

  

- %package -n %{py_prefix}-%{modname}

- Summary:            Pagure Git auth backend for Fedora and CentOS dist-git

- %{?python_provide:%python_provide python2-%{modname}}

+ BuildRequires:      python%{python_pkgversion}-devel

+ BuildRequires:      python%{python_pkgversion}-setuptools

  

- BuildRequires:      %{py_prefix}-devel

- BuildRequires:      %{py_prefix}-setuptools

- # For tests

- BuildRequires:      %{py_prefix}-mock

- BuildRequires:      %{py_prefix}-pdc-client

- BuildRequires:      %{py_prefix}-nose

- BuildRequires:      pagure >= 5.2

+ %if %{rhel} && 0%{?rhel} < 8

+ Requires:           python%{python_pkgversion}-pdc-client

  

  Requires:           pagure >= 5.2

+ %endif

  

- %description -n %{py_prefix}-%{modname}

- This implements access control list checks for Fedora and CentOS dist-git.

- 

- %if 0%{?with_python3}

- %package -n python3-%{modname}

- Summary:            Pagure Git auth backend for Fedora and CentOS dist-git

- %{?python_provide:%python_provide python3-%{modname}}

- 

- BuildRequires:      python3-devel

- BuildRequires:      python3-setuptools

- # For tests

- BuildRequires:      python3-mock

- BuildRequires:      python3-pdc-client

- BuildRequires:      python3-nose

- BuildRequires:      pagure >= 5.1

+ # This is actually an extension to Pagure itself and can't be built this way

+ # So we're changing it all up..

+ Obsoletes:          python-%{name} < 1.2-2

+ Obsoletes:          python2-%{name} < 1.2-2

+ Obsoletes:          python3-%{name} < 1.2-2

+ # However, we'll preserve some backwards compatibility here

+ Provides:           python%{python_pkgversion}-%{name} = %{version}-%{release}

  

- Requires:           python3-pagure >= 5.1

+ %description

+ This project hosts the logic to generate gitolite's configuration file for

+ Dist-Git, which has a different access model than regular Pagure Git systems.

  

- %description -n python3-%{modname}

- This implements access control list checks for Fedora and CentOS dist-git.

- %endif

  

  %prep

- %autosetup -n %{modname}-%{version}

+ %autosetup

+ 

  

  %build

- %py2_build

- %if 0%{?with_python3}

- %py3_build

- %endif

+ %py_build

+ 

  

  %install

- %py2_install

- %if 0%{?with_python3}

- %py3_install

- %endif

+ %py_install

+ 

  

  # Install the different cron job scripts

  mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/pagure-dist-git/
@@ -97,27 +69,19 @@ 

  %check

  # These tests don't currently pass because Pagure doesn't ship its testsuite

  exit 0

- nosetests -v

- %if 0%{?with_python3}

- nosetests-3 -v

- %endif

+ nosetests-%{python_version} -v

  

- %files -n %{py_prefix}-%{modname}

- %doc README.rst

- %license LICENSE

- %{python2_sitelib}/dist_git_auth.py*

- %{python2_sitelib}/pagure_dist_git-%{version}*

- %{_libexecdir}/pagure-dist-git/

  

- %if 0%{?with_python3}

- %files -n python3-%{modname}

+ %files

  %doc README.rst

  %license LICENSE

- %{python3_sitelib}/dist_git_auth.py*

- %{python3_sitelib}/__pycache__/*

- %{python3_sitelib}/pagure_dist_git-%{version}*

- %{_libexecdir}/pagure-dist-git/

+ %{python_sitelib}/dist_git_auth.py*

+ %{python_sitelib}/pagure_dist_git-%{version}*

+ %if 0%{?python_pkgversion} != 2

+ %{python3_sitelib}/__pycache__/dist_git_auth*.pyc

  %endif

+ %{_datadir}/pagure_dist_git/

+ %{_libexecdir}/pagure-dist-git/

  

  

  %changelog

file modified
+2 -2
@@ -6,7 +6,7 @@ 

  f.close()

  

  install_requires = [

-     'pagure',

+     'pagure>=5.2',

  ]

  tests_require = [

      'nose',
@@ -16,7 +16,7 @@ 

  setup(

      name='pagure-dist-git',

      version='1.2',

-     description="Pagure Git auth backend for Fedora and CentOS dist-git",

+     description="Pagure Git auth backend for Dist-Git setups",

      long_description=long_description,

      author='Pierre-Yves Chibon',

      author_email='pingou@fedoraproject.org',

We don't build Pagure for both Python versions, so there's no reason
to do the same for pagure-dist-git. In addition, the spec is greatly
simplified now and is compatible with Pagure instances running on Fedora
in Python 3.

Finally, the setuptools data has been updated to indicate the correct
minimum version of Pagure this is compatible with and a similar
description to what is used in the spec file.

Signed-off-by: Neal Gompa ngompa13@gmail.com

rebased onto b0d19d2d38d0e448152f4fafc1c6aa05ac939027

7 years ago

rebased onto c90b8ece6fb0d0bf74119068888d2f2971e71c11

7 years ago

rebased onto 24c2e8e6e88dc9e82ecd5d3b8f5af8c32eaa73b1

7 years ago

rebased onto 40fe1f9451ca3b5fca4c9580251bd57ff304064b

7 years ago

rebased onto ba0bda5c6f900f71a40c3f8899295d68a3999a45

7 years ago

rebased onto 76b3de9

7 years ago

Pull-Request has been merged by pingou

7 years ago