diff options
Diffstat (limited to 'python-repomd.spec')
-rw-r--r-- | python-repomd.spec | 281 |
1 files changed, 281 insertions, 0 deletions
diff --git a/python-repomd.spec b/python-repomd.spec new file mode 100644 index 0000000..993b69b --- /dev/null +++ b/python-repomd.spec @@ -0,0 +1,281 @@ +%global _empty_manifest_terminate_build 0 +Name: python-repomd +Version: 0.2.1 +Release: 1 +Summary: Library for reading dnf/yum repositories +License: MIT +URL: https://github.com/carlwgeorge/repomd +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/54/ef/47155c061ac6cbdaa9b12f236474bb40f09a044f7ecb9d66d00d29a61496/repomd-0.2.1.tar.gz +BuildArch: noarch + +Requires: python3-defusedxml +Requires: python3-lxml +Requires: python3-pytest +Requires: python3-pytest-cov +Requires: python3-pytest-flake8 + +%description +[](https://cirrus-ci.com/github/carlwgeorge/repomd/master) + +# repomd + +This library provides an object-oriented interface to get information out of dnf/yum repositories. + +## Usage + +```python +>>> import repomd + +>>> repo = repomd.load('https://mirror.rackspace.com/centos/7/updates/x86_64/') + +>>> repo +<Repo: "https://mirror.rackspace.com/centos/7/updates/x86_64/"> +``` + +The length of the `Repo` object indicates the number of packages in the repository. + +```python +>>> len(repo) +1602 +``` + +Find a package by name. + +```python +>>> repo.find('systemd') +<Package: "systemd-219-57.el7_5.3.x86_64"> +``` + +Find all packages of a given name. + +```python +>>> repo.findall('systemd') +[<Package: "systemd-219-57.el7_5.1.x86_64">, <Package: "systemd-219-57.el7_5.3.x86_64">] +``` + +A `Package` instance has many useful properties. + +```python +>>> package = repo.find('systemd') + +>>> package.name +'systemd' + +>>> package.version +'219' + +>>> package.build_time +datetime.datetime(2018, 9, 26, 14, 11, 37) + +>>> package.nevr +'systemd-219-57.el7_5.3' +``` + +Iterate through packages in the repository. + +```python +>>> for package in repo: +... print(package.nvr) +389-ds-base-1.3.7.5-19.el7_5 +389-ds-base-1.3.7.5-21.el7_5 +389-ds-base-1.3.7.5-24.el7_5 +(and so on) +``` + + + + +%package -n python3-repomd +Summary: Library for reading dnf/yum repositories +Provides: python-repomd +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-repomd +[](https://cirrus-ci.com/github/carlwgeorge/repomd/master) + +# repomd + +This library provides an object-oriented interface to get information out of dnf/yum repositories. + +## Usage + +```python +>>> import repomd + +>>> repo = repomd.load('https://mirror.rackspace.com/centos/7/updates/x86_64/') + +>>> repo +<Repo: "https://mirror.rackspace.com/centos/7/updates/x86_64/"> +``` + +The length of the `Repo` object indicates the number of packages in the repository. + +```python +>>> len(repo) +1602 +``` + +Find a package by name. + +```python +>>> repo.find('systemd') +<Package: "systemd-219-57.el7_5.3.x86_64"> +``` + +Find all packages of a given name. + +```python +>>> repo.findall('systemd') +[<Package: "systemd-219-57.el7_5.1.x86_64">, <Package: "systemd-219-57.el7_5.3.x86_64">] +``` + +A `Package` instance has many useful properties. + +```python +>>> package = repo.find('systemd') + +>>> package.name +'systemd' + +>>> package.version +'219' + +>>> package.build_time +datetime.datetime(2018, 9, 26, 14, 11, 37) + +>>> package.nevr +'systemd-219-57.el7_5.3' +``` + +Iterate through packages in the repository. + +```python +>>> for package in repo: +... print(package.nvr) +389-ds-base-1.3.7.5-19.el7_5 +389-ds-base-1.3.7.5-21.el7_5 +389-ds-base-1.3.7.5-24.el7_5 +(and so on) +``` + + + + +%package help +Summary: Development documents and examples for repomd +Provides: python3-repomd-doc +%description help +[](https://cirrus-ci.com/github/carlwgeorge/repomd/master) + +# repomd + +This library provides an object-oriented interface to get information out of dnf/yum repositories. + +## Usage + +```python +>>> import repomd + +>>> repo = repomd.load('https://mirror.rackspace.com/centos/7/updates/x86_64/') + +>>> repo +<Repo: "https://mirror.rackspace.com/centos/7/updates/x86_64/"> +``` + +The length of the `Repo` object indicates the number of packages in the repository. + +```python +>>> len(repo) +1602 +``` + +Find a package by name. + +```python +>>> repo.find('systemd') +<Package: "systemd-219-57.el7_5.3.x86_64"> +``` + +Find all packages of a given name. + +```python +>>> repo.findall('systemd') +[<Package: "systemd-219-57.el7_5.1.x86_64">, <Package: "systemd-219-57.el7_5.3.x86_64">] +``` + +A `Package` instance has many useful properties. + +```python +>>> package = repo.find('systemd') + +>>> package.name +'systemd' + +>>> package.version +'219' + +>>> package.build_time +datetime.datetime(2018, 9, 26, 14, 11, 37) + +>>> package.nevr +'systemd-219-57.el7_5.3' +``` + +Iterate through packages in the repository. + +```python +>>> for package in repo: +... print(package.nvr) +389-ds-base-1.3.7.5-19.el7_5 +389-ds-base-1.3.7.5-21.el7_5 +389-ds-base-1.3.7.5-24.el7_5 +(and so on) +``` + + + + +%prep +%autosetup -n repomd-0.2.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-repomd -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.1-1 +- Package Spec generated |