summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-dockerfile-parse.spec263
-rw-r--r--sources1
3 files changed, 265 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..fbc98c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/dockerfile-parse-2.0.0.tar.gz
diff --git a/python-dockerfile-parse.spec b/python-dockerfile-parse.spec
new file mode 100644
index 0000000..ecfb90c
--- /dev/null
+++ b/python-dockerfile-parse.spec
@@ -0,0 +1,263 @@
+%global _empty_manifest_terminate_build 0
+Name: python-dockerfile-parse
+Version: 2.0.0
+Release: 1
+Summary: Python library for Dockerfile manipulation
+License: BSD
+URL: https://github.com/containerbuildsystem/dockerfile-parse
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0f/c4/8c4fc1da93a67878b15eaac0d47f467c87be7a12406544b1b33e261a0454/dockerfile-parse-2.0.0.tar.gz
+BuildArch: noarch
+
+
+%description
+# dockerfile-parse
+
+[![unittests status badge]][unittests status link]
+[![coveralls status badge]][coveralls status link]
+[![lgtm python badge]][lgtm python link]
+[![lgtm alerts badge]][lgtm alerts link]
+[![linters status badge]][linters status link]
+
+Python library for parsing Dockerfile files.
+
+## Installation
+
+### From PyPI
+
+```shell
+pip install dockerfile-parse
+```
+
+### From git
+
+Clone this git repo and install using the python installer
+
+```shell
+git clone https://github.com/containerbuildsystem/dockerfile-parse.git
+cd dockerfile-parse
+sudo pip install .
+```
+
+## Usage
+
+```python
+from pprint import pprint
+from dockerfile_parse import DockerfileParser
+
+dfp = DockerfileParser()
+dfp.content = """\
+From base
+LABEL foo="bar baz"
+USER me"""
+
+# Print the parsed structure:
+pprint(dfp.structure)
+pprint(dfp.json)
+pprint(dfp.labels)
+
+# Set a new base:
+dfp.baseimage = 'centos:7'
+
+# Print the new Dockerfile with an updated FROM line:
+print(dfp.content)
+```
+
+[coveralls status badge]: https://coveralls.io/repos/containerbuildsystem/dockerfile-parse/badge.svg?branch=master
+[coveralls status link]: https://coveralls.io/r/containerbuildsystem/dockerfile-parse?branch=master
+[lgtm python badge]: https://img.shields.io/lgtm/grade/python/g/containerbuildsystem/dockerfile-parse.svg?logo=lgtm&logoWidth=18
+[lgtm python link]: https://lgtm.com/projects/g/containerbuildsystem/dockerfile-parse/context:python
+[lgtm alerts badge]: https://img.shields.io/lgtm/alerts/g/containerbuildsystem/dockerfile-parse.svg?logo=lgtm&logoWidth=18
+[lgtm alerts link]: https://lgtm.com/projects/g/containerbuildsystem/dockerfile-parse/alerts
+[linters status badge]: https://github.com/containerbuildsystem/dockerfile-parse/workflows/Linters/badge.svg?branch=master&event=push
+[linters status link]: https://github.com/containerbuildsystem/dockerfile-parse/actions?query=event%3Apush+branch%3Amaster+workflow%3A%22Linters%22
+[unittests status badge]: https://github.com/containerbuildsystem/dockerfile-parse/workflows/Unittests/badge.svg?branch=master&event=push
+[unittests status link]: https://github.com/containerbuildsystem/dockerfile-parse/actions?query=event%3Apush+branch%3Amaster+workflow%3A%22Unittests%22
+
+
+
+
+%package -n python3-dockerfile-parse
+Summary: Python library for Dockerfile manipulation
+Provides: python-dockerfile-parse
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%description -n python3-dockerfile-parse
+# dockerfile-parse
+
+[![unittests status badge]][unittests status link]
+[![coveralls status badge]][coveralls status link]
+[![lgtm python badge]][lgtm python link]
+[![lgtm alerts badge]][lgtm alerts link]
+[![linters status badge]][linters status link]
+
+Python library for parsing Dockerfile files.
+
+## Installation
+
+### From PyPI
+
+```shell
+pip install dockerfile-parse
+```
+
+### From git
+
+Clone this git repo and install using the python installer
+
+```shell
+git clone https://github.com/containerbuildsystem/dockerfile-parse.git
+cd dockerfile-parse
+sudo pip install .
+```
+
+## Usage
+
+```python
+from pprint import pprint
+from dockerfile_parse import DockerfileParser
+
+dfp = DockerfileParser()
+dfp.content = """\
+From base
+LABEL foo="bar baz"
+USER me"""
+
+# Print the parsed structure:
+pprint(dfp.structure)
+pprint(dfp.json)
+pprint(dfp.labels)
+
+# Set a new base:
+dfp.baseimage = 'centos:7'
+
+# Print the new Dockerfile with an updated FROM line:
+print(dfp.content)
+```
+
+[coveralls status badge]: https://coveralls.io/repos/containerbuildsystem/dockerfile-parse/badge.svg?branch=master
+[coveralls status link]: https://coveralls.io/r/containerbuildsystem/dockerfile-parse?branch=master
+[lgtm python badge]: https://img.shields.io/lgtm/grade/python/g/containerbuildsystem/dockerfile-parse.svg?logo=lgtm&logoWidth=18
+[lgtm python link]: https://lgtm.com/projects/g/containerbuildsystem/dockerfile-parse/context:python
+[lgtm alerts badge]: https://img.shields.io/lgtm/alerts/g/containerbuildsystem/dockerfile-parse.svg?logo=lgtm&logoWidth=18
+[lgtm alerts link]: https://lgtm.com/projects/g/containerbuildsystem/dockerfile-parse/alerts
+[linters status badge]: https://github.com/containerbuildsystem/dockerfile-parse/workflows/Linters/badge.svg?branch=master&event=push
+[linters status link]: https://github.com/containerbuildsystem/dockerfile-parse/actions?query=event%3Apush+branch%3Amaster+workflow%3A%22Linters%22
+[unittests status badge]: https://github.com/containerbuildsystem/dockerfile-parse/workflows/Unittests/badge.svg?branch=master&event=push
+[unittests status link]: https://github.com/containerbuildsystem/dockerfile-parse/actions?query=event%3Apush+branch%3Amaster+workflow%3A%22Unittests%22
+
+
+
+
+%package help
+Summary: Development documents and examples for dockerfile-parse
+Provides: python3-dockerfile-parse-doc
+%description help
+# dockerfile-parse
+
+[![unittests status badge]][unittests status link]
+[![coveralls status badge]][coveralls status link]
+[![lgtm python badge]][lgtm python link]
+[![lgtm alerts badge]][lgtm alerts link]
+[![linters status badge]][linters status link]
+
+Python library for parsing Dockerfile files.
+
+## Installation
+
+### From PyPI
+
+```shell
+pip install dockerfile-parse
+```
+
+### From git
+
+Clone this git repo and install using the python installer
+
+```shell
+git clone https://github.com/containerbuildsystem/dockerfile-parse.git
+cd dockerfile-parse
+sudo pip install .
+```
+
+## Usage
+
+```python
+from pprint import pprint
+from dockerfile_parse import DockerfileParser
+
+dfp = DockerfileParser()
+dfp.content = """\
+From base
+LABEL foo="bar baz"
+USER me"""
+
+# Print the parsed structure:
+pprint(dfp.structure)
+pprint(dfp.json)
+pprint(dfp.labels)
+
+# Set a new base:
+dfp.baseimage = 'centos:7'
+
+# Print the new Dockerfile with an updated FROM line:
+print(dfp.content)
+```
+
+[coveralls status badge]: https://coveralls.io/repos/containerbuildsystem/dockerfile-parse/badge.svg?branch=master
+[coveralls status link]: https://coveralls.io/r/containerbuildsystem/dockerfile-parse?branch=master
+[lgtm python badge]: https://img.shields.io/lgtm/grade/python/g/containerbuildsystem/dockerfile-parse.svg?logo=lgtm&logoWidth=18
+[lgtm python link]: https://lgtm.com/projects/g/containerbuildsystem/dockerfile-parse/context:python
+[lgtm alerts badge]: https://img.shields.io/lgtm/alerts/g/containerbuildsystem/dockerfile-parse.svg?logo=lgtm&logoWidth=18
+[lgtm alerts link]: https://lgtm.com/projects/g/containerbuildsystem/dockerfile-parse/alerts
+[linters status badge]: https://github.com/containerbuildsystem/dockerfile-parse/workflows/Linters/badge.svg?branch=master&event=push
+[linters status link]: https://github.com/containerbuildsystem/dockerfile-parse/actions?query=event%3Apush+branch%3Amaster+workflow%3A%22Linters%22
+[unittests status badge]: https://github.com/containerbuildsystem/dockerfile-parse/workflows/Unittests/badge.svg?branch=master&event=push
+[unittests status link]: https://github.com/containerbuildsystem/dockerfile-parse/actions?query=event%3Apush+branch%3Amaster+workflow%3A%22Unittests%22
+
+
+
+
+%prep
+%autosetup -n dockerfile-parse-2.0.0
+
+%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-dockerfile-parse -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Fri Feb 24 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..3c8f927
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+5651ddb096292ee1218db402570acb11 dockerfile-parse-2.0.0.tar.gz