forked from fedora-copr/copr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpmbuild, dist-git-client: new package dist-git-client
The dist-git-client utility seems generic enough to have it built separately. This could be useful e.g. for the Konflux build initiative, where we don't necessarily have to build the full copr-rpmbuild package to operate with DistGit.
- Loading branch information
Showing
11 changed files
with
493 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1-0 dist-git-client/ |
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
rpmbuild/bin/copr-distgit-client → dist-git-client/bin/dist-git-client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#! /usr/bin/python | ||
#! /usr/bin/python3 | ||
|
||
""" | ||
From within a git checkout, try to download files from dist-git lookaside cache. | ||
""" | ||
|
||
from copr_distgit_client import main | ||
from dist_git_client import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# 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.1 | ||
Release: 0%{?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: python3-six | ||
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 "copr-team@redhat.com" \ | ||
--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 <praiskup@redhat.com> 1.1-0 | ||
- new package built with tito |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
args=() | ||
|
||
coverage=( --cov-report term-missing --cov bin --cov dist_git_client ) | ||
for arg; do | ||
case $arg in | ||
--no-coverage) coverage=() ;; | ||
*) args+=( "$arg" ) ;; | ||
esac | ||
done | ||
|
||
abspath=$(readlink -f .) | ||
export PYTHONPATH="${PYTHONPATH+$PYTHONPATH:}$abspath" | ||
export PATH=$(readlink -f bin):$PATH | ||
"${PYTHON:-python3}" -m pytest -s tests "${coverage[@]}" "${args[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.