Skip to content

Commit

Permalink
dist-git-client: new package
Browse files Browse the repository at this point in the history
Inherited from Copr basecode, namely starting from
fedora-copr/copr#3299
  • Loading branch information
praiskup authored and FrostyX committed Jun 19, 2024
1 parent aae2272 commit 6047d4b
Show file tree
Hide file tree
Showing 12 changed files with 1,449 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ packages:
upstream_tag_template: 'dist-git-{version}'
paths:
- dist-git

dist-git-client:
specfile_path: dist-git-client.spec
upstream_package_name: dist-git-client
downstream_package_name: dist-git-client
upstream_tag_template: 'dist-git-client-{version}'
paths:
- dist-git-client
jobs:
- &copr
job: copr_build
packages:
- dist-git
- dist-git-client
trigger: pull_request
metadata:
targets:
Expand Down
1 change: 1 addition & 0 deletions .tito/packages/dist-git-client
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0-1 dist-git-client/
339 changes: 339 additions & 0 deletions dist-git-client/LICENSE

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dist-git-client/bin/dist-git-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/python3

"""
From within a git checkout, try to download files from dist-git lookaside cache.
"""

from dist_git_client import main

if __name__ == "__main__":
main()
22 changes: 22 additions & 0 deletions dist-git-client/dist-git-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/sh

# Run copr-disgit-client script directly from git, TESTING ONLY SCRIPT!
# Copyright (C) 2020 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

absdir="$(dirname "$(readlink -f "$0")")"
export PYTHONPATH="$absdir${PYTHONPATH+:$PYTHONPATH}"
python3 "$absdir/bin/dist-git-client" "$@"
80 changes: 80 additions & 0 deletions dist-git-client/dist-git-client.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# SPEC file overview:
# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/#con_rpm-spec-file-overview
# Fedora packaging guidelines:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/


Name: dist-git-client
Version: 1.0
Release: 1%{?dist}
Summary: Get sources for RPM builds from DistGit repositories
BuildArch: noarch

License: GPL-2.0-or-later
URL: https://github.com/release-engineering/dist-git.git
Source0: %name-%version.tar.gz

Requires: curl
Requires: /usr/bin/git

BuildRequires: python3-pytest
BuildRequires: python3-rpm-macros
BuildRequires: /usr/bin/argparse-manpage
BuildRequires: /usr/bin/git

%if 0%{?fedora} || 0%{?rhel} > 9
Requires: python3-rpmautospec
BuildRequires: python3-rpmautospec
%endif

%description
A simple, configurable python utility that is able to clone package sources from
a DistGit repository, download sources from the corresponding lookaside cache
locations, and generate source RPMs.

The utility is able to automatically map the .git/config clone URL into the
corresponding DistGit instance configuration.


%prep
%setup -q


%build



%install
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_mandir}/man1
install -d %{buildroot}%{_sysconfdir}/dist-git-client
install -d %{buildroot}%{python3_sitelib}
install -p -m 755 bin/dist-git-client %buildroot%_bindir
argparse-manpage --pyfile dist_git_client.py \
--function _get_argparser \
--author "Copr Team" \
--author-email "[email protected]" \
--url %url --project-name Copr \
> %{buildroot}%{_mandir}/man1/dist-git-client.1
install -p -m 644 etc/default.ini \
%{buildroot}%{_sysconfdir}/dist-git-client
install -p -m 644 dist_git_client.py %{buildroot}%{python3_sitelib}


%check
PYTHON=python3 ./run_tests.sh -vv --no-coverage


%files
%license LICENSE
%_bindir/dist-git-client
%_mandir/man1/dist-git-client.1*
%dir %_sysconfdir/dist-git-client
%config %_sysconfdir/dist-git-client/default.ini
%python3_sitelib/dist_git_client.*
%python3_sitelib/__pycache__/dist_git_client*


%changelog
* Thu Jun 06 2024 Pavel Raiskup <[email protected]> 1.1-0
- new package built with tito
Loading

0 comments on commit 6047d4b

Please sign in to comment.