Skip to content

Commit 6047d4b

Browse files
praiskupFrostyX
authored andcommitted
dist-git-client: new package
Inherited from Copr basecode, namely starting from fedora-copr/copr#3299
1 parent aae2272 commit 6047d4b

File tree

12 files changed

+1449
-1
lines changed

12 files changed

+1449
-1
lines changed

.packit.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ packages:
2222
upstream_tag_template: 'dist-git-{version}'
2323
paths:
2424
- dist-git
25-
25+
dist-git-client:
26+
specfile_path: dist-git-client.spec
27+
upstream_package_name: dist-git-client
28+
downstream_package_name: dist-git-client
29+
upstream_tag_template: 'dist-git-client-{version}'
30+
paths:
31+
- dist-git-client
2632
jobs:
2733
- &copr
2834
job: copr_build
2935
packages:
3036
- dist-git
37+
- dist-git-client
3138
trigger: pull_request
3239
metadata:
3340
targets:

.tito/packages/dist-git-client

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0-1 dist-git-client/

dist-git-client/LICENSE

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/python3
2+
3+
"""
4+
From within a git checkout, try to download files from dist-git lookaside cache.
5+
"""
6+
7+
from dist_git_client import main
8+
9+
if __name__ == "__main__":
10+
main()

dist-git-client/dist-git-client

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#! /bin/sh
2+
3+
# Run copr-disgit-client script directly from git, TESTING ONLY SCRIPT!
4+
# Copyright (C) 2020 Red Hat, Inc.
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License along
17+
# with this program; if not, write to the Free Software Foundation, Inc.,
18+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
20+
absdir="$(dirname "$(readlink -f "$0")")"
21+
export PYTHONPATH="$absdir${PYTHONPATH+:$PYTHONPATH}"
22+
python3 "$absdir/bin/dist-git-client" "$@"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# SPEC file overview:
2+
# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/#con_rpm-spec-file-overview
3+
# Fedora packaging guidelines:
4+
# https://docs.fedoraproject.org/en-US/packaging-guidelines/
5+
6+
7+
Name: dist-git-client
8+
Version: 1.0
9+
Release: 1%{?dist}
10+
Summary: Get sources for RPM builds from DistGit repositories
11+
BuildArch: noarch
12+
13+
License: GPL-2.0-or-later
14+
URL: https://github.com/release-engineering/dist-git.git
15+
Source0: %name-%version.tar.gz
16+
17+
Requires: curl
18+
Requires: /usr/bin/git
19+
20+
BuildRequires: python3-pytest
21+
BuildRequires: python3-rpm-macros
22+
BuildRequires: /usr/bin/argparse-manpage
23+
BuildRequires: /usr/bin/git
24+
25+
%if 0%{?fedora} || 0%{?rhel} > 9
26+
Requires: python3-rpmautospec
27+
BuildRequires: python3-rpmautospec
28+
%endif
29+
30+
%description
31+
A simple, configurable python utility that is able to clone package sources from
32+
a DistGit repository, download sources from the corresponding lookaside cache
33+
locations, and generate source RPMs.
34+
35+
The utility is able to automatically map the .git/config clone URL into the
36+
corresponding DistGit instance configuration.
37+
38+
39+
%prep
40+
%setup -q
41+
42+
43+
%build
44+
45+
46+
47+
%install
48+
install -d %{buildroot}%{_bindir}
49+
install -d %{buildroot}%{_mandir}/man1
50+
install -d %{buildroot}%{_sysconfdir}/dist-git-client
51+
install -d %{buildroot}%{python3_sitelib}
52+
install -p -m 755 bin/dist-git-client %buildroot%_bindir
53+
argparse-manpage --pyfile dist_git_client.py \
54+
--function _get_argparser \
55+
--author "Copr Team" \
56+
--author-email "[email protected]" \
57+
--url %url --project-name Copr \
58+
> %{buildroot}%{_mandir}/man1/dist-git-client.1
59+
install -p -m 644 etc/default.ini \
60+
%{buildroot}%{_sysconfdir}/dist-git-client
61+
install -p -m 644 dist_git_client.py %{buildroot}%{python3_sitelib}
62+
63+
64+
%check
65+
PYTHON=python3 ./run_tests.sh -vv --no-coverage
66+
67+
68+
%files
69+
%license LICENSE
70+
%_bindir/dist-git-client
71+
%_mandir/man1/dist-git-client.1*
72+
%dir %_sysconfdir/dist-git-client
73+
%config %_sysconfdir/dist-git-client/default.ini
74+
%python3_sitelib/dist_git_client.*
75+
%python3_sitelib/__pycache__/dist_git_client*
76+
77+
78+
%changelog
79+
* Thu Jun 06 2024 Pavel Raiskup <[email protected]> 1.1-0
80+
- new package built with tito

0 commit comments

Comments
 (0)