import modulemd-tools-0.7-4.el8

This commit is contained in:
CentOS Sources 2021-03-16 02:38:19 +00:00 committed by Stepan Oksanichenko
commit b1ef3a331c
4 changed files with 399 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/modulemd-tools-0.7.tar.gz

1
.modulemd-tools.metadata Normal file
View File

@ -0,0 +1 @@
20c992eeb765a8651210d9151248bd09b97ac127 SOURCES/modulemd-tools-0.7.tar.gz

View File

@ -0,0 +1,224 @@
From c1668f6ca11562c12b6910ec8f399eb4e7e2cb3f Mon Sep 17 00:00:00 2001
From: Jakub Kadlcik <frostyx@email.cz>
Date: Tue, 9 Feb 2021 22:34:02 +0100
Subject: [PATCH] Dont generate manpages on the fly
---
man/createrepo_mod.1 | 21 +++++++++++++
man/dir2module.1 | 55 ++++++++++++++++++++++++++++++++++
man/modulemd-generate-macros.1 | 31 +++++++++++++++++++
man/modulemd-merge.1 | 39 ++++++++++++++++++++++++
man/repo2module.1 | 27 +++++++++++++++++
5 files changed, 173 insertions(+)
create mode 100644 man/createrepo_mod.1
create mode 100644 man/dir2module.1
create mode 100644 man/modulemd-generate-macros.1
create mode 100644 man/modulemd-merge.1
create mode 100644 man/repo2module.1
diff --git a/man/createrepo_mod.1 b/man/createrepo_mod.1
new file mode 100644
index 0000000..9acdd7d
--- /dev/null
+++ b/man/createrepo_mod.1
@@ -0,0 +1,21 @@
+.TH createrepo_mod "1" Manual
+.SH NAME
+createrepo_mod
+.SH SYNOPSIS
+.B createrepo_mod
+[-h] directory_to_index
+.SH DESCRIPTION
+A small wrapper around createrepo_c and modifyrepo_c toprovide an easy tool
+for generating module repositories
+.SH OPTIONS
+.TP
+\fBdirectory_to_index\fR
+Directory to index
+
+.SH AUTHORS
+.B createrepo_mod
+was written by Jakub Kadlčík <jkadlcik@redhat.com>.
+.SH DISTRIBUTION
+The latest version of createrepo_mod may be downloaded from
+.UR HOMEPAGE
+.UE
diff --git a/man/dir2module.1 b/man/dir2module.1
new file mode 100644
index 0000000..728792e
--- /dev/null
+++ b/man/dir2module.1
@@ -0,0 +1,55 @@
+.TH dir2module "1" Manual
+.SH NAME
+dir2module
+.SH SYNOPSIS
+.B dir2module
+[-h] -m SUMMARY [-d DESCRIPTION] [-l LICENSE] [-r REQUIRES] [--force] [--stdout] (--dir DIR | --pkglist PKGLIST) nsvca
+.SH DESCRIPTION
+Recursively read RPMs from DIR or read them from specified pkglist.If any RPM
+is missing on unreadable, error out.Populate artifacts/rpms with RPM
+NEVRAs.Populate license/content with list of RPM licenses.Write
+N:S:V:C:A.modulemd.yaml in the current directory.Make sure the yaml is in
+modulemd v2 format.
+.SH OPTIONS
+.TP
+\fBnsvca\fR
+Module name, stream version, context and architecture in a N:S:V:C:A format
+
+.TP
+\fB\-m\fR \fI\,SUMMARY\/\fR, \fB\-\-summary\fR \fI\,SUMMARY\/\fR
+Module summary
+
+.TP
+\fB\-d\fR \fI\,DESCRIPTION\/\fR, \fB\-\-description\fR \fI\,DESCRIPTION\/\fR
+Module description
+
+.TP
+\fB\-l\fR \fI\,LICENSE\/\fR, \fB\-\-license\fR \fI\,LICENSE\/\fR
+Module license
+
+.TP
+\fB\-r\fR \fI\,REQUIRES\/\fR, \fB\-\-requires\fR \fI\,REQUIRES\/\fR
+Module runtime dependencies in a N:S format. For multiple dependencies, repeat
+this option
+
+.TP
+\fB\-\-force\fR
+Suppress all constraints and hope for the best
+
+.TP
+\fB\-\-stdout\fR
+By defult the output is saved in a file. Use this to suppress it and print to
+the STDOUT
+
+.TP
+\fB\-\-dir\fR \fI\,DIR\/\fR
+.TP
+\fB\-\-pkglist\fR \fI\,PKGLIST\/\fR
+
+.SH AUTHORS
+.B dir2module
+was written by Jakub Kadlčík <jkadlcik@redhat.com>.
+.SH DISTRIBUTION
+The latest version of dir2module may be downloaded from
+.UR HOMEPAGE
+.UE
diff --git a/man/modulemd-generate-macros.1 b/man/modulemd-generate-macros.1
new file mode 100644
index 0000000..36a1e9a
--- /dev/null
+++ b/man/modulemd-generate-macros.1
@@ -0,0 +1,31 @@
+.TH modulemd-generate-macros "1" Manual
+.SH NAME
+modulemd-generate-macros
+.SH SYNOPSIS
+.B modulemd-generate-macros
+[-h] [--disttag DISTTAG] [--conflicts-from-file CONFLICTS_FROM_FILE] yaml
+.SH DESCRIPTION
+Generate `module\-build\-macros` SRPM package, which is a central piece for
+building modules. It should be present in the buildroot before any other
+module packages are submitted to be built.
+.SH OPTIONS
+.TP
+\fByaml\fR
+Path to modulemd YAML file
+
+.TP
+\fB\-\-disttag\fR \fI\,DISTTAG\/\fR
+Disttag
+
+.TP
+\fB\-\-conflicts\-from\-file\fR \fI\,CONFLICTS_FROM_FILE\/\fR
+Path to a file containing conflicts definitions and their reasoning. Content
+of this file gets simply pasted into the specfile
+
+.SH AUTHORS
+.B modulemd\-generate\-macros
+was written by Jakub Kadlčík <jkadlcik@redhat.com>.
+.SH DISTRIBUTION
+The latest version of modulemd\-generate\-macros may be downloaded from
+.UR HOMEPAGE
+.UE
diff --git a/man/modulemd-merge.1 b/man/modulemd-merge.1
new file mode 100644
index 0000000..3f280ff
--- /dev/null
+++ b/man/modulemd-merge.1
@@ -0,0 +1,39 @@
+.TH modulemd-merge "1" Manual
+.SH NAME
+modulemd-merge
+.SH SYNOPSIS
+.B modulemd-merge
+[-h] [-v] [-d] [-i] input [input ...] output
+.SH DESCRIPTION
+Merge several modules.yaml files (rpm modularity metadata) into one.
+.SH OPTIONS
+.TP
+\fBinput\fR
+input filename(s) or directories.
+repomd.xml files are parsed and modules hrefs contained are merged.
+If a directory is given, it is searched for repodata/repomd.xml
+and repomd.xml
+
+.TP
+\fBoutput\fR
+YAML output filename
+
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+increase output verbosity
+
+.TP
+\fB\-d\fR, \fB\-\-debug\fR
+debug output verbosity
+
+.TP
+\fB\-i\fR, \fB\-\-ignore\-no\-input\fR
+ignore non\-existing input files
+
+.SH AUTHORS
+.B modulemd\-merge
+was written by Gerd v. Egidy <gerd.von.egidy@intra2net.com>.
+.SH DISTRIBUTION
+The latest version of modulemd\-merge may be downloaded from
+.UR HOMEPAGE
+.UE
diff --git a/man/repo2module.1 b/man/repo2module.1
new file mode 100644
index 0000000..bdc2aa8
--- /dev/null
+++ b/man/repo2module.1
@@ -0,0 +1,27 @@
+.TH "REPO2MODULE" "1" "2021-02-09" "" "repo2module Manual"
+.SH NAME
+repo2module \- Generates modules.yaml file with a module,...
+.SH SYNOPSIS
+.B repo2module
+[OPTIONS] REPO_PATH [MODULES_YAML]
+.SH DESCRIPTION
+Generates modules.yaml file with a module, that provides all RPM packages that are available within a repository.
+.SH OPTIONS
+.TP
+\fB\-d,\fP \-\-debug / \-\-nodebug
+.PP
+.TP
+\fB\-n,\fP \-\-module\-name TEXT
+[default: (Current directory name)]
+.TP
+\fB\-s,\fP \-\-module\-stream TEXT
+[default: rolling]
+.TP
+\fB\-v,\fP \-\-module\-version INTEGER
+[default: 1]
+.TP
+\fB\-c,\fP \-\-module\-context TEXT
+[default: abcdef12]
+.TP
+\fB\-O,\fP \-\-to\-stdout
+.PP
--
2.29.2

173
SPECS/modulemd-tools.spec Normal file
View File

@ -0,0 +1,173 @@
Name: modulemd-tools
Version: 0.7
Release: 4%{?dist}
Summary: Collection of tools for parsing and generating modulemd YAML files
License: MIT
BuildArch: noarch
URL: https://github.com/rpm-software-management/modulemd-tools
Source0: https://github.com/rpm-software-management/modulemd-tools/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Dont-generate-manpages-on-the-fly.patch
BuildRequires: createrepo_c
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-libmodulemd >= 2.9.3
BuildRequires: python3-click
BuildRequires: python3-dnf
BuildRequires: python3-hawkey
BuildRequires: python3-createrepo_c
BuildRequires: python3-pyyaml
BuildRequires: python3-pytest
Requires: createrepo_c
Requires: python3-click
Requires: python3-dnf
Requires: python3-hawkey
Requires: python3-createrepo_c
Requires: python3-pyyaml
Requires: python3-libmodulemd >= 2.9.3
%description
Tools provided by this package:
repo2module - Takes a YUM repository on its input and creates modules.yaml
containing YAML module definitions generated for each package.
dir2module - Generates a module YAML definition based on essential module
information provided via command-line parameters. The packages provided by
the module are found in a specified directory or a text file containing
their list.
createrepo_mod - A small wrapper around createrepo_c and modifyrepo_c to provide
an easy tool for generating module repositories.
modulemd-merge - Merge several modules.yaml files into one. This is useful for
example if you have several yum repositories and want to merge them into one.
modulemd-generate-macros - Generate module-build-macros SRPM package, which is
a central piece for building modules. It should be present in the buildroot
before any other module packages are submitted to be built.
%prep
%setup -q
%patch1 -p1
%build
cd repo2module
%py3_build
cd ..
cd dir2module
%py3_build
cd ..
%install
cd repo2module
%py3_install
cd ..
cd dir2module
%py3_install
cd ..
cp createrepo_mod/createrepo_mod.py %{buildroot}%{_bindir}/createrepo_mod
cp modulemd-merge/modulemd-merge.py %{buildroot}%{_bindir}/modulemd-merge
cp modulemd-generate-macros/modulemd-generate-macros.py \
%{buildroot}%{_bindir}/modulemd-generate-macros
cp -r modulemd_tools/modulemd_tools %{buildroot}%{python3_sitelib}/modulemd_tools
install -d %{buildroot}%{_mandir}/man1
cp man/*.1 %{buildroot}%{_mandir}/man1/
%check
cd repo2module
%{__python3} -m pytest
cd ..
cd dir2module
%{__python3} -m pytest
cd ..
%files
%doc README.md
%license LICENSE
%{python3_sitelib}/repo2module
%{python3_sitelib}/repo2module-*.egg-info/
%{python3_sitelib}/dir2module
%{python3_sitelib}/dir2module-*.egg-info/
%{_bindir}/repo2module
%{_bindir}/dir2module
%{_bindir}/createrepo_mod
%{_bindir}/modulemd-merge
%{_bindir}/modulemd-generate-macros
%{python3_sitelib}/modulemd_tools
%{_mandir}/man1/repo2module.1*
%{_mandir}/man1/dir2module.1*
%{_mandir}/man1/createrepo_mod.1*
%{_mandir}/man1/modulemd-merge.1*
%{_mandir}/man1/modulemd-generate-macros.1.*
%changelog
* Tue Mar 02 2021 Jakub Kadlčík <jkadlcik@redhat.com> - 0.7-4
- Rebuild for 8.5.0
* Thu Feb 11 2021 Jakub Kadlčík <jkadlcik@redhat.com> - 0.7-3
- Bump spec to rebuild with gating enabled
* Tue Feb 09 2021 Jakub Kadlčík <jkadlcik@redhat.com> - 0.7-2
- Do not generate manpages on the fly
- Drop python-parameterized dependency
- Fix python3 macro for running tests
* Tue Feb 09 2021 Jakub Kadlcik <frostyx@email.cz> 0.7-1
- Generate manpages on the fly
- Automated test builds incl. Docker/Travis
- Fix PEP8 in all tools
- modulemd_tools: temporarily skip some tests on EPEL8 or Fedora
- Drop libmodulemd dependency in favor of python3-libmodulemd
* Sun Nov 22 2020 Jakub Kadlcik <frostyx@email.cz> 0.6-1
- Generate manpages for all tools in this repository
- modulemd-generate-macros: add a tool for generating module-build-macros
- modulemd_tools: add the first pieces of a python library (for internal usage only)
* Thu Nov 05 2020 Jakub Kadlcik <frostyx@email.cz> 0.5-1
- Release for epel8 as well (frostyx@email.cz)
- Require createrepo_c for the createrepo_mod package (frostyx@email.cz)
- modulemd-merge: improve README.md file (frostyx@email.cz)
- repo2module: improve README.md file (frostyx@email.cz)
- dir2module: improve README.md file (frostyx@email.cz)
- Improve README.md file (frostyx@email.cz)
- createrepo_mod: improve README.md file (frostyx@email.cz)
- Loosen the python3-libmodulemd dependency to just libmodulemd
(frostyx@email.cz)
- createrepo_mod: use just createrepo_c if it has built-in module support
(frostyx@email.cz)
- Explicitly depend on python3-setuptools (frostyx@email.cz)
- createrepo_mod: dump modules.yaml into the correct directory
(frostyx@email.cz)
* Mon Aug 10 2020 Jakub Kadlcik <frostyx@email.cz> 0.4-1
- createrepo_mod: support also non-module repositories (frostyx@email.cz)
* Wed Jul 29 2020 Jakub Kadlcik <frostyx@email.cz> 0.3-1
- Add createrepo_mod and modulemd-merge scripts
* Sun Jul 26 2020 Jakub Kadlčík <jkadlcik@redhat.com> - 0.2-1
- Add createrepo_mod tool
- Add modulemd-merge tool
- Drop Source1, it is not needed anymore
* Tue Jun 09 2020 Jakub Kadlčík <jkadlcik@redhat.com> - 0.1-1
- Initial package