#1 Clean up the fedmsg specfile and add Python 3 packages
Merged 2 years ago by jcline. Opened 2 years ago by jcline.
rpms/ jcline/fedmsg master  into  master

@@ -0,0 +1,14 @@ 

+ [Unit]

+ Description=Outbound fedmsg gateway

+ After=network.target

+ Documentation=https://fedmsg.readthedocs.org/

+ 

+ [Service]

+ ExecStart=/usr/bin/fedmsg-gateway-3

+ Type=simple

+ User=fedmsg

+ Group=fedmsg

+ Restart=on-failure

+ 

+ [Install]

+ WantedBy=multi-user.target

file added
+14

@@ -0,0 +1,14 @@ 

+ [Unit]

+ Description=Generic fedmsg processing hub

+ After=network.target

+ Documentation=https://fedmsg.readthedocs.org/

+ 

+ [Service]

+ ExecStart=/usr/bin/fedmsg-hub-3

+ Type=simple

+ User=fedmsg

+ Group=fedmsg

+ Restart=on-failure

+ 

+ [Install]

+ WantedBy=multi-user.target

file added
+14

@@ -0,0 +1,14 @@ 

+ [Unit]

+ Description=IRC bot for fedmsg

+ After=network.target

+ Documentation=https://fedmsg.readthedocs.org/

+ 

+ [Service]

+ ExecStart=/usr/bin/fedmsg-irc-3

+ Type=simple

+ User=fedmsg

+ Group=fedmsg

+ Restart=on-failure

+ 

+ [Install]

+ WantedBy=multi-user.target

file removed
-36

@@ -1,36 +0,0 @@ 

- From 42c4812184cffabbeb41f43b9a9b8156756cda1f Mon Sep 17 00:00:00 2001

- From: Ralph Bean <rbean@redhat.com>

- Date: Thu, 10 Nov 2016 12:45:07 -0500

- Subject: [PATCH] Workaround odd change in M2Crypto==0.25.1

- 

- I verified with `tox` that our code worked fine on `M2Crypto==0.23.0`, but

- failed on `M2Crypto==0.25.1`.  For some reason, the header information at the

- beginning of our cert files trips up the latest version.  The code change here

- simply strips out that header information before passing the actual encoded

- certificate on to M2Crypto.

- ---

-  fedmsg/crypto/x509.py | 10 ++++++----

-  1 file changed, 6 insertions(+), 4 deletions(-)

- 

- diff --git a/fedmsg/crypto/x509.py b/fedmsg/crypto/x509.py

- index 42a28a8..8fdf63b 100644

- --- a/fedmsg/crypto/x509.py

- +++ b/fedmsg/crypto/x509.py

- @@ -65,11 +65,13 @@ def sign(message, ssldir=None, certname=None, **config):

-  

-      message['crypto'] = 'x509'

-  

- -    certificate = M2Crypto.X509.load_cert(

- -        "%s/%s.crt" % (ssldir, certname)).as_pem()

- +    marker = "-----BEGIN CERTIFICATE-----"

- +    with open("%s/%s.crt" % (ssldir, certname), 'r') as f:

- +        content = marker + f.read().split(marker)[-1]

- +        certificate = M2Crypto.X509.load_cert_string(content).as_pem()

- +

-      # Opening this file requires elevated privileges in stg/prod.

- -    rsa_private = M2Crypto.RSA.load_key(

- -        "%s/%s.key" % (ssldir, certname))

- +    rsa_private = M2Crypto.RSA.load_key("%s/%s.key" % (ssldir, certname))

-  

-      digest = M2Crypto.EVP.MessageDigest('sha1')

-      digest.update(fedmsg.encoding.dumps(message))

@@ -0,0 +1,14 @@ 

+ [Unit]

+ Description=fedmsg active<->passive relay

+ After=network.target

+ Documentation=https://fedmsg.readthedocs.org/

+ 

+ [Service]

+ ExecStart=/usr/bin/fedmsg-relay-3

+ Type=simple

+ User=fedmsg

+ Group=fedmsg

+ Restart=on-failure

+ 

+ [Install]

+ WantedBy=multi-user.target

file modified
+308 -396

@@ -1,180 +1,68 @@ 

- # Recently, I split fedmsg into a number of subpackages in order to facilitate

- # the rise of python3.  Here's a rough sketch of the deps between the

- # subpackages.

- #

- #

- #                   fedmsg-base

- #                       |

- #     +-----------------+-------------+

- #     V                               V

- # python2-fedmsg-core        python3-fedmsg-core

- #     |

- #     |

- #     +----------------+-------------------------+

- #     |                |                         |

- #     |                V                         V

- #     |      python2-fedmsg-consumers   python2-fedmsg-commands

- #     |                |                         |

- #     |                |                         |

- #   fedmsg <-----------+-------------------------+

- #     |

- #     V

- #   fedmsg-hub,relay,gateway,etc...

- 

- # We're not **quite** ready to build python34 on epel yet.

- %if 0%{?fedora}

- %global with_python3 1

- %endif

- 

- %{!?pyver: %global pyver %(%{__python} -c "import sys ; print sys.version[:3]")}

- 

  %global modname fedmsg

  

  Name:           fedmsg

- Version:        0.19.0

- Release:        2%{?dist}

+ Version:        1.0.0

+ Release:        1%{?dist}

  Summary:        Tools for Fedora Infrastructure real-time messaging

  License:        LGPLv2+

- URL:            http://github.com/fedora-infra/fedmsg

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

- Source1:        %{name}-tmpfiles.conf

- 

+ URL:            https://github.com/fedora-infra/fedmsg

  BuildArch:      noarch

+ Source0:        %{url}/archive/%{version}/%{modname}-%{version}.tar.gz

+ Source1:        %{name}-tmpfiles.conf

+ Source2:        fedmsg-gateway-3.service

+ Source3:        fedmsg-hub-3.service

+ Source4:        fedmsg-irc-3.service

+ Source5:        fedmsg-relay-3.service

  

- # This is an old command/subpackage that has since been retired

- Obsoletes:      fedmsg-tweet

- 

- BuildRequires:  python-devel

- BuildRequires:  python-setuptools

  

- # For tests

- BuildRequires:  python2-pytest

- BuildRequires:  python-nose

- BuildRequires:  python-six

- BuildRequires:  python-mock

- BuildRequires:  python-sqlalchemy

  BuildRequires:  gnupg

+ %{?systemd_requires}

+ BuildRequires:  systemd

+ 

+ # Docs requirements

+ BuildRequires:  python3-sphinx

  

+ # Python 2 requirements

+ BuildRequires:  python2-arrow

  BuildRequires:  python2-click

- BuildRequires:  python-moksha-hub >= 1.3.2

- BuildRequires:  python-requests

  BuildRequires:  python2-cryptography >= 1.6

+ BuildRequires:  python2-devel

+ BuildRequires:  python2-kitchen

+ BuildRequires:  python2-mock

+ BuildRequires:  python2-moksha-hub >= 1.3.2

+ BuildRequires:  python2-setuptools

+ BuildRequires:  python2-six

+ BuildRequires:  python2-sqlalchemy

+ BuildRequires:  python2-pytest

+ BuildRequires:  python2-requests

  BuildRequires:  python2-pyOpenSSL >= 16.1.0

- BuildRequires:  python-pygments

- BuildRequires:  python-psutil

- BuildRequires:  python-arrow

- BuildRequires:  python-kitchen

- 

- %if 0%{?with_python3}

- BuildRequires:  python%{python3_pkgversion}-devel

- BuildRequires:  python%{python3_pkgversion}-setuptools

- BuildRequires:  python%{python3_pkgversion}-devel

- BuildRequires:  python%{python3_pkgversion}-setuptools

- #BuildRequires:  python%{python3_pkgversion}-moksha-hub >= 1.3.2

- BuildRequires:  python%{python3_pkgversion}-requests

- BuildRequires:  python%{python3_pkgversion}-cryptography

- BuildRequires:  python%{python3_pkgversion}-arrow

- BuildRequires:  python%{python3_pkgversion}-kitchen

- %endif

- 

- # This doesn't exist on F21.

- %if 0%{?fedora} && 0%{?fedora} >= 22

- BuildRequires:  python3-rpm-macros

- %endif

- 

- %if 0%{?rhel} && 0%{?rhel} >= 7

+ BuildRequires:  python2-pygments

+ BuildRequires:  python2-psutil

+ 

+ # Python 3 requirements

+ BuildRequires:  python3-arrow

+ BuildRequires:  python3-click

+ BuildRequires:  python3-cryptography >= 1.6

+ BuildRequires:  python3-devel

+ BuildRequires:  python3-kitchen

+ BuildRequires:  python3-mock

+ BuildRequires:  python3-moksha-hub >= 1.3.2

+ BuildRequires:  python3-setuptools

+ BuildRequires:  python3-six

+ BuildRequires:  python3-sqlalchemy

+ BuildRequires:  python3-pytest

+ BuildRequires:  python3-requests

  BuildRequires:  python3-rpm-macros

- %endif

- 

- %if 0%{?rhel} && 0%{?rhel} <= 6

- BuildRequires:  python-ordereddict

- BuildRequires:  python-argparse

- BuildRequires:  python-logutils

- %endif

- 

- %if 0%{?rhel} && 0%{?rhel} <= 6

- # On rhel, we don't need systemd to build.  but we do on fedora.

- %else

- BuildRequires:  systemd

- %endif

- 

+ BuildRequires:  python3-pyOpenSSL >= 16.1.0

+ BuildRequires:  python3-pygments

+ BuildRequires:  python3-psutil

  # Finally, make the 'fedmsg' master package require all these components

- Requires:       python2-fedmsg-core = %{version}-%{release}

- Requires:       python2-fedmsg-commands = %{version}-%{release}

- Requires:       python2-fedmsg-consumers = %{version}-%{release}

+ Requires:       python2-fedmsg = %{version}-%{release}

  

  %description

  Python API used around Fedora Infrastructure to send and receive messages with

  zeromq.  Includes some CLI tools.

  

- %package -n python2-fedmsg-core

- Summary:        Core python API for fedmsg

- %{?python_provide:%python_provide python2-fedmsg-core}

- 

- Requires:       python-six

- Requires:       python-zmq

- Requires:       python-requests

- Requires:       python-arrow

- Requires:       python-kitchen

- Requires:       python2-cryptography >= 1.6

- Requires:       python2-pyOpenSSL >= 16.1.0

- Requires:       fedmsg-base = %{version}-%{release}

- 

- %if 0%{?rhel} && 0%{?rhel} <= 6

- Requires:       python-ordereddict

- Requires:       python-argparse

- %endif

- 

- %description -n python2-fedmsg-core

- Core Python API used around Fedora Infrastructure to send and receive messages

- with zeromq.

- 

- %if 0%{?with_python3}

- %package -n python%{python3_pkgversion}-fedmsg-core

- Summary:    Core python%{python3_pkgversion} API for fedmsg

- 

- Requires:       python%{python3_pkgversion}-six

- Requires:       python%{python3_pkgversion}-zmq

- Requires:       python%{python3_pkgversion}-requests

- Requires:       python%{python3_pkgversion}-arrow

- Requires:       python%{python3_pkgversion}-kitchen

- Requires:       python%{python3_pkgversion}-cryptography >= 1.6

- Requires:       python%{python3_pkgversion}-pyOpenSSL >= 16.1.0

- Requires:       fedmsg-base = %{version}-%{release}

- 

- %description -n python%{python3_pkgversion}-fedmsg-core

- Core python%{python3_pkgversion} API used around Fedora Infrastructure to send

- and receive messages with zeromq.

- %endif

- 

- %package -n python2-fedmsg-commands

- Summary:        Basic fedmsg commands

- %{?python_provide:%python_provide python2-fedmsg-commands}

- 

- Requires:       python2-click

- Requires:       python-pygments

- Requires:       python-psutil

- Requires:       python2-fedmsg-core = %{version}-%{release}

- 

- %if 0%{?rhel} && 0%{?rhel} <= 6

- Requires:       python-logutils

- %endif

- 

- %description -n python2-fedmsg-commands

- Basic CLI commands for fedmsg

- 

- %package -n python2-fedmsg-consumers

- Summary:        Basic fedmsg consumers

- %{?python_provide:%python_provide python2-fedmsg-consumers}

- 

- Requires:       python-moksha-hub >= 1.3.2

- Requires:       python-pygments

- Requires:       python-psutil

- Requires:       python-daemon

- Requires:       python2-fedmsg-core = %{version}-%{release}

- 

- %description -n python2-fedmsg-consumers

- Moksha consumer API for fedmsg

  

  %package base

  Summary: Base file system layout for other fedmsg packages

@@ -183,123 +71,183 @@ 

  This package contains some of the common filesystem layout shared by the

  python2 and python3 versions of the fedmsg package.

  

- %package announce

- Summary: The fedmsg-announce command

- Requires: %{name} = %{version}-%{release}

  

- %description announce

- This package contains the fedmsg-announce command for sending announcements.

+ %package doc

+ Summary: Documentation for the fedmsg library and CLI

  

- %package collectd

- Summary: A fedmsg plugin for collectd

- Requires: %{name} = %{version}-%{release}

+ %description doc

+ Documentation for the fedmsg library and CLI.

  

- %description collectd

- This package contains the fedmsg-collectd command which produces output

- suitable for consumption by a collectd plugin.

  

- %package hub

- Summary: The FedMsg Hub

- Requires: %{name} = %{version}-%{release}

- 

- %description hub

- This package contains configuration and init scripts for the FedMsg hub.

- 

- %package relay

- Summary: The FedMsg Relay

- Requires: %{name} = %{version}-%{release}

+ %package -n python2-fedmsg

+ Summary: Python 2 API and CLI for fedmsg

+ %{?python_provide:%python_provide python2-fedmsg}

+ Requires:       python2-arrow

+ Requires:       python2-click

+ Requires:       python2-cryptography >= 1.6

+ Requires:       python2-kitchen

+ Requires:       python2-moksha-hub >= 1.3.2

+ Requires:       python2-psutil

+ Requires:       python2-pygments

+ Requires:       python2-pyOpenSSL >= 16.1.0

+ Requires:       python2-requests

+ Requires:       python2-six

+ Requires:       python2-zmq

+ Requires:       fedmsg-base = %{version}-%{release}

  

- %description relay

- This package contains configuration and init scripts for the FedMsg relay.

+ Provides: fedmsg-announce = %{version}-%{release}

+ Obsoletes: fedmsg-announce < %{version}-%{release}

+ Provides: fedmsg-collectd = %{version}-%{release}

+ Obsoletes: fedmsg-collectd < %{version}-%{release}

+ Provides: fedmsg-gateway = %{version}-%{release}

+ Obsoletes: fedmsg-gateway < %{version}-%{release}

+ Provides: fedmsg-hub = %{version}-%{release}

+ Obsoletes: fedmsg-hub < %{version}-%{release}

+ Provides: fedmsg-irc = %{version}-%{release}

+ Obsoletes: fedmsg-irc < %{version}-%{release}

+ Provides: fedmsg-relay = %{version}-%{release}

+ Obsoletes: fedmsg-relay < %{version}-%{release}

+ Provides: python2-fedmsg-core = %{version}-%{release}

+ Obsoletes: python2-fedmsg-core < %{version}-%{release}

+ Provides: python2-fedmsg-consumers = %{version}-%{release}

+ Obsoletes: python2-fedmsg-consumers < %{version}-%{release}

+ Provides: python2-fedmsg-commands = %{version}-%{release}

+ Obsoletes: python2-fedmsg-commands < %{version}-%{release}

+ 

+ %description -n python2-fedmsg

+ Python 2 API used around Fedora Infrastructure to send and receive messages

+ with zeromq.

  

- %package irc

- Summary: The FedMsg IRC Bot

- Requires: %{name} = %{version}-%{release}

- Requires: python-twisted-words

  

- %description irc

- This package contains configuration and init scripts for the FedMsg IRC bot.

+ %package -n python3-fedmsg

+ Summary: Python 3 API and CLI for fedmsg

+ %{?python_provide:%python_provide python3-fedmsg}

+ Requires:       python3-arrow

+ Requires:       python3-click

+ Requires:       python3-cryptography >= 1.6

+ Requires:       python3-kitchen

+ Requires:       python3-moksha-hub >= 1.3.2

+ Requires:       python3-psutil

+ Requires:       python3-pygments

+ Requires:       python3-pyOpenSSL >= 16.1.0

+ Requires:       python3-requests

+ Requires:       python3-six

+ Requires:       python3-zmq

+ Requires:       fedmsg-base = %{version}-%{release}

  

- %package gateway

- Summary: The FedMsg Gateway daemon.

- Requires: %{name} = %{version}-%{release}

+ %description -n python3-fedmsg

+ Python 3 API used around Fedora Infrastructure to send and receive messages

+ with zeromq.

  

- %description gateway

- This package contains configuration and init scripts for the FedMsg Gateway.

- It will rebroadcast messages from the bus to a specially designated ZMQ pub

- socket.  Useful for repeating messages outside a firewall.

  

  %prep

- %setup -q -n %{modname}-%{version}

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

  

- # This only got shipped with fedmsg-0.6.3

- rm -f fedmsg.d/_tweet-real.py

- 

- # Copy the development config into the tests dir for the check section

- cp -rf fedmsg.d fedmsg/tests/.

- 

- %if 0%{?with_python3}

- rm -rf %{py3dir}

- cp -a . %{py3dir}

- 

- # And.. these three aren't really required for python3 core stuff...

- sed -i "/pygments/d" setup.py

- sed -i "/psutil/d" setup.py

- 

- %endif

  

  %build

- %{__python} setup.py build

+ %py2_build

+ %py3_build

  

- # Unfortunately, neither of these tests will run on koji since they require

- # some network connectivity.  With a note of sadness, we destroy them.

- rm fedmsg/tests/test_hub.py

- rm fedmsg/tests/test_threads.py

+ make %{?_smp_mflags} -C doc SPHINXBUILD=sphinx-build-3 html PYTHONPATH=$(pwd)

+ rm doc/_build/html/.buildinfo

  

- %if 0%{?with_python3}

- pushd %{py3dir}

- %{__python3} setup.py build

- popd

- %endif

  

  %check

- %if 0%{?rhel} && 0%{?rhel} <= 6

- # Check section removed until a RHEL6 bug with python-repoze-what-plugins-sql

- # can be fixed.  It causes a fatal error in the test suite.

- # https://bugzilla.redhat.com/show_bug.cgi?id=813925

- %else

- PYTHONPATH=$(pwd) py.test

- # Remove compiled .py files from config

+ PYTHONPATH=$(pwd) py.test fedmsg

+ PYTHONPATH=$(pwd) py.test-3 fedmsg

+ 

+ # Remove compiled .py files from config caused by the tests reading the config

  rm -f %{buildroot}%{_sysconfdir}/fedmsg.d/*.py{c,o}

- %endif

  

- ## XXX - no python3 tests for now until python-cryptography can do everything

- ## we need with regard to x509.

- ##%if 0%{?with_python3}

- ##pushd %{py3dir}

- ##PYTHONPATH=. nosetests-%{python3_version} tests/*.py

- ##popd

- ##%endif

  

  %install

- %if 0%{?with_python3}

- pushd %{py3dir}

- %{__python3} setup.py install -O1 --skip-build --root %{buildroot}

- 

- # These two modules aren't ready for python3 yet (due mostly to the absence of

- # python3-twisted-core in Fedora).

- rm -rf %{buildroot}%{python3_sitelib}/%{modname}/commands/

- rm -rf %{buildroot}%{python3_sitelib}/%{modname}/consumers/

+ %py3_install

  

- # Nuke all the commands.  Let the python2 install step re-install them.

- # https://bugzilla.redhat.com/show_bug.cgi?id=1268497

- rm -rf %{buildroot}%{_bindir}/fedmsg-*

- 

- popd

- %endif

+ # fedmsg provides a huge number of scripts and we need to move them all so the Python 2

+ # version is the un-versioned entry.

+ #

+ # config

+ mv %{buildroot}%{_bindir}/fedmsg-config %{buildroot}%{_bindir}/fedmsg-config-%{python3_version}

+ ln -s %{_bindir}/fedmsg-config-%{python3_version} %{buildroot}%{_bindir}/fedmsg-config-3

+ # logger

+ mv %{buildroot}%{_bindir}/fedmsg-logger %{buildroot}%{_bindir}/fedmsg-logger-%{python3_version}

+ ln -s %{_bindir}/fedmsg-logger-%{python3_version} %{buildroot}%{_bindir}/fedmsg-logger-3

+ # tail

+ mv %{buildroot}%{_bindir}/fedmsg-tail %{buildroot}%{_bindir}/fedmsg-tail-%{python3_version}

+ ln -s %{_bindir}/fedmsg-tail-%{python3_version} %{buildroot}%{_bindir}/fedmsg-tail-3

+ # collectd

+ mv %{buildroot}%{_bindir}/fedmsg-collectd %{buildroot}%{_bindir}/fedmsg-collectd-%{python3_version}

+ ln -s %{_bindir}/fedmsg-collectd-%{python3_version} %{buildroot}%{_bindir}/fedmsg-collectd-3

+ # announce

+ mv %{buildroot}%{_bindir}/fedmsg-announce %{buildroot}%{_bindir}/fedmsg-announce-%{python3_version}

+ ln -s %{_bindir}/fedmsg-announce-%{python3_version} %{buildroot}%{_bindir}/fedmsg-announce-3

+ # trigger

+ mv %{buildroot}%{_bindir}/fedmsg-trigger %{buildroot}%{_bindir}/fedmsg-trigger-%{python3_version}

+ ln -s %{_bindir}/fedmsg-trigger-%{python3_version} %{buildroot}%{_bindir}/fedmsg-trigger-3

+ # dg-replay

+ mv %{buildroot}%{_bindir}/fedmsg-dg-replay %{buildroot}%{_bindir}/fedmsg-dg-replay-%{python3_version}

+ ln -s %{_bindir}/fedmsg-dg-replay-%{python3_version} %{buildroot}%{_bindir}/fedmsg-dg-replay-3

+ # check

+ mv %{buildroot}%{_bindir}/fedmsg-check %{buildroot}%{_bindir}/fedmsg-check-%{python3_version}

+ ln -s %{_bindir}/fedmsg-check-%{python3_version} %{buildroot}%{_bindir}/fedmsg-check-3

+ # hub

+ mv %{buildroot}%{_bindir}/fedmsg-hub %{buildroot}%{_bindir}/fedmsg-hub-%{python3_version}

+ ln -s %{_bindir}/fedmsg-hub-%{python3_version} %{buildroot}%{_bindir}/fedmsg-hub-3

+ # relay

+ mv %{buildroot}%{_bindir}/fedmsg-relay %{buildroot}%{_bindir}/fedmsg-relay-%{python3_version}

+ ln -s %{_bindir}/fedmsg-relay-%{python3_version} %{buildroot}%{_bindir}/fedmsg-relay-3

+ # signing-relay

+ mv %{buildroot}%{_bindir}/fedmsg-signing-relay %{buildroot}%{_bindir}/fedmsg-signing-relay-%{python3_version}

+ ln -s %{_bindir}/fedmsg-signing-relay-%{python3_version} %{buildroot}%{_bindir}/fedmsg-signing-relay-3

+ # gateway

+ mv %{buildroot}%{_bindir}/fedmsg-gateway %{buildroot}%{_bindir}/fedmsg-gateway-%{python3_version}

+ ln -s %{_bindir}/fedmsg-gateway-%{python3_version} %{buildroot}%{_bindir}/fedmsg-gateway-3

+ # irc

+ mv %{buildroot}%{_bindir}/fedmsg-irc %{buildroot}%{_bindir}/fedmsg-irc-%{python3_version}

+ ln -s %{_bindir}/fedmsg-irc-%{python3_version} %{buildroot}%{_bindir}/fedmsg-irc-3

+ 

+ 

+ %py2_install

+ # config

+ ln -s %{_bindir}/fedmsg-config %{buildroot}%{_bindir}/fedmsg-config-2

+ ln -s %{_bindir}/fedmsg-config %{buildroot}%{_bindir}/fedmsg-config-%{python2_version}

+ # logger

+ ln -s %{_bindir}/fedmsg-logger %{buildroot}%{_bindir}/fedmsg-logger-2

+ ln -s %{_bindir}/fedmsg-logger %{buildroot}%{_bindir}/fedmsg-logger-%{python2_version}

+ # tail

+ ln -s %{_bindir}/fedmsg-tail %{buildroot}%{_bindir}/fedmsg-tail-2

+ ln -s %{_bindir}/fedmsg-tail %{buildroot}%{_bindir}/fedmsg-tail-%{python2_version}

+ # collectd

+ ln -s %{_bindir}/fedmsg-collectd %{buildroot}%{_bindir}/fedmsg-collectd-2

+ ln -s %{_bindir}/fedmsg-collectd %{buildroot}%{_bindir}/fedmsg-collectd-%{python2_version}

+ # announce

+ ln -s %{_bindir}/fedmsg-announce %{buildroot}%{_bindir}/fedmsg-announce-2

+ ln -s %{_bindir}/fedmsg-announce %{buildroot}%{_bindir}/fedmsg-announce-%{python2_version}

+ # trigger

+ ln -s %{_bindir}/fedmsg-trigger %{buildroot}%{_bindir}/fedmsg-trigger-2

+ ln -s %{_bindir}/fedmsg-trigger %{buildroot}%{_bindir}/fedmsg-trigger-%{python2_version}

+ # dg-replay

+ ln -s %{_bindir}/fedmsg-dg-replay %{buildroot}%{_bindir}/fedmsg-dg-replay-2

+ ln -s %{_bindir}/fedmsg-dg-replay %{buildroot}%{_bindir}/fedmsg-dg-replay-%{python2_version}

+ # check

+ ln -s %{_bindir}/fedmsg-check %{buildroot}%{_bindir}/fedmsg-check-2

+ ln -s %{_bindir}/fedmsg-check %{buildroot}%{_bindir}/fedmsg-check-%{python2_version}

+ # hub

+ ln -s %{_bindir}/fedmsg-hub %{buildroot}%{_bindir}/fedmsg-hub-2

+ ln -s %{_bindir}/fedmsg-hub %{buildroot}%{_bindir}/fedmsg-hub-%{python2_version}

+ # relay

+ ln -s %{_bindir}/fedmsg-relay %{buildroot}%{_bindir}/fedmsg-relay-2

+ ln -s %{_bindir}/fedmsg-relay %{buildroot}%{_bindir}/fedmsg-relay-%{python2_version}

+ # signing-relay

+ ln -s %{_bindir}/fedmsg-signing-relay %{buildroot}%{_bindir}/fedmsg-signing-relay-2

+ ln -s %{_bindir}/fedmsg-signing-relay %{buildroot}%{_bindir}/fedmsg-signing-relay-%{python2_version}

+ # gateway

+ ln -s %{_bindir}/fedmsg-gateway %{buildroot}%{_bindir}/fedmsg-gateway-2

+ ln -s %{_bindir}/fedmsg-gateway %{buildroot}%{_bindir}/fedmsg-gateway-%{python2_version}

+ # irc

+ ln -s %{_bindir}/fedmsg-irc %{buildroot}%{_bindir}/fedmsg-irc-2

+ ln -s %{_bindir}/fedmsg-irc %{buildroot}%{_bindir}/fedmsg-irc-%{python2_version}

  

- %{__python} setup.py install -O1 --skip-build \

-     --install-data=%{_datadir} --root %{buildroot}

  

  %{__mkdir_p} %{buildroot}%{_sysconfdir}/fedmsg.d/

  %{__cp} fedmsg.d/*.py %{buildroot}%{_sysconfdir}/fedmsg.d/.

@@ -307,13 +255,6 @@ 

  %{__mkdir_p} %{buildroot}/%{_var}/run/%{modname}

  %{__mkdir_p} %{buildroot}/%{_var}/log/%{modname}

  

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %{__mkdir_p} %{buildroot}%{_sysconfdir}/init.d

- %{__install} initsys/sysv/fedmsg-hub.init %{buildroot}%{_sysconfdir}/init.d/fedmsg-hub

- %{__install} initsys/sysv/fedmsg-relay.init %{buildroot}%{_sysconfdir}/init.d/fedmsg-relay

- %{__install} initsys/sysv/fedmsg-irc.init %{buildroot}%{_sysconfdir}/init.d/fedmsg-irc

- %{__install} initsys/sysv/fedmsg-gateway.init %{buildroot}%{_sysconfdir}/init.d/fedmsg-gateway

- %else

  %{__mkdir_p} %{buildroot}%{_unitdir}

  %{__install} -pm644 initsys/systemd/fedmsg-hub.service \

      %{buildroot}%{_unitdir}/fedmsg-hub.service

@@ -323,7 +264,11 @@ 

      %{buildroot}%{_unitdir}/fedmsg-irc.service

  %{__install} -pm644 initsys/systemd/fedmsg-gateway.service \

      %{buildroot}%{_unitdir}/fedmsg-gateway.service

- %endif

+ 

+ %{__install} -Dm0644 %{SOURCE2} %{buildroot}%{_unitdir}/

+ %{__install} -Dm0644 %{SOURCE3} %{buildroot}%{_unitdir}/

+ %{__install} -Dm0644 %{SOURCE4} %{buildroot}%{_unitdir}/

+ %{__install} -Dm0644 %{SOURCE5} %{buildroot}%{_unitdir}/

  

  # Logrotate configuration

  %{__mkdir_p} %{buildroot}/%{_sysconfdir}/logrotate.d

@@ -331,175 +276,142 @@ 

  chmod 0644 %{buildroot}/%{_sysconfdir}/logrotate.d/%{modname}

  

  # tmpfiles.d

- %{__install} -Dm0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf

- 

- # Remove compiled .py files from config

- rm -f %{buildroot}%{_sysconfdir}/fedmsg.d/*.py{c,o}

+ %{__install} -Dm0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf

  

  

+ # Installation scriptlets

  %pre base

  %{_sbindir}/groupadd -r %{modname} &>/dev/null || :

  %{_sbindir}/useradd  -r -s /sbin/nologin -d %{_datadir}/%{modname} -M \

                       -c 'FedMsg' -g %{modname} %{modname} &>/dev/null || :

  

+ # python2 scriptlets

+ %post -n python2-fedmsg

+ %systemd_post fedmsg-hub.service

+ %systemd_post fedmsg-relay.service

+ %systemd_post fedmsg-irc.service

+ %systemd_post fedmsg-gateway.service

+ 

+ %preun -n python2-fedmsg

+ %systemd_preun fedmsg-hub.service

+ %systemd_preun fedmsg-relay.service

+ %systemd_preun fedmsg-irc.service

+ %systemd_preun fedmsg-gateway.service

+ 

+ %postun -n python2-fedmsg

+ %systemd_postun_with_restart fedmsg-hub.service

+ %systemd_postun_with_restart fedmsg-relay.service

+ %systemd_postun_with_restart fedmsg-irc.service

+ %systemd_postun_with_restart fedmsg-gateway.service

+ 

+ # python3 scriptlets

+ %post -n python3-fedmsg

+ %systemd_post fedmsg-hub-3.service

+ %systemd_post fedmsg-relay-3.service

+ %systemd_post fedmsg-irc-3.service

+ %systemd_post fedmsg-gateway-3.service

+ 

+ %preun -n python3-fedmsg

+ %systemd_preun fedmsg-hub-3.service

+ %systemd_preun fedmsg-relay-3.service

+ %systemd_preun fedmsg-irc-3.service

+ %systemd_preun fedmsg-gateway-3.service

+ 

+ %postun -n python3-fedmsg

+ %systemd_postun_with_restart fedmsg-hub-3.service

+ %systemd_postun_with_restart fedmsg-relay-3.service

+ %systemd_postun_with_restart fedmsg-irc-3.service

+ %systemd_postun_with_restart fedmsg-gateway-3.service

  

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %preun hub

- if [ $1 -eq 0 ]; then

-     /sbin/service fedmsg-hub stop >/dev/null 2>&1

-     /sbin/chkconfig --del fedmsg-hub

- fi

- 

- %preun relay

- if [ $1 -eq 0 ]; then

-     /sbin/service fedmsg-relay stop >/dev/null 2>&1

-     /sbin/chkconfig --del fedmsg-relay

- fi

- 

- %preun irc

- if [ $1 -eq 0 ]; then

-     /sbin/service fedmsg-irc stop >/dev/null 2>&1

-     /sbin/chkconfig --del fedmsg-irc

- fi

- 

- %preun gateway

- if [ $1 -eq 0 ]; then

-     /sbin/service fedmsg-gateway stop >/dev/null 2>&1

-     /sbin/chkconfig --del fedmsg-gateway

- fi

- %endif

  

  %files

- %doc doc/ README.rst LICENSE

- 

- %files -n python2-fedmsg-core

- %doc doc/ README.rst LICENSE

- 

- %dir %{python2_sitelib}/%{modname}/

+ %license LICENSE

+ %doc README.rst

  

- %{python2_sitelib}/%{modname}/__init__.py*

- %{python2_sitelib}/%{modname}/config.py*

- %{python2_sitelib}/%{modname}/core.py*

- %{python2_sitelib}/%{modname}/utils.py*

  

- %{python2_sitelib}/%{modname}/crypto/

- %{python2_sitelib}/%{modname}/encoding/

- %{python2_sitelib}/%{modname}/meta/

- %{python2_sitelib}/%{modname}/replay/

- %{python2_sitelib}/%{modname}/tests/

- %{python2_sitelib}/%{modname}/text

+ %files doc

+ %license LICENSE

+ %doc README.rst doc/_build/html

  

- %{python2_sitelib}/%{modname}-%{version}-py%{pyver}.egg-info/

  

- %if 0%{?with_python3}

- %files -n python%{python3_pkgversion}-fedmsg-core

- %doc doc/ README.rst LICENSE

- 

- %dir %{python3_sitelib}/%{modname}/

- 

- %{python3_sitelib}/%{modname}/__init__.py*

- %{python3_sitelib}/%{modname}/config.py*

- %{python3_sitelib}/%{modname}/core.py*

- %{python3_sitelib}/%{modname}/utils.py*

- 

- %{python3_sitelib}/%{modname}/crypto/

- %{python3_sitelib}/%{modname}/encoding/

- %{python3_sitelib}/%{modname}/meta/

- %{python3_sitelib}/%{modname}/replay/

- %{python3_sitelib}/%{modname}/tests/

- %{python3_sitelib}/%{modname}/text

- 

- %{python3_sitelib}/%{modname}/__pycache__/

- 

- %{python3_sitelib}/%{modname}-%{version}-py%{python3_version}.egg-info/

- %endif

- 

- %files -n python2-fedmsg-commands

- %doc doc/ README.rst LICENSE

- %{python2_sitelib}/%{modname}/commands/

+ %files -n python2-fedmsg

+ %license LICENSE

+ %doc README.rst

+ %{python2_sitelib}/%{modname}/

+ %{python2_sitelib}/%{modname}-%{version}-py%{python2_version}.egg-info/

+ %{_bindir}/fedmsg-announce

+ %{_bindir}/fedmsg-announce-2*

+ %{_bindir}/fedmsg-collectd

+ %{_bindir}/fedmsg-collectd-2*

+ %{_bindir}/fedmsg-gateway

+ %{_bindir}/fedmsg-gateway-2*

+ %{_bindir}/fedmsg-hub

+ %{_bindir}/fedmsg-hub-2*

  %{_bindir}/fedmsg-logger

+ %{_bindir}/fedmsg-logger-2*

+ %{_bindir}/fedmsg-irc

+ %{_bindir}/fedmsg-irc-2*

  %{_bindir}/fedmsg-tail

+ %{_bindir}/fedmsg-tail-2*

  %{_bindir}/fedmsg-trigger

+ %{_bindir}/fedmsg-trigger-2*

  %{_bindir}/fedmsg-config

+ %{_bindir}/fedmsg-config-2*

  %{_bindir}/fedmsg-dg-replay

+ %{_bindir}/fedmsg-dg-replay-2*

  %{_bindir}/fedmsg-signing-relay

+ %{_bindir}/fedmsg-signing-relay-2*

  %{_bindir}/fedmsg-check

+ %{_bindir}/fedmsg-check-2*

+ %{_bindir}/fedmsg-relay

+ %{_bindir}/fedmsg-relay-2*

+ %{_unitdir}/fedmsg-hub.service

+ %{_unitdir}/fedmsg-relay.service

+ %{_unitdir}/fedmsg-irc.service

+ %{_unitdir}/fedmsg-gateway.service

  

- %files -n python2-fedmsg-consumers

- %doc doc/ README.rst LICENSE

- %{python2_sitelib}/%{modname}/consumers/

  

- %files base

- %doc doc/ README.rst LICENSE

+ %files -n python3-fedmsg

+ %license LICENSE

+ %doc README.rst

+ %{python3_sitelib}/%{modname}/

+ %{python3_sitelib}/%{modname}-%{version}-py%{python3_version}.egg-info/

+ %{_bindir}/fedmsg-announce-3*

+ %{_bindir}/fedmsg-collectd-3*

+ %{_bindir}/fedmsg-config-3*

+ %{_bindir}/fedmsg-gateway-3*

+ %{_bindir}/fedmsg-hub-3*

+ %{_bindir}/fedmsg-irc-3*

+ %{_bindir}/fedmsg-relay-3*

+ %{_bindir}/fedmsg-logger-3*

+ %{_bindir}/fedmsg-tail-3*

+ %{_bindir}/fedmsg-trigger-3*

+ %{_bindir}/fedmsg-dg-replay-3*

+ %{_bindir}/fedmsg-signing-relay-3*

+ %{_bindir}/fedmsg-check-3*

+ %{_unitdir}/fedmsg-hub-3.service

+ %{_unitdir}/fedmsg-relay-3.service

+ %{_unitdir}/fedmsg-irc-3.service

+ %{_unitdir}/fedmsg-gateway-3.service

+ 

  

+ %files base

+ %license LICENSE

+ %doc README.rst

  %attr(755, %{modname}, %{modname}) %dir %{_var}/log/%{modname}

  %attr(775, %{modname}, %{modname}) %dir %{_var}/run/%{modname}

- 

  %dir %{_sysconfdir}/fedmsg.d/

- 

- # Own these only on rhel6 due to some byte-compiling I can't seem to control

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %config(noreplace) %{_sysconfdir}/fedmsg.d/base.py*

- %config(noreplace) %{_sysconfdir}/fedmsg.d/endpoints.py*

- %config(noreplace) %{_sysconfdir}/fedmsg.d/logging.py*

- %config(noreplace) %{_sysconfdir}/fedmsg.d/ssl.py*

- %else

- %config(noreplace) %{_sysconfdir}/fedmsg.d/base.py

- %config(noreplace) %{_sysconfdir}/fedmsg.d/endpoints.py

- %config(noreplace) %{_sysconfdir}/fedmsg.d/logging.py

- %config(noreplace) %{_sysconfdir}/fedmsg.d/ssl.py

- %endif

- 

+ %config(noreplace) %{_sysconfdir}/fedmsg.d/*

  %config(noreplace) %{_sysconfdir}/logrotate.d/%{modname}

+ %{_tmpfilesdir}/%{name}.conf

  

- %{_prefix}/lib/tmpfiles.d/%{name}.conf

- 

- %files announce

- %{_bindir}/fedmsg-announce

- 

- %files collectd

- %{_bindir}/fedmsg-collectd

- 

- %files hub

- %{_bindir}/fedmsg-hub

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %{_sysconfdir}/init.d/fedmsg-hub

- %else

- %{_unitdir}/fedmsg-hub.service

- %endif

- 

- %files relay

- %{_bindir}/fedmsg-relay

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %{_sysconfdir}/init.d/fedmsg-relay

- %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py*

- %else

- %{_unitdir}/fedmsg-relay.service

- %config(noreplace) %{_sysconfdir}/fedmsg.d/relay.py

- %endif

- 

- 

- %files irc

- %{_bindir}/fedmsg-irc

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %{_sysconfdir}/init.d/fedmsg-irc

- %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py*

- %else

- %{_unitdir}/fedmsg-irc.service

- %config(noreplace) %{_sysconfdir}/fedmsg.d/ircbot.py

- %endif

- 

- %files gateway

- %{_bindir}/fedmsg-gateway

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %{_sysconfdir}/init.d/fedmsg-gateway

- %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py*

- %else

- %{_unitdir}/fedmsg-gateway.service

- %config(noreplace) %{_sysconfdir}/fedmsg.d/gateway.py

- %endif

  

  %changelog

+ * Tue Aug 22 2017 Jeremy Cline <jeremy@jcline.org> - 1.0.0-1

+ - Update to latest upstream

+ - Provide Python 3 builds

+ - Combine many of the subpackages

+ 

  * Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.19.0-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

  

This is not quite a total re-write, but it's a big change. I couldn't see much point to having a sub-package per command so I squashed those into python2-fedmsg and python3-fedmsg along with the -core and -consumer packages. I also started building the documentation.

I did a scratch build of this in rawhide: https://koji.fedoraproject.org/koji/taskinfo?taskID=21422465

@abompard I know you're looking to get Python 3 packages in EPEL7 for fedmsg. If you could look this over and let me know if there's anything I can do to minimize the difference between the master branch and EPEL7 that would be greatly appreciated!

Pull-Request has been merged by jcline

2 years ago

Hey, sorry for my lack of reply... I hadn't setup my filter for these pagure emails yet and missed it...