Accepting request 753037 from home:mnhauke

Initial package for ansible-cmdb

OBS-URL: https://build.opensuse.org/request/show/753037
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ansible-cmdb?expand=0&rev=1
This commit is contained in:
Klaus Kämpf
2019-12-04 08:08:45 +00:00
committed by Git OBS Bridge
commit 404d76d098
7 changed files with 149 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
ansible-cmdb-1.30.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b9626b6f247818e612018addd33a6af7626469963159e2cba7f772b0a7125e9
size 551869

View File

@@ -0,0 +1,22 @@
diff --git a/requirements.txt b/requirements.txt
index f1fdb38..ca9b91d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,3 @@
mako
pyyaml
-ushlex
jsonxs
diff --git a/setup.py b/setup.py
index 0662504..1c30a5a 100755
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,7 @@ setup(
) +
[['lib/ansiblecmdb/', ['src/ansible-cmdb.py']]],
zip_safe=False,
- install_requires=['mako', 'pyyaml', 'ushlex', 'jsonxs'],
+ install_requires=['mako', 'pyyaml', 'jsonxs'],
scripts=[
'src/ansible-cmdb',
],

4
ansible-cmdb-wrapper.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
PY_BIN="/usr/bin/python3"
ANSIBLE_CMDB="/usr/lib/ansiblecmdb/ansible-cmdb.py"
$PY_BIN $ANSIBLE_CMDB "$@"

7
ansible-cmdb.changes Normal file
View File

@@ -0,0 +1,7 @@
-------------------------------------------------------------------
Sun Nov 24 18:26:05 UTC 2019 - Martin Hauke <mardnh@gmx.de>
- Initial package, version 1.30
- Add patch:
* ansible-cmdb-dont-require-ushlex.patch
ushlex is only needed for the python2 version

89
ansible-cmdb.spec Normal file
View File

@@ -0,0 +1,89 @@
#
# spec file for package ansible-cmdb
#
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
Name: ansible-cmdb
Version: 1.30
Release: 0
Summary: Ansible Configuration Management Database
License: GPL-3.0-or-later
Group: Development/Languages/Python
URL: https://github.com/fboender/ansible-cmdb
Source: https://github.com/fboender/ansible-cmdb/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: ansible-cmdb-wrapper.sh
Patch0: ansible-cmdb-dont-require-ushlex.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-setuptools
# SECTION test requirements
BuildRequires: python3-Mako
BuildRequires: python3-PyYAML
BuildRequires: python3-jsonxs
# /SECTION
Requires: python3-Mako
Requires: python3-PyYAML
Requires: python3-jsonxs
Recommends: ansible
BuildArch: noarch
%description
Ansible-cmdb takes the output of Ansible's fact gathering and converts it into
a static HTML overview page (and other things) containing system configuration
information.
It supports multiple types of output (html, csv, sql, etc) and extending
information gathered by Ansible with custom data. For each host it also shows
the groups, host variables, custom variables and machine-local facts.
%prep
%setup -q
%patch0 -p1
echo %{version} > ./src/ansiblecmdb/data/VERSION
sed -i -e '/^#!\//, 1d' src/ansible-cmdb.py
sed -i 's|#!%{_bindir}/env python|#!%{_bindir}/python3|g' \
src/ansiblecmdb/data/tpl/html_fancy_split.py \
src/ansiblecmdb/data/tpl/markdown_split.py
sed -i 's|#!%{_bindir}/python|#!%{_bindir}/python3|g' \
test/f_inventory/dyninv.py \
test/f_inventory/mixeddir/dyninv.py
%build
%python3_build
%install
%python3_install
# remove upstream supplied wrapper-script
rm -f %{buildroot}/%{_bindir}/ansible-cmdb
install -D -m0755 %{SOURCE1} %{buildroot}/%{_bindir}/ansible-cmdb
install -D -m0644 contrib/ansible-cmdb.man.1 %{buildroot}%{_mandir}/man1/ansible-cmdb.1
%fdupes %{buildroot}
%check
cd test/ && python3 ./test.py -v
%files
%license LICENSE
%doc README.md
%{_bindir}/ansible-cmdb
%{python3_sitelib}/ansiblecmdb*
%{python3_sitelib}/ansible_cmdb*
%dir %{_prefix}/lib/ansiblecmdb/
%{_prefix}/lib/ansiblecmdb//ansible-cmdb.py
%dir %{_prefix}/lib/ansiblecmdb/data
%{_prefix}/lib/ansiblecmdb/data/*
%{_mandir}/man1/ansible-cmdb.1%{ext_man}
%changelog