spec file

This commit is contained in:
Adam Majer 2024-09-11 13:15:09 +02:00
parent ab947586e9
commit 9c4f8d4979
2 changed files with 79 additions and 0 deletions

64
autogits.spec Normal file
View File

@ -0,0 +1,64 @@
#
# spec file for package autogits
#
# Copyright (c) 2024 SUSE LLC
#
# 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: autogits
Version: 0.0.1
Release: 0
Summary: GitWorkflow utilities
License: GPL-2.0-or-later
URL: https://src.opensuse.org/adamm/autogits/
Source: https://src.opensuse.org/adamm/autogits/0.0.1.tar.gz
Source1: vendor.tar.zst
BuildRequires: golang-packaging
BuildRequires: systemd-rpm-macros
BuildRequires: zstd
%{?systemd_ordering}
%description
Git Workflow tooling and utilities enabling automated handing of OBS projects
as git repositories
%package -n gitea-events-rabbitmq-publisher
Summary: Publishes Gitea webhook data via RabbitMQ
%description -n gitea-events-rabbitmq-publisher
Listens on an HTTP socket and publishes Gitea events on a RabbitMQ instance
with a topic
<scope>.src.$organization.$webhook_type.[$webhook_action_type]
%prep
%autosetup -p1
%build
go build \
-C gitea-events-rabbitmq-publisher \
-mod=vendor \
-buildmode=pie
%install
install -D -m0755 gitea-events-rabbitmq-publisher/gitea-events-rabbitmq-publisher %{buildroot}%{_bindir}
install -D -m0755 systemd/gitea-events-rabbitmq-publisher.service %{buildroot}%{_unitdir}
%files -n gitea-events-rabbitmq-publisher
%license COPYING
%doc gitea-events-rabbitmq-publisher/README.md
%{_bindir}/gitea-events-rabbitmq-publisher
%{_unitdir}/gitea-events-rabbitmq-publisher.service
%changelog

View File

@ -0,0 +1,15 @@
[Unit]
Description=Gitea webhook to RabbitMQ message publisher
[Service]
Type=exec
ExecStart=/usr/bin/gitea-events-rabbitmq-publisher
EnvironmentFile=-/etc/sysconfig/gitea-events-rabbitmq-publisher.env
DynamicUser=yes
NoNewPrivileges=yes
ProtectSystem=strict
[Install]
After=network-online.target
WantedBy=multi-user.target