diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-11 23:56:42 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 23:56:42 +0000 |
commit | 6e629ca712da15859822047e0c33d706243e18fd (patch) | |
tree | d9f6962609b00608bf3f16cf669d2752d8a27788 | |
parent | 6d0c8aa6530da973386458bae6c9c7ff2dc3155a (diff) |
automatic import of python-bagit-profile
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-bagit-profile.spec | 230 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 232 insertions, 0 deletions
@@ -0,0 +1 @@ +/bagit_profile-1.3.1.tar.gz diff --git a/python-bagit-profile.spec b/python-bagit-profile.spec new file mode 100644 index 0000000..b5ed161 --- /dev/null +++ b/python-bagit-profile.spec @@ -0,0 +1,230 @@ +%global _empty_manifest_terminate_build 0 +Name: python-bagit-profile +Version: 1.3.1 +Release: 1 +Summary: This module can be used to validate BagitProfiles. +License: CC0 +URL: https://github.com/bagit-profiles/bagit-profiles-validator +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/fc/30/1768557c9f93e20ca2873df0f826c699cb31818099c6856d9b01d50e039b/bagit_profile-1.3.1.tar.gz +BuildArch: noarch + +Requires: python3-bagit +Requires: python3-requests + +%description +Description +~~~~~~~~~~~ +A simple Python module for validating BagIt profiles. See the `BagIt +Profiles Specification +<https://github.com/bagit-profiles/bagit-profiles/blob/master/README.md>`__ +for more information. +This module is intended for use with +`bagit-python <https://github.com/LibraryOfCongress/bagit-python>`__ but does not extend it. +Installation +~~~~~~~~~~~~ +``bagit_profile.py`` is a single-file python module that you can drop into +your project as needed or you can install globally with: +1. ``git clone https://github.com/bagit-profiles/bagit-profiles-validator.git`` +2. ``cd bagit-profiles-validator`` +3. ``sudo python setup.py install`` +or: +``pip install bagit_profile`` +Usage +~~~~~ + import bagit + import bagit_profile +Instantiate an existing Bag using +`bagit <https://github.com/LibraryOfCongress/bagit-python>`__. +``python bag = bagit.Bag('mydir')`` +Instantiate a profile, supplying its URI. +``python my_profile = bagit_profile.Profile('http://example.com/bagitprofile.json')`` +Validate 'Serialization' and 'Accept-Serialization'. This must be done +before .validate(bag) is called. 'mydir' is the path to the Bag. + if my_profile.validate_serialization('mydir'): + print "Serialization validates" + else: + print "Serialization does not validate" +Validate the rest of the profile. + if my_profile.validate(bag): + print "Validates" + else: + print "Does not validate" +Or from the commandline: +``bagit_profile.py 'http://uri.for.profile/profile.json' path/to/bag`` +Test suite +~~~~~~~~~~ +``python setup.py test`` +Development +~~~~~~~~~~~ +1. `Fork the + repository <https://help.github.com/articles/fork-a-repo>`__ +2. Do something awesome! +3. `Submit a pull + request <https://help.github.com/articles/creating-a-pull-request>`__ + explianing what your code does +License +~~~~~~~ + CC0 + +%package -n python3-bagit-profile +Summary: This module can be used to validate BagitProfiles. +Provides: python-bagit-profile +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-bagit-profile +Description +~~~~~~~~~~~ +A simple Python module for validating BagIt profiles. See the `BagIt +Profiles Specification +<https://github.com/bagit-profiles/bagit-profiles/blob/master/README.md>`__ +for more information. +This module is intended for use with +`bagit-python <https://github.com/LibraryOfCongress/bagit-python>`__ but does not extend it. +Installation +~~~~~~~~~~~~ +``bagit_profile.py`` is a single-file python module that you can drop into +your project as needed or you can install globally with: +1. ``git clone https://github.com/bagit-profiles/bagit-profiles-validator.git`` +2. ``cd bagit-profiles-validator`` +3. ``sudo python setup.py install`` +or: +``pip install bagit_profile`` +Usage +~~~~~ + import bagit + import bagit_profile +Instantiate an existing Bag using +`bagit <https://github.com/LibraryOfCongress/bagit-python>`__. +``python bag = bagit.Bag('mydir')`` +Instantiate a profile, supplying its URI. +``python my_profile = bagit_profile.Profile('http://example.com/bagitprofile.json')`` +Validate 'Serialization' and 'Accept-Serialization'. This must be done +before .validate(bag) is called. 'mydir' is the path to the Bag. + if my_profile.validate_serialization('mydir'): + print "Serialization validates" + else: + print "Serialization does not validate" +Validate the rest of the profile. + if my_profile.validate(bag): + print "Validates" + else: + print "Does not validate" +Or from the commandline: +``bagit_profile.py 'http://uri.for.profile/profile.json' path/to/bag`` +Test suite +~~~~~~~~~~ +``python setup.py test`` +Development +~~~~~~~~~~~ +1. `Fork the + repository <https://help.github.com/articles/fork-a-repo>`__ +2. Do something awesome! +3. `Submit a pull + request <https://help.github.com/articles/creating-a-pull-request>`__ + explianing what your code does +License +~~~~~~~ + CC0 + +%package help +Summary: Development documents and examples for bagit-profile +Provides: python3-bagit-profile-doc +%description help +Description +~~~~~~~~~~~ +A simple Python module for validating BagIt profiles. See the `BagIt +Profiles Specification +<https://github.com/bagit-profiles/bagit-profiles/blob/master/README.md>`__ +for more information. +This module is intended for use with +`bagit-python <https://github.com/LibraryOfCongress/bagit-python>`__ but does not extend it. +Installation +~~~~~~~~~~~~ +``bagit_profile.py`` is a single-file python module that you can drop into +your project as needed or you can install globally with: +1. ``git clone https://github.com/bagit-profiles/bagit-profiles-validator.git`` +2. ``cd bagit-profiles-validator`` +3. ``sudo python setup.py install`` +or: +``pip install bagit_profile`` +Usage +~~~~~ + import bagit + import bagit_profile +Instantiate an existing Bag using +`bagit <https://github.com/LibraryOfCongress/bagit-python>`__. +``python bag = bagit.Bag('mydir')`` +Instantiate a profile, supplying its URI. +``python my_profile = bagit_profile.Profile('http://example.com/bagitprofile.json')`` +Validate 'Serialization' and 'Accept-Serialization'. This must be done +before .validate(bag) is called. 'mydir' is the path to the Bag. + if my_profile.validate_serialization('mydir'): + print "Serialization validates" + else: + print "Serialization does not validate" +Validate the rest of the profile. + if my_profile.validate(bag): + print "Validates" + else: + print "Does not validate" +Or from the commandline: +``bagit_profile.py 'http://uri.for.profile/profile.json' path/to/bag`` +Test suite +~~~~~~~~~~ +``python setup.py test`` +Development +~~~~~~~~~~~ +1. `Fork the + repository <https://help.github.com/articles/fork-a-repo>`__ +2. Do something awesome! +3. `Submit a pull + request <https://help.github.com/articles/creating-a-pull-request>`__ + explianing what your code does +License +~~~~~~~ + CC0 + +%prep +%autosetup -n bagit-profile-1.3.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-bagit-profile -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.1-1 +- Package Spec generated @@ -0,0 +1 @@ +0b0cd189b26eb0a4c61ac59d564ba0cf bagit_profile-1.3.1.tar.gz |