From fab3526a6a89fa4df630d6e387fad367f14194d9 Mon Sep 17 00:00:00 2001 From: Jan Sakalos Date: Mar 21 2020 14:09:57 +0000 Subject: initial commit --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..008eb2b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +By contributing to this project you agree to the Developer Certificate of Origin (DCO). This document is a simple statement that you, as a contributor, have the legal right to submit the contribution. See the [DCO](DCO) file for details. \ No newline at end of file diff --git a/DCO b/DCO new file mode 100644 index 0000000..8201f99 --- /dev/null +++ b/DCO @@ -0,0 +1,37 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f89a87a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Red Hat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b43e71 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# hello-world + +The simplest python CLI tool used to demonstrate packit service functionality. It will make your day. + +``` +$ hello world! +Hello world! +``` + + +## How to? + +Just open a pull request on this repository and packit service will build your changes and provide an RPM repository using your pull request as a source. + +Follow the steps provided by the packit service and then install this tool like this: +```bash +$ dnf install hello +``` diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..385516b --- /dev/null +++ b/ci.fmf @@ -0,0 +1,9 @@ +--- +/test/build/smoke: + execute: + how: shell + commands: + - dnf -y install httpd curl + - systemctl start httpd + - echo foo > /var/www/html/index.html + - curl http://localhost/ | grep foo diff --git a/hello.spec b/hello.spec new file mode 100644 index 0000000..a1ead0a --- /dev/null +++ b/hello.spec @@ -0,0 +1,33 @@ +Name: hello +Version: 0.1.0 +Release: 1%{?dist} +Summary: Nice and a polite tool to make your day +License: MIT +URL: https://github.com/packit-service/hello-world +Source0: hello-%{version}.tar.gz +BuildArch: noarch +BuildRequires: python3-devel + +%description +%{summary} + + +%prep +%autosetup -n %{name}-%{version} + +%build +%py3_build + +%install +%py3_install + +%files +%license LICENSE +%{_bindir}/hello +%{python3_sitelib}/* +%doc README.md + +%changelog +* Thu May 02 2019 Tomas Tomecek - 0.1.0-1 +- initial upstream release: 0.1.0 + diff --git a/hello_world/__init__.py b/hello_world/__init__.py new file mode 100644 index 0000000..d39a17d --- /dev/null +++ b/hello_world/__init__.py @@ -0,0 +1,47 @@ +#!/usr/bin/python3 + +# MIT License +# +# Copyright (c) 2018-2019 Red Hat, Inc. + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +__version__ = "0.1.0" + +import sys + + +def usage(): + print( + "Usage: hello NAME\n" + ) + sys.exit(3) + + +def main(): + args_n = len(sys.argv) + if args_n <= 1: + usage() + elif args_n > 2: + usage() + print(f"Hello {sys.argv[1]}") + + +if __name__ == '__main__': + main() diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..49b92a4 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,31 @@ +[metadata] +name = hello +version = 0.1.0 +url = https://github.com/packit-service/hello +description = Nice and a polite tool +long_description = file: README.md +long_description_content_type = text/markdown +author = Red Hat +author_email = user-cont-team@redhat.com +license = MIT +license_file = LICENSE +classifiers = + Environment :: Console + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 +keywords = + hello + + +[options] +packages = find: +python_requires = >=3.6 +include_package_data = True + +[options.entry_points] +console_scripts = + hello=hello_world:main diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f1f301a --- /dev/null +++ b/setup.py @@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +# MIT License +# +# Copyright (c) 2018-2019 Red Hat, Inc. + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from setuptools import setup + +setup()