From: Frank Brehm Date: Mon, 2 Jan 2023 13:36:40 +0000 (+0100) Subject: Renaming spec file and fixing shellcheck errors. X-Git-Tag: 0.7.6^2^2~2 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=fcab50cdc60886575b949d4582b21671a4c5c057;p=pixelpark%2Fpp-admin-tools.git Renaming spec file and fixing shellcheck errors. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e53311f..299273a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,12 @@ --- +# ---------------------------- include: - project: 'python/packaging' - ref: develop + ref: main file: 'gitlab/create-all.yaml' +# ---------------------------- variables: EXPIRE_ARTIFACTS_IN: '1 week' PKG_NAME: 'pp-admintools' @@ -29,4 +31,5 @@ variables: YUM_REPO_GPG_KEY_PUB: 'nada' YUM_REPO_GPG_KEY_SEC: 'nada' + # vim: et tabstop=2 expandtab shiftwidth=2 softtabstop=2 list diff --git a/get-rpm-release b/get-rpm-release index 7681494..5f49ae0 100755 --- a/get-rpm-release +++ b/get-rpm-release @@ -2,7 +2,11 @@ cd "$( dirname "$0" )" || exit 6 -VERSION=$( head -n 1 debian/changelog | sed -e "s/^[^(]*(//" -e "s/).*//" ) +VERSION=$( grep -P '^\s*__version__\b' lib/pp_admintools/__init__.py | \ + grep -P '^\s*__version__\b' | \ + awk -F= '{print $2}' | \ + sed -e "s/^[ ]*'//" -e "s/'.*//" ) + REVISION=1 VERSION_FILE=".rpm-version" @@ -14,7 +18,9 @@ OLD_VERSION_FULL= OLD_VERSION= OLD_REVISION= if [[ -f "${VERSION_FILE}" ]] ; then - OLD_VERSION_FULL=$( grep -P -v '^\s*(#.*|$)' "${VERSION_FILE}" | head -n 1 | sed -e 's/[ ].*//' ) + OLD_VERSION_FULL=$( grep -P -v '^\s*(#.*|$)' "${VERSION_FILE}" | \ + head -n 1 | \ + sed -e 's/[ ].*//' ) fi if [[ -n "${OLD_VERSION_FULL}" ]] ; then @@ -43,4 +49,4 @@ fi echo "${REVISION}" -# vim: ts=4 et +# vim: ts=4 et list diff --git a/get-rpm-version b/get-rpm-version index 20f4726..b383883 100755 --- a/get-rpm-version +++ b/get-rpm-version @@ -2,8 +2,11 @@ cd "$( dirname "$0" )" || exit 6 -VERSION=$( head -n 1 debian/changelog | sed -e "s/^[^(]*(//" -e "s/).*//" ) +VERSION=$( grep -P '^\s*__version__\b' lib/pp_admintools/__init__.py | \ + grep -P '^\s*__version__\b' | \ + awk -F= '{print $2}' | \ + sed -e "s/^[ ]*'//" -e "s/'.*//" ) echo "${VERSION}" -# vim: ts=4 et +# vim: ts=4 et list diff --git a/pp-admintools.spec.template b/pp-admintools.spec.template deleted file mode 100644 index adfdc37..0000000 --- a/pp-admintools.spec.template +++ /dev/null @@ -1,130 +0,0 @@ -# vim: filetype=spec - -%define version @@@Version@@@ -%define builddir pp-admintools-%{version} - -Name: pp-admintools -Version: %{version} -Release: @@@Release@@@%{?dist} -Summary: Scripts and modules for admin tasks of DPX Betriebs-Department - -Group: Development/Languages/Python -License: LGPL-3 -Distribution: Frank Brehm -URL: https://git.pixelpark.com/ppadmin/admin-tools -Source0: pp-admintools.%{version}.tar.gz - -BuildRequires: gettext -BuildRequires: python@@@py_version_nodot@@@ -BuildRequires: python@@@py_version_nodot@@@-libs -BuildRequires: python@@@py_version_nodot@@@-devel -BuildRequires: python@@@py_version_nodot@@@-setuptools -BuildRequires: python@@@py_version_nodot@@@-babel -BuildRequires: python@@@py_version_nodot@@@-pytz -BuildRequires: python@@@py_version_nodot@@@-six -BuildRequires: python@@@py_version_nodot@@@-fb-logging -BuildRequires: python@@@py_version_nodot@@@-fb-tools >= 2.1.0 -BuildRequires: python@@@py_version_nodot@@@-fb-pdnstools -Requires: python@@@py_version_nodot@@@ -Requires: python@@@py_version_nodot@@@-libs -Requires: python@@@py_version_nodot@@@-babel -Requires: python@@@py_version_nodot@@@-psutil -Requires: python@@@py_version_nodot@@@-pytz -Requires: python@@@py_version_nodot@@@-requests -Requires: python@@@py_version_nodot@@@-six -Requires: python@@@py_version_nodot@@@-fb-logging -Requires: python@@@py_version_nodot@@@-fb-tools >= 2.1.0 -Requires: python@@@py_version_nodot@@@-fb-pdnstools -BuildArch: noarch - -%description -Scripts and modules for admin tasks of DPX Betriebs-Department - -This package is intended to use with Python@@@py_version_nodot@@@. - -In this package are contained the following scripts: - * dns-deploy-zones - -%prep -%setup -n %{builddir} - -%build -cd ../%{builddir} -python@@@py_version_dot@@@ setup.py build - -%install -cd ../%{builddir} -echo "Buildroot: %{buildroot}" -python@@@py_version_dot@@@ setup.py install --prefix=%{_prefix} --root=%{buildroot} - -%files -%defattr(-,root,root,-) -%license LICENSE -%doc LICENSE README.md requirements.txt -%dir /etc/pixelpark -%config /etc/pixelpark/dns-deploy-zones.ini.default -%config /etc/profile.d/pp-admintools.sh -%config /etc/profile.d/pp-admintools.csh -%{_bindir}/* -%{python3_sitelib}/* -%dir /usr/libexec/pixelpark -/usr/libexec/pixelpark/* - -%changelog -* Wed Dec 07 2022 Frank Brehm 0.7.5-1 -- Fixing scripts/exec-puppet-agent. -* Wed Nov 30 2022 Frank Brehm 0.7.4-1 -- Refactoring common used functions in scripts/functions.rc -- Adding scripts/create-pdns-zones-from-files. -* Mon Nov 21 2022 Frank Brehm 0.7.3-1 -- Setting minimum version of fb-tools to 2.1.0 -- Adding possibility to give additional opptions for executing - puppet agent in scripts/exec-puppet-agent -* Fri Nov 18 2022 Frank Brehm 0.7.2-1 -- Adding tests for Python 3.11 -- Adding class LdapPasswordHandler in module pp_admintools.handler.ldap_password -- Adding bin/mkldappasswd and its application module - pp_admintools.app.mk_ldap_passwd -- Fixing modules pp_admintools.app, pp_admintools.app.mail, - pp_admintools.app.pdns and pp_admintools.app.dns_deploy_zones. -* Thu Nov 10 2022 Frank Brehm 0.7.1-1 -- Removing script scripts/chatbot-to-ldap. -- Adding script scripts/exec-puppet-agent. -* Thu Nov 03 2022 Frank Brehm 0.7.0-1 -- Fixing host URL on LDAP operations in scripts/* -- Adding shell script scripts/fix-memberof. -- Adding Python script bin/mirror-ldap-instance with its application - module lib/pp_admintools/app/mirror_ldap.py. -* Mon Oct 31 2022 Frank Brehm 0.6.1-1 -- Adding Script scripts/chatbot-to-ldap. -* Tue Oct 18 2022 Frank Brehm 0.6.0-1 -- Adding Script set-ldap-password. -- Adding configuring options for LDAP instances. -- Fixing linter optopns. -* Fri Sep 09 2022 Frank Brehm 0.5.0-1 -- Reorganizing library structure -- Adding class BaseDPXApplication to module pp_admintools.app. -- Adding script remove-ldap-user including its application module - pp_admintools.app.remove_ldap_user -* Wed Aug 31 2022 Frank Brehm 0.4.4-1 -- Adding script scripts/test-resolv. -- Moving some often used functions into scripts/functions.rc. -* Wed Jul 13 2022 Frank Brehm 0.4.3-1 -- Fixing dependencies in pp-admintools.spec.template -- Fixing deploy job in .gitlab-ci.yml -* Tue Jul 12 2022 Frank Brehm 0.4.2-1 -- Changing Python modules to use the Mailaddress class from fb-tools -- Adding scripts update-cobbler-distros and manage-users -- Adding test scripts for Python modules for mail and ldap configuration -* Fri Apr 01 2022 Frank Brehm 0.4.1-1 -- Refactoring complete Python code on base of fb-tools-1.9.2 -- Adding Python virtual environment -- Adding shell script disabling-ldap-user. -- Making .gitlab-ci.yml functional, including creating rpm packages -* Tue Dec 21 2021 Frank Brehm 0.3.2-1 -- Adding scripts/backup-pdns.sh -* Mon Dec 20 2021 Frank Brehm 0.3.1-1 -- Creating .gitlab-ci for Continuous integration -* Thu Dec 09 2021 Frank Brehm 0.3.0-1 -- Initial Build of a RPM package - diff --git a/template.spec b/template.spec new file mode 100644 index 0000000..d98ce04 --- /dev/null +++ b/template.spec @@ -0,0 +1,130 @@ +# vim: filetype=spec + +%define version @@@Version@@@ +%define builddir python@@@py_version_nodot@@@_pp-admintools-%{version} + +Name: pp-admintools +Version: %{version} +Release: @@@Release@@@%{?dist} +Summary: Scripts and modules for admin tasks of DPX Betriebs-Department + +Group: Development/Languages/Python +License: LGPL-3 +Distribution: Frank Brehm +URL: https://git.pixelpark.com/ppadmin/admin-tools +Source0: pp-admintools.%{version}.tar.gz + +BuildRequires: gettext +BuildRequires: python@@@py_version_nodot@@@ +BuildRequires: python@@@py_version_nodot@@@-libs +BuildRequires: python@@@py_version_nodot@@@-devel +BuildRequires: python@@@py_version_nodot@@@-setuptools +BuildRequires: python@@@py_version_nodot@@@-babel +BuildRequires: python@@@py_version_nodot@@@-pytz +BuildRequires: python@@@py_version_nodot@@@-six +BuildRequires: python@@@py_version_nodot@@@-fb-logging +BuildRequires: python@@@py_version_nodot@@@-fb-tools >= 2.1.0 +BuildRequires: python@@@py_version_nodot@@@-fb-pdnstools +Requires: python@@@py_version_nodot@@@ +Requires: python@@@py_version_nodot@@@-libs +Requires: python@@@py_version_nodot@@@-babel +Requires: python@@@py_version_nodot@@@-psutil +Requires: python@@@py_version_nodot@@@-pytz +Requires: python@@@py_version_nodot@@@-requests +Requires: python@@@py_version_nodot@@@-six +Requires: python@@@py_version_nodot@@@-fb-logging +Requires: python@@@py_version_nodot@@@-fb-tools >= 2.1.0 +Requires: python@@@py_version_nodot@@@-fb-pdnstools +BuildArch: noarch + +%description +Scripts and modules for admin tasks of DPX Betriebs-Department + +This package is intended to use with Python@@@py_version_nodot@@@. + +In this package are contained the following scripts: + * dns-deploy-zones + +%prep +%setup -n %{builddir} + +%build +cd ../%{builddir} +python@@@py_version_dot@@@ setup.py build + +%install +cd ../%{builddir} +echo "Buildroot: %{buildroot}" +python@@@py_version_dot@@@ setup.py install --prefix=%{_prefix} --root=%{buildroot} + +%files +%defattr(-,root,root,-) +%license LICENSE +%doc LICENSE README.md requirements.txt +%dir /etc/pixelpark +%config /etc/pixelpark/dns-deploy-zones.ini.default +%config /etc/profile.d/pp-admintools.sh +%config /etc/profile.d/pp-admintools.csh +%{_bindir}/* +%{python3_sitelib}/* +%dir /usr/libexec/pixelpark +/usr/libexec/pixelpark/* + +%changelog +* Wed Dec 07 2022 Frank Brehm 0.7.5-1 +- Fixing scripts/exec-puppet-agent. +* Wed Nov 30 2022 Frank Brehm 0.7.4-1 +- Refactoring common used functions in scripts/functions.rc +- Adding scripts/create-pdns-zones-from-files. +* Mon Nov 21 2022 Frank Brehm 0.7.3-1 +- Setting minimum version of fb-tools to 2.1.0 +- Adding possibility to give additional opptions for executing + puppet agent in scripts/exec-puppet-agent +* Fri Nov 18 2022 Frank Brehm 0.7.2-1 +- Adding tests for Python 3.11 +- Adding class LdapPasswordHandler in module pp_admintools.handler.ldap_password +- Adding bin/mkldappasswd and its application module + pp_admintools.app.mk_ldap_passwd +- Fixing modules pp_admintools.app, pp_admintools.app.mail, + pp_admintools.app.pdns and pp_admintools.app.dns_deploy_zones. +* Thu Nov 10 2022 Frank Brehm 0.7.1-1 +- Removing script scripts/chatbot-to-ldap. +- Adding script scripts/exec-puppet-agent. +* Thu Nov 03 2022 Frank Brehm 0.7.0-1 +- Fixing host URL on LDAP operations in scripts/* +- Adding shell script scripts/fix-memberof. +- Adding Python script bin/mirror-ldap-instance with its application + module lib/pp_admintools/app/mirror_ldap.py. +* Mon Oct 31 2022 Frank Brehm 0.6.1-1 +- Adding Script scripts/chatbot-to-ldap. +* Tue Oct 18 2022 Frank Brehm 0.6.0-1 +- Adding Script set-ldap-password. +- Adding configuring options for LDAP instances. +- Fixing linter optopns. +* Fri Sep 09 2022 Frank Brehm 0.5.0-1 +- Reorganizing library structure +- Adding class BaseDPXApplication to module pp_admintools.app. +- Adding script remove-ldap-user including its application module + pp_admintools.app.remove_ldap_user +* Wed Aug 31 2022 Frank Brehm 0.4.4-1 +- Adding script scripts/test-resolv. +- Moving some often used functions into scripts/functions.rc. +* Wed Jul 13 2022 Frank Brehm 0.4.3-1 +- Fixing dependencies in pp-admintools.spec.template +- Fixing deploy job in .gitlab-ci.yml +* Tue Jul 12 2022 Frank Brehm 0.4.2-1 +- Changing Python modules to use the Mailaddress class from fb-tools +- Adding scripts update-cobbler-distros and manage-users +- Adding test scripts for Python modules for mail and ldap configuration +* Fri Apr 01 2022 Frank Brehm 0.4.1-1 +- Refactoring complete Python code on base of fb-tools-1.9.2 +- Adding Python virtual environment +- Adding shell script disabling-ldap-user. +- Making .gitlab-ci.yml functional, including creating rpm packages +* Tue Dec 21 2021 Frank Brehm 0.3.2-1 +- Adding scripts/backup-pdns.sh +* Mon Dec 20 2021 Frank Brehm 0.3.1-1 +- Creating .gitlab-ci for Continuous integration +* Thu Dec 09 2021 Frank Brehm 0.3.0-1 +- Initial Build of a RPM package +