2018-10-01 11:28:15 +00:00
#
# spec file for package pagure
#
2024-05-31 22:57:00 +00:00
# Copyright (c) 2024 SUSE LLC
2021-02-12 01:00:32 +00:00
# Copyright (c) 2021 Neal Gompa <ngompa13@gmail.com>.
2018-10-01 11:28:15 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2021-02-12 01:00:32 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2018-10-01 11:28:15 +00:00
#
# Prevent dep generators from trying to process static stuff and stall out
# We only need to read the python metadata anyway
%global __provides_exclude_from ^%{python3_sitelib} /pagure/.*$
%global __requires_exclude_from ^%{python3_sitelib} /pagure/.*$
2022-05-03 17:35:51 +00:00
Name : pagure
2024-05-31 22:57:00 +00:00
Version : 5.14.1
2022-05-03 17:35:51 +00:00
Release : 0
Summary : A git-centered forge
Group : Development/Tools/Version Control
2018-10-01 11:28:15 +00:00
# Pagure itself is GPL-2.0-or-later; flask_fas_openid.py is LGPL-2.1-or-later
2022-05-03 17:35:51 +00:00
License : GPL-2.0-or-later AND LGPL-2.1-or-later
URL : https://pagure.io/pagure
2024-05-31 22:57:00 +00:00
Source0 : https://pagure.io/pagure/archive/%{version} /%{name} -%{version} .tar.gz
2018-10-01 11:28:15 +00:00
# Vendor in the single file from python-fedora that's needed
# This way, we avoid having to pull in all of python-fedora
# This file is licensed LGPL-2.1-or-later, per https://github.com/fedora-infra/python-fedora/blob/develop/README.rst#license
2022-05-03 17:35:51 +00:00
Source1 : https://raw.githubusercontent.com/fedora-infra/python-fedora/4719f10b3af1cf068e969387eab7df7e935003cd/flask_fas_openid.py
2018-10-01 11:28:15 +00:00
# SUSE-specific README providing a quickstart guide
2022-05-03 17:35:51 +00:00
Source10 : pagure-README.SUSE
2020-06-21 13:57:24 +00:00
2020-09-24 23:02:09 +00:00
# Backports from upstream
2021-01-07 11:54:32 +00:00
2018-10-01 11:28:15 +00:00
# SUSE-specific fixes
2019-03-29 14:06:16 +00:00
## Change the defaults in the example config to match packaging
2022-05-03 17:35:51 +00:00
Patch1000 : pagure-5.0-default-example-cfg.patch
2024-06-02 09:20:56 +00:00
# PATCH-FIX-UPSTREAM 5486.patch https://pagure.io/pagure/pull-request/5486 dominik@wombacher.cc -- Use '==' instead of 'is' in template if condition because to work with older Jinja2 versions. Edge case, avoid 'KeyError' after pagure update if a cached session is used.
Patch1001 : 5486.patch
2022-05-03 17:35:51 +00:00
BuildArch : noarch
BuildRequires : apache2
BuildRequires : fdupes
BuildRequires : nginx
BuildRequires : python3-devel
BuildRequires : python3-setuptools
BuildRequires : systemd-rpm-macros
BuildRequires : python3-Flask
BuildRequires : python3-Flask-WTF
BuildRequires : python3-Markdown
BuildRequires : python3-Pillow
BuildRequires : python3-alembic
BuildRequires : python3-arrow
BuildRequires : python3-bcrypt
BuildRequires : python3-binaryornot
BuildRequires : python3-bleach
BuildRequires : python3-blinker
BuildRequires : python3-chardet
BuildRequires : python3-cryptography
BuildRequires : python3-docutils
BuildRequires : python3-email_validator
BuildRequires : python3-psutil
BuildRequires : python3-pygit2 >= 0.26.0
2018-10-01 11:28:15 +00:00
#BuildRequires: python3-fedora-flask
2022-05-03 17:35:51 +00:00
BuildRequires : python3-python3-openid
BuildRequires : python3-SQLAlchemy >= 0.8
BuildRequires : python3-WTForms
BuildRequires : python3-munch
BuildRequires : python3-python-openid-cla
BuildRequires : python3-python-openid-teams
BuildRequires : python3-redis
BuildRequires : python3-straight-plugin
BuildRequires : python3-whitenoise
2018-10-01 11:28:15 +00:00
2018-10-09 12:27:01 +00:00
# We require OpenSSH 7.4+ for SHA256 support
2022-05-03 17:35:51 +00:00
Requires : openssh >= 7.4
Requires : python3-Flask
Requires : python3-Flask-WTF
Requires : python3-Markdown
Requires : python3-Pillow
Requires : python3-alembic
Requires : python3-arrow
Requires : python3-bcrypt
Requires : python3-binaryornot
Requires : python3-bleach
Requires : python3-blinker
Requires : python3-celery
Requires : python3-chardet
Requires : python3-cryptography
Requires : python3-docutils
Requires : python3-email_validator
Requires : python3-psutil
Requires : python3-pygit2 >= 0.26.0
2018-10-01 11:28:15 +00:00
#Requires: python3-fedora-flask
2022-05-03 17:35:51 +00:00
Requires : python3-python3-openid
Requires : python3-SQLAlchemy > 0.8
Requires : python3-WTForms
Requires : python3-munch
Requires : python3-python-openid-cla
Requires : python3-python-openid-teams
Requires : python3-redis
Requires : python3-straight-plugin
Requires : python3-whitenoise
2018-10-01 11:28:15 +00:00
# Required for celery
2022-05-03 17:35:51 +00:00
Requires : python3-pytz
2018-10-01 11:28:15 +00:00
# Required for database setup/migrations
2022-05-03 17:35:51 +00:00
Requires : python3-dbm
Requires : python3-kitchen
Requires : python3-requests
2018-10-01 11:28:15 +00:00
2020-09-24 23:02:09 +00:00
# We want to use cchardet whenever it's available
2022-05-03 17:35:51 +00:00
Recommends: python3-cchardet
2020-09-24 23:02:09 +00:00
2018-10-01 11:28:15 +00:00
# If using PostgreSQL, the correct driver should be installed
2022-05-03 17:35:51 +00:00
Recommends: (python3-psycopg2 if postgresql-server)
2018-10-01 11:28:15 +00:00
# If using MariaDB/MySQL, the correct driver should be installed
2022-05-03 17:35:51 +00:00
Recommends: (python3-PyMySQL if mysql-server)
2018-10-01 11:28:15 +00:00
2020-05-15 01:13:38 +00:00
# If using Apache web server, the correct configuration should be installed
2022-05-03 17:35:51 +00:00
Recommends: (%{name} -web-apache-httpd if apache2)
2020-05-15 01:13:38 +00:00
# If using Nginx web server, the correct configuration should be installed
2022-05-03 17:35:51 +00:00
Recommends: (%{name} -web-nginx if nginx)
2018-10-01 11:28:15 +00:00
# The default theme is required
2022-05-03 17:35:51 +00:00
Requires : %{name} -theme-default
2018-10-01 11:28:15 +00:00
2020-09-24 23:02:09 +00:00
%{?systemd_ordering}
2018-10-01 11:28:15 +00:00
2019-03-29 14:06:16 +00:00
# We use the git tools for some actions due to deficiencies in libgit2 and pygit2
2022-05-03 17:35:51 +00:00
Requires : git-core
2019-03-29 14:06:16 +00:00
2018-10-01 11:28:15 +00:00
# No dependency of the app per se, but required to make it working.
OrderWithRequires: gitolite >= 3.0
2022-05-03 17:35:51 +00:00
Requires(pre) : gitolite >= 3.0
Requires : gitolite >= 3.0
Requires(post) : user(wwwrun)
2018-10-01 11:28:15 +00:00
%description
2018-10-02 11:22:37 +00:00
Pagure is a git-centered forge based on pygit2.
2018-10-01 11:28:15 +00:00
Currently, Pagure offers a web-interface for git repositories, a ticket
system and possibilities to create new projects, fork existing ones and
create/merge pull-requests across or within projects.
For steps on how to set up the system after installing this package,
please read %{_docdir} /%{name} /README.SUSE.
2020-05-15 01:13:38 +00:00
%package web-apache-httpd
2022-05-03 17:35:51 +00:00
Summary : Apache HTTPD configuration for Pagure
Requires : %{name} = %{version} -%{release}
Requires : apache2-mod_wsgi-python3
2020-05-15 01:13:38 +00:00
# Apache config moved out to its own subpackage
2022-05-03 17:35:51 +00:00
Obsoletes : %{name} < 5.10
Conflicts : %{name} < 5.10
2020-05-15 01:13:38 +00:00
%description web-apache-httpd
This package provides the configuration files for deploying
a Pagure server using the Apache HTTPD server.
%package web-nginx
2022-05-03 17:35:51 +00:00
Summary : Nginx configuration for Pagure
Requires : %{name} = %{version} -%{release}
Requires : nginx
Requires : python3-gunicorn
2020-05-15 01:13:38 +00:00
%description web-nginx
This package provides the configuration files for deploying
a Pagure server using the Nginx web server.
2018-10-01 11:28:15 +00:00
%package theme-upstream
2022-05-03 17:35:51 +00:00
Summary : Base theme for the Pagure web interface
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%description theme-upstream
This package provides the web interface assets for styling
a Pagure server with the base upstream look and feel.
%package theme-pagureio
2022-05-03 17:35:51 +00:00
Summary : Pagure web interface theme used on Pagure.io
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%description theme-pagureio
This package provides the web interface assets for styling
a Pagure server with the same look and feel as Pagure.io.
%package theme-srcfpo
2022-05-03 17:35:51 +00:00
Summary : Pagure web interface theme used on src.fedoraproject.org
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%description theme-srcfpo
This package provides the web interface assets for styling
a Pagure server with the same look and feel as src.fedoraproject.org.
%package theme-chameleon
2022-05-03 17:35:51 +00:00
Summary : Pagure web interface theme based on openSUSE's chameleon theme
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%description theme-chameleon
This package provides the web interface assets for styling
a Pagure server with the same look and feel as openSUSE Infrastructure.
%package theme-default-upstream
2022-05-03 17:35:51 +00:00
Summary : Configuration for pagure to default to the upstream web interface theme
Conflicts : %{name} -theme-default
Provides : %{name} -theme-default
Requires : %{name} -theme-upstream = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%description theme-default-upstream
This package sets the default web interface assets used for
a Pagure server running as shipped by upstream.
%package theme-default-openSUSE
2022-05-03 17:35:51 +00:00
Summary : Configuration for pagure to default to the openSUSE web interface theme
Conflicts : %{name} -theme-default
Provides : %{name} -theme-default
Requires : %{name} -theme-chameleon = %{version} -%{release}
Enhances: (%{name} and branding-openSUSE)
2024-05-31 23:20:00 +00:00
Removepathpostfixes:.openSUSE
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description theme-default-openSUSE
This package sets the default web interface assets used for
a Pagure server running on openSUSE.
%package milters
2022-05-03 17:35:51 +00:00
Summary : Milter to integrate pagure with emails
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
Requires : python3-pymilter
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
# It would work with sendmail but we configure things (like the tempfile)
# to work with postfix
2022-05-03 17:35:51 +00:00
Requires : postfix
2018-10-01 11:28:15 +00:00
%description milters
Milters (Mail filters) allowing the integration of pagure and emails.
This is useful for example to allow commenting on a ticket by email.
%package ev
2022-05-03 17:35:51 +00:00
Summary : EventSource server for pagure
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
Requires : python3-Trololio
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description ev
Pagure comes with an eventsource server allowing live update of the pages
supporting it. This package provides it.
%package webhook
2022-05-03 17:35:51 +00:00
Summary : Web-Hook server for pagure
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description webhook
Pagure comes with an webhook server allowing http callbacks for any action
done on a project. This package provides it.
%package ci
2022-05-03 17:35:51 +00:00
Summary : A CI service for pagure
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
Requires : python3-python-jenkins
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description ci
Pagure comes with a continuous integration service, currently supporting
only jenkins but extendable to others.
With this service, your CI server will be able to report the results of the
build on the pull-requests opened to your project.
%package logcom
2022-05-03 17:35:51 +00:00
Summary : The logcom service for pagure
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description logcom
pagure-logcom contains the service that logs commits into the database so that
the activity calendar heatmap is filled.
%package loadjson
2022-05-03 17:35:51 +00:00
Summary : The loadjson service for pagure
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description loadjson
pagure-loadjson is the service allowing to update the database with the
information provided in the JSON blobs that are stored in the tickets (and
in the future pull-requests) git repo.
%package mirror
2022-05-03 17:35:51 +00:00
Summary : The mirroring service for pagure
BuildRequires : systemd-rpm-macros
Requires : %{name} = %{version} -%{release}
2018-10-01 11:28:15 +00:00
%{?systemd_requires}
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%description mirror
pagure-mirror is the service mirroring projects that asked for it outside
of this pagure instance.
%prep
%autosetup -p1
# Vendor in the file needed from python-fedora
install -pm 0644 %{SOURCE1} pagure/ui
sed -e " s / i m p o r t f l a s k _ f a s _ o p e n i d / f r o m p a g u r e . u i i m p o r t f l a s k _ f a s _ o p e n i d a s f l a s k _ f a s _ o p e n i d / " -i pagure/ui/fas_login.py
# Install README.SUSE file
install -pm 0644 %{SOURCE10} README.SUSE
%build
%py3_build
%install
%py3_install
# Install apache configuration file
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_sysconfdir} /apache2/vhosts.d
2020-05-15 01:13:38 +00:00
install -p -m 644 files/pagure-apache-httpd.conf %{buildroot} /%{_sysconfdir} /apache2/vhosts.d/pagure.conf
# Install nginx configuration file
mkdir -p %{buildroot} /%{_sysconfdir} /nginx/vhosts.d/
install -p -m 644 files/pagure-nginx.conf %{buildroot} /%{_sysconfdir} /nginx/vhosts.d/pagure.conf
2018-10-01 11:28:15 +00:00
# Install configuration file
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_sysconfdir} /pagure
install -p -m 644 files/pagure.cfg.sample %{buildroot} /%{_sysconfdir} /pagure/pagure.cfg
2018-10-01 11:28:15 +00:00
# Install WSGI file
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_datadir} /pagure
install -p -m 644 files/pagure.wsgi %{buildroot} /%{_datadir} /pagure/pagure.wsgi
install -p -m 644 files/doc_pagure.wsgi %{buildroot} /%{_datadir} /pagure/doc_pagure.wsgi
2018-10-01 11:28:15 +00:00
# Install the createdb script
2018-10-02 11:22:37 +00:00
install -p -m 644 createdb.py %{buildroot} /%{_datadir} /pagure/pagure_createdb.py
2018-10-01 11:28:15 +00:00
# Install the api_key_expire_mail.py script
2018-10-02 11:22:37 +00:00
install -p -m 644 files/api_key_expire_mail.py %{buildroot} /%{_datadir} /pagure/api_key_expire_mail.py
2018-10-01 11:28:15 +00:00
2019-01-10 13:14:31 +00:00
# Install the mirror_project_in.py script
2019-01-15 08:33:51 +00:00
install -p -m 644 files/mirror_project_in.py %{buildroot} /%{_datadir} /pagure/mirror_project_in.py
2019-01-10 13:14:31 +00:00
2018-10-01 11:28:15 +00:00
# Install the keyhelper and aclcheck scripts
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_libexecdir} /pagure
install -p -m 755 files/aclchecker.py %{buildroot} /%{_libexecdir} /pagure/aclchecker.py
install -p -m 755 files/keyhelper.py %{buildroot} /%{_libexecdir} /pagure/keyhelper.py
2018-10-01 11:28:15 +00:00
# Install the alembic configuration file
2018-10-02 11:22:37 +00:00
install -p -m 644 files/alembic.ini %{buildroot} /%{_sysconfdir} /pagure/alembic.ini
2018-10-01 11:28:15 +00:00
# Install the alembic revisions
2018-10-02 11:22:37 +00:00
cp -r alembic %{buildroot} /%{_datadir} /pagure
2018-10-01 11:28:15 +00:00
2020-05-15 01:13:38 +00:00
# Install the systemd file for the web frontend
mkdir -p %{buildroot} /%{_unitdir}
install -p -m 644 files/pagure_web.service \
%{buildroot} /%{_unitdir} /pagure_web.service
# Install the systemd file for the docs web frontend
mkdir -p %{buildroot} /%{_unitdir}
install -p -m 644 files/pagure_docs_web.service \
%{buildroot} /%{_unitdir} /pagure_docs_web.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the worker
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_unitdir}
2018-10-01 11:28:15 +00:00
install -p -m 644 files/pagure_worker.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_worker.service
2018-10-01 11:28:15 +00:00
2020-05-15 01:13:38 +00:00
# Install the systemd file for the authorized_keys worker
install -p -m 644 files/pagure_authorized_keys_worker.service \
%{buildroot} /%{_unitdir} /pagure_authorized_keys_worker.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the gitolite worker
install -p -m 644 files/pagure_gitolite_worker.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_gitolite_worker.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the web-hook
install -p -m 644 files/pagure_webhook.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_webhook.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the ci service
install -p -m 644 files/pagure_ci.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_ci.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the logcom service
install -p -m 644 files/pagure_logcom.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_logcom.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the loadjson service
install -p -m 644 files/pagure_loadjson.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_loadjson.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the mirror service
install -p -m 644 files/pagure_mirror.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_mirror.service
2018-10-01 11:28:15 +00:00
# Install the systemd file for the script sending reminder about API key
# expiration
install -p -m 644 files/pagure_api_key_expire_mail.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_api_key_expire_mail.service
2018-10-01 11:28:15 +00:00
install -p -m 644 files/pagure_api_key_expire_mail.timer \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_api_key_expire_mail.timer
2018-10-01 11:28:15 +00:00
2019-01-10 13:14:31 +00:00
# Install the systemd file for the script updating mirrored project
install -p -m 644 files/pagure_mirror_project_in.service \
2019-01-15 08:33:51 +00:00
%{buildroot} /%{_unitdir} /pagure_mirror_project_in.service
2019-01-10 13:14:31 +00:00
install -p -m 644 files/pagure_mirror_project_in.timer \
2019-01-15 08:33:51 +00:00
%{buildroot} /%{_unitdir} /pagure_mirror_project_in.timer
2019-01-10 13:14:31 +00:00
2018-10-01 11:28:15 +00:00
# Install the milter files
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_tmpfilesdir}
2018-10-01 11:28:15 +00:00
install -p -m 0644 pagure-milters/milter_tempfile.conf \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_tmpfilesdir} /%{name} -milter.conf
2018-10-01 11:28:15 +00:00
install -p -m 644 pagure-milters/pagure_milter.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_milter.service
2018-10-01 11:28:15 +00:00
install -p -m 644 pagure-milters/comment_email_milter.py \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_datadir} /pagure/comment_email_milter.py
2018-10-01 11:28:15 +00:00
# Install the eventsource
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_libexecdir} /pagure-ev
2018-10-01 11:28:15 +00:00
install -p -m 755 pagure-ev/pagure_stream_server.py \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_libexecdir} /pagure-ev/pagure_stream_server.py
2018-10-01 11:28:15 +00:00
install -p -m 644 pagure-ev/pagure_ev.service \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{_unitdir} /pagure_ev.service
2018-10-01 11:28:15 +00:00
# Switch all systemd units to use the correct libexecdir
2018-10-02 11:22:37 +00:00
sed -e " s | / u s r / l i b e x e c | %{_libexecdir} | g " -i %{buildroot} /%{_unitdir} /*.service
2018-10-01 11:28:15 +00:00
# Change default_config.py to use the correct libexecdir
2018-10-02 11:22:37 +00:00
sed -e " s | / u s r / l i b e x e c | %{_libexecdir} | g " -i %{buildroot} /%{python3_sitelib} /pagure/default_config.py
2018-10-01 11:28:15 +00:00
# Fix the shebang for various scripts
sed -e " s | # ! / u s r / b i n / e n v p y t h o n | # ! %{__python 3 } | " -i \
2019-01-10 13:14:31 +00:00
%{buildroot} /%{_libexecdir} /pagure-ev/*.py \
%{buildroot} /%{_libexecdir} /pagure/*.py \
%{buildroot} /%{_datadir} /pagure/*.py \
2018-10-02 11:22:37 +00:00
%{buildroot} /%{python3_sitelib} /pagure/hooks/files/*.py \
%{buildroot} /%{python3_sitelib} /pagure/hooks/files/hookrunner \
%{buildroot} /%{python3_sitelib} /pagure/hooks/files/post-receive \
%{buildroot} /%{python3_sitelib} /pagure/hooks/files/pre-receive \
%{buildroot} /%{python3_sitelib} /pagure/hooks/files/repospannerhook
2018-10-01 11:28:15 +00:00
# Switch interpreter for systemd units to correct Python interpreter
2018-10-02 11:22:37 +00:00
sed -e " s | / u s r / b i n / p y t h o n | %{__python 3 } | g " -i %{buildroot} /%{_unitdir} /*.service
2018-10-01 11:28:15 +00:00
# Make symlinks for default theme packages
2018-10-02 11:22:37 +00:00
mv %{buildroot} /%{python3_sitelib} /pagure/themes/default %{buildroot} /%{python3_sitelib} /pagure/themes/upstream
ln -sr %{buildroot} /%{python3_sitelib} /pagure/themes/upstream %{buildroot} /%{python3_sitelib} /pagure/themes/default
ln -sr %{buildroot} /%{python3_sitelib} /pagure/themes/chameleon %{buildroot} /%{python3_sitelib} /pagure/themes/default.openSUSE
2018-10-01 11:28:15 +00:00
# Run fdupes
2018-10-02 11:22:37 +00:00
%fdupes %{buildroot} /%{python3_sitelib}
2022-05-03 17:35:51 +00:00
%fdupes doc/_build/html
2018-10-01 11:28:15 +00:00
2020-05-15 01:13:38 +00:00
# Make log directory and files
mkdir -p %{buildroot} /%{_localstatedir} /log/pagure
logfiles=" w e b d o c s _ w e b "
for logfile in $logfiles; do
touch %{buildroot} /%{_localstatedir} /log/pagure/access_${logfile}.log
touch %{buildroot} /%{_localstatedir} /log/pagure/error_${logfile}.log
done
2018-10-01 11:28:15 +00:00
# Regenerate clobbered symlinks (Cf. https://pagure.io/pagure/issue/3782)
runnerhooks=" p o s t - r e c e i v e p r e - r e c e i v e "
for runnerhook in $runnerhooks; do
2018-10-02 11:22:37 +00:00
rm -rf %{buildroot} /%{python3_sitelib} /pagure/hooks/files/$runnerhook
ln -sf hookrunner %{buildroot} /%{python3_sitelib} /pagure/hooks/files/$runnerhook
2018-10-01 11:28:15 +00:00
done
# Make the rcFOO symlinks for systemd services
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /%{_sbindir}
2020-05-15 01:13:38 +00:00
paguresvcs=" a p i _ k e y _ e x p i r e _ m a i l c i e v a u t h o r i z e d _ k e y s _ w o r k e r g i t o l i t e _ w o r k e r l o a d j s o n l o g c o m m i l t e r m i r r o r w e b h o o k w o r k e r m i r r o r _ p r o j e c t _ i n "
2018-10-01 11:28:15 +00:00
for paguresvc in $paguresvcs; do
2018-10-02 11:22:37 +00:00
ln -sf %{_sbindir} /service %{buildroot} /%{_sbindir} /rcpagure_$paguresvc
2018-10-01 11:28:15 +00:00
done
# Install the basic directory structure
2018-10-02 11:22:37 +00:00
mkdir -p %{buildroot} /srv/www/pagure-releases
mkdir -p %{buildroot} /srv/gitolite/pseudo
mkdir -p %{buildroot} /srv/gitolite/repositories/{,docs,forks,requests,tickets}
mkdir -p %{buildroot} /srv/gitolite/remotes
mkdir -p %{buildroot} /srv/gitolite/.gitolite/{conf,keydir,logs}
2020-05-15 01:13:38 +00:00
mkdir -p %{buildroot} /srv/gitolite/.ssh
2018-10-01 11:28:15 +00:00
# Add empty gitolite config file
2018-10-02 11:22:37 +00:00
touch %{buildroot} /srv/gitolite/.gitolite/conf/gitolite.conf
2018-10-01 11:28:15 +00:00
# Install gitolite rc file
2018-10-02 11:22:37 +00:00
install -p -m 644 files/gitolite3.rc %{buildroot} /srv/gitolite/.gitolite.rc
2018-10-01 11:28:15 +00:00
%pre
# Do nothing, but ensure dependency is evaluated...
%post
echo " C r e a t e w s g i r u n d i r i f i t d o e s n ' t e x i s t . . . "
mkdir -p /srv/www/run || :
echo " S e e %{_docdir} / %{name} / R E A D M E . S U S E t o c o n t i n u e "
%systemd_post pagure_worker.service
2020-05-15 01:13:38 +00:00
%systemd_post pagure_authorized_keys_worker.service
2018-10-01 11:28:15 +00:00
%systemd_post pagure_gitolite_worker.service
%systemd_post pagure_api_key_expire_mail.timer
2019-01-10 13:14:31 +00:00
%systemd_post pagure_mirror_project_in.timer
2022-05-03 17:35:51 +00:00
2020-05-15 01:13:38 +00:00
%post web-nginx
%systemd_post pagure_web.service
%systemd_post pagure_docs_web.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post milters
%tmpfiles_create %{_tmpfilesdir} /%{name} -milter.conf
%systemd_post pagure_milter.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post ev
%systemd_post pagure_ev.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post webhook
%systemd_post pagure_webhook.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post ci
%systemd_post pagure_ci.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post logcom
%systemd_post pagure_logcom.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post loadjson
%systemd_post pagure_loadjson.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%post mirror
%systemd_post pagure_mirror.service
%preun
%systemd_preun pagure_worker.service
2020-05-15 01:13:38 +00:00
%systemd_preun pagure_authorized_keys_worker.service
2019-01-10 13:14:31 +00:00
%systemd_preun pagure_gitolite_worker.service
2018-10-01 11:28:15 +00:00
%systemd_preun pagure_api_key_expire_mail.timer
2019-01-10 13:14:31 +00:00
%systemd_preun pagure_mirror_project_in.timer
2022-05-03 17:35:51 +00:00
2020-05-15 01:13:38 +00:00
%preun web-nginx
%systemd_preun pagure_web.service
%systemd_preun pagure_docs_web.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun milters
%systemd_preun pagure_milter.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun ev
%systemd_preun pagure_ev.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun webhook
%systemd_preun pagure_webhook.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun ci
%systemd_preun pagure_ci.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun logcom
%systemd_preun pagure_logcom.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun loadjson
%systemd_preun pagure_loadjson.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%preun mirror
%systemd_preun pagure_mirror.service
%postun
%systemd_postun_with_restart pagure_worker.service
2020-05-15 01:13:38 +00:00
%systemd_postun_with_restart pagure_authorized_keys_worker.service
2018-10-01 11:28:15 +00:00
%systemd_postun_with_restart pagure_gitolite_worker.service
%systemd_postun pagure_api_key_expire_mail.timer
2019-01-10 13:14:31 +00:00
%systemd_postun pagure_mirror_project_in.timer
2022-05-03 17:35:51 +00:00
2020-05-15 01:13:38 +00:00
%postun web-nginx
%systemd_postun_with_restart pagure_web.service
%systemd_postun_with_restart pagure_docs_web.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun milters
%systemd_postun_with_restart pagure_milter.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun ev
%systemd_postun_with_restart pagure_ev.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun webhook
%systemd_postun_with_restart pagure_webhook.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun ci
%systemd_postun_with_restart pagure_ci.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun logcom
%systemd_postun_with_restart pagure_logcom.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun loadjson
%systemd_postun_with_restart pagure_loadjson.service
2022-05-03 17:35:51 +00:00
2018-10-01 11:28:15 +00:00
%postun mirror
%systemd_postun_with_restart pagure_mirror.service
%files
2024-05-31 22:57:00 +00:00
%doc README.SUSE README.rst UPGRADING.rst files/gitolite3.rc files/pagure.cfg.sample
2018-10-01 11:28:15 +00:00
%license LICENSE
%config (noreplace) %{_sysconfdir} /pagure/pagure.cfg
%config (noreplace) %{_sysconfdir} /pagure/alembic.ini
%dir %{_sysconfdir} /pagure/
%dir %{_datadir} /pagure/
%{_datadir} /pagure/*.py*
%exclude %{_datadir} /pagure/comment_email_milter.py*
%{_datadir} /pagure/alembic/
%{_libexecdir} /pagure/
%{python3_sitelib} /pagure/
%exclude %{python3_sitelib} /pagure/themes/default
%exclude %{python3_sitelib} /pagure/themes/default.openSUSE
%exclude %{python3_sitelib} /pagure/themes/upstream
%exclude %{python3_sitelib} /pagure/themes/pagureio
%exclude %{python3_sitelib} /pagure/themes/srcfpo
%exclude %{python3_sitelib} /pagure/themes/chameleon
%{python3_sitelib} /pagure*.egg-info
%{_bindir} /pagure-admin
%{_unitdir} /pagure_worker.service
2020-05-15 01:13:38 +00:00
%{_unitdir} /pagure_authorized_keys_worker.service
2018-10-01 11:28:15 +00:00
%{_unitdir} /pagure_gitolite_worker.service
%{_unitdir} /pagure_api_key_expire_mail.service
%{_unitdir} /pagure_api_key_expire_mail.timer
2019-01-10 13:14:31 +00:00
%{_unitdir} /pagure_mirror_project_in.service
%{_unitdir} /pagure_mirror_project_in.timer
2018-10-01 11:28:15 +00:00
%{_sbindir} /rcpagure_api_key_expire_mail
%{_sbindir} /rcpagure_worker
2020-05-15 01:13:38 +00:00
%{_sbindir} /rcpagure_authorized_keys_worker
2018-10-01 11:28:15 +00:00
%{_sbindir} /rcpagure_gitolite_worker
2019-01-10 13:14:31 +00:00
%{_sbindir} /rcpagure_mirror_project_in
2018-10-01 11:28:15 +00:00
# Pagure data content
%attr (-,git,git) %dir /srv/gitolite/pseudo
%attr (-,git,git) %dir /srv/gitolite/remotes
%attr (-,git,git) %dir /srv/gitolite/repositories/{,docs,forks,requests,tickets}
%attr (-,git,git) %dir /srv/gitolite/.gitolite/{,conf,keydir,logs}
2020-05-18 13:33:45 +00:00
%attr (750,git,git) %dir /srv/gitolite/.ssh
2018-10-01 11:28:15 +00:00
%attr (-,git,git) %config (noreplace) /srv/gitolite/.gitolite/conf/gitolite.conf
%attr (-,git,git) %config (noreplace) /srv/gitolite/.gitolite.rc
%attr (-,git,git) %dir /srv/www/pagure-releases
2020-08-04 13:20:15 +00:00
%attr (-,git,git) %dir %{_localstatedir} /log/pagure
2018-10-01 11:28:15 +00:00
2020-05-15 01:13:38 +00:00
%files web-apache-httpd
%license LICENSE
%doc files/pagure-apache-httpd.conf
%config (noreplace) %{_sysconfdir} /apache2/vhosts.d/pagure.conf
%config (noreplace) %{_datadir} /pagure/*.wsgi
%files web-nginx
%license LICENSE
%doc files/pagure-nginx.conf
%config (noreplace) %{_sysconfdir} /nginx/vhosts.d/pagure.conf
%{_unitdir} /pagure_web.service
%{_unitdir} /pagure_docs_web.service
2020-08-04 13:20:15 +00:00
%ghost %{_localstatedir} /log/pagure/access_*.log
%ghost %{_localstatedir} /log/pagure/error_*.log
2020-05-15 01:13:38 +00:00
2018-10-01 11:28:15 +00:00
%files theme-upstream
%license LICENSE
%{python3_sitelib} /pagure/themes/upstream/
%files theme-pagureio
%license LICENSE
%{python3_sitelib} /pagure/themes/pagureio/
%files theme-srcfpo
%license LICENSE
%{python3_sitelib} /pagure/themes/srcfpo/
%files theme-chameleon
%license LICENSE
%{python3_sitelib} /pagure/themes/chameleon/
%files theme-default-upstream
%license LICENSE
%{python3_sitelib} /pagure/themes/default
%files theme-default-openSUSE
%license LICENSE
%{python3_sitelib} /pagure/themes/default.openSUSE
%files milters
%license LICENSE
%dir %{_datadir} /pagure/
%{_tmpfilesdir} /%{name} -milter.conf
%{_unitdir} /pagure_milter.service
%{_datadir} /pagure/comment_email_milter.py*
%{_sbindir} /rcpagure_milter
%files ev
%license LICENSE
%{_libexecdir} /pagure-ev/
%{_unitdir} /pagure_ev.service
%{_sbindir} /rcpagure_ev
%files webhook
%license LICENSE
%{_unitdir} /pagure_webhook.service
%{_sbindir} /rcpagure_webhook
%files ci
%license LICENSE
%{_unitdir} /pagure_ci.service
%{_sbindir} /rcpagure_ci
%files logcom
%license LICENSE
%{_unitdir} /pagure_logcom.service
%{_sbindir} /rcpagure_logcom
%files loadjson
%license LICENSE
%{_unitdir} /pagure_loadjson.service
%{_sbindir} /rcpagure_loadjson
%files mirror
%license LICENSE
%{_unitdir} /pagure_mirror.service
%{_sbindir} /rcpagure_mirror
%changelog