diff options
Diffstat (limited to 'python-rand-string.spec')
-rw-r--r-- | python-rand-string.spec | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/python-rand-string.spec b/python-rand-string.spec new file mode 100644 index 0000000..226d315 --- /dev/null +++ b/python-rand-string.spec @@ -0,0 +1,216 @@ +%global _empty_manifest_terminate_build 0 +Name: python-rand-string +Version: 0.50 +Release: 1 +Summary: Generates a random string of a specified length. +License: MIT +URL: https://github.com/TheSongList/random-string +Source0: https://mirrors.aliyun.com/pypi/web/packages/6a/ad/4daf29ad0206cc38d0b0d0c440dd3412424944b39e57ad93c9dd218ff368/rand-string-0.50.tar.gz +BuildArch: noarch + + +%description +# rand-string +Generates a random string of a specified length. + +# Usage +Currently there are 5 types: +- uppercase +- lowercase +- upperlower +- alphanumerical +- ascii + +You can probably guess what each one would create + +The function requires 2 parameters type and length; Type of course is the above. +```py +import rand_string.rand_string as rand +rand.RandString(type, length) +``` +Now lets look at some examples + +uppercase: +```py +print(rand.RandString("uppercase", 10)) +# Output: TPDROEAVRY +``` + +lowercase: +```py +print(rand.RandString("lowercase", 10)) +# Output: mdvsewzkwf +``` + +upperlower: +```py +print(rand.RandString("upperlower", 10)) +# Output: YjHFGzysFx +``` + +alphanumerical: +```py +print(rand.RandString("alphanumerical", 10)) +# Output: Fy0Nbqno6B +``` + +ascii: +```py +print(rand.RandString("ascii", 10)) +# Output: jtj-NV<PSV +``` + +%package -n python3-rand-string +Summary: Generates a random string of a specified length. +Provides: python-rand-string +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-rand-string +# rand-string +Generates a random string of a specified length. + +# Usage +Currently there are 5 types: +- uppercase +- lowercase +- upperlower +- alphanumerical +- ascii + +You can probably guess what each one would create + +The function requires 2 parameters type and length; Type of course is the above. +```py +import rand_string.rand_string as rand +rand.RandString(type, length) +``` +Now lets look at some examples + +uppercase: +```py +print(rand.RandString("uppercase", 10)) +# Output: TPDROEAVRY +``` + +lowercase: +```py +print(rand.RandString("lowercase", 10)) +# Output: mdvsewzkwf +``` + +upperlower: +```py +print(rand.RandString("upperlower", 10)) +# Output: YjHFGzysFx +``` + +alphanumerical: +```py +print(rand.RandString("alphanumerical", 10)) +# Output: Fy0Nbqno6B +``` + +ascii: +```py +print(rand.RandString("ascii", 10)) +# Output: jtj-NV<PSV +``` + +%package help +Summary: Development documents and examples for rand-string +Provides: python3-rand-string-doc +%description help +# rand-string +Generates a random string of a specified length. + +# Usage +Currently there are 5 types: +- uppercase +- lowercase +- upperlower +- alphanumerical +- ascii + +You can probably guess what each one would create + +The function requires 2 parameters type and length; Type of course is the above. +```py +import rand_string.rand_string as rand +rand.RandString(type, length) +``` +Now lets look at some examples + +uppercase: +```py +print(rand.RandString("uppercase", 10)) +# Output: TPDROEAVRY +``` + +lowercase: +```py +print(rand.RandString("lowercase", 10)) +# Output: mdvsewzkwf +``` + +upperlower: +```py +print(rand.RandString("upperlower", 10)) +# Output: YjHFGzysFx +``` + +alphanumerical: +```py +print(rand.RandString("alphanumerical", 10)) +# Output: Fy0Nbqno6B +``` + +ascii: +```py +print(rand.RandString("ascii", 10)) +# Output: jtj-NV<PSV +``` + +%prep +%autosetup -n rand-string-0.50 + +%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-rand-string -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.50-1 +- Package Spec generated |