diff --git a/pdc-client-1.8.0.tar.gz b/pdc-client-1.8.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..67b11b3a409946a3680e5be7e9b0a69e1908a943 Binary files /dev/null and b/pdc-client-1.8.0.tar.gz differ diff --git a/pdc-client.spec b/pdc-client.spec new file mode 100644 index 0000000000000000000000000000000000000000..8bff09752f729c4a443dbc7218a57266cac777bd --- /dev/null +++ b/pdc-client.spec @@ -0,0 +1,84 @@ +%global plugin_install_path %{_datadir}/pdc-client/plugins + +# Disable automatic byte-compilation of plugins +%global _python_bytecompile_extra 0 + +Name: pdc-client +Version: 1.8.0 +Release: 1 +Summary: Console client for interacting with Product Definition Center +License: MIT +URL: https://github.com/product-definition-center/pdc-client +BuildArch: noarch +Source0: https://files.pythonhosted.org/packages/source/p/pdc-client/pdc-client-%{version}.tar.gz + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pytest +BuildRequires: python3-requests +BuildRequires: python3-requests-kerberos + +Requires: python3-pdc-client = %{version}-%{release} + +%description +This client package contains two separate Product Definition Center clients and +API module. Both clients contain extensive built-in help. Just run the +executable with -h or --help argument. + +%package -n python3-pdc-client +Summary: Python 3 client library for Product Definition Center +Requires: python3-beanbag +Requires: python3-requests-kerberos +Requires: pdc-client + +%description -n python3-pdc-client +This is a python module for interacting with Product Definition Center +programatically. It can handle common authentication and configuration of PDC +server connections + +%prep +%setup -q -n pdc-client-%{version} + +# Replace installation plugin path in code +sed -i 's|^DEFAULT_PLUGIN_DIR = .*|DEFAULT_PLUGIN_DIR = "%{plugin_install_path}"|' \ + pdc_client/runner.py + +%build +%py3_build + +%install +%py3_install + +# Plugins are only required in the "pdc" script (not the Python packages). So +# move plugins to pdc-client package from Python package (this should also +# contain compiled bytecode). +mkdir -p %{buildroot}/%{plugin_install_path} +mv -T %{buildroot}/%{python3_sitelib}/pdc_client/plugins %{buildroot}/%{plugin_install_path} + +mkdir -p %{buildroot}/%{_mandir}/man1 +cp docs/pdc_client.1 %{buildroot}/%{_mandir}/man1/ + +mkdir -p %{buildroot}/%{_sysconfdir}/bash_completion.d/ +cp pdc.bash %{buildroot}/%{_sysconfdir}/bash_completion.d/ + +mkdir -p %{buildroot}/%{_sysconfdir}/pdc.d + +%files +%doc README.markdown +%{_mandir}/man1/pdc_client.1* +%{_sysconfdir}/bash_completion.d +%dir %{_sysconfdir}/pdc.d +%{_bindir}/pdc +%{_bindir}/pdc_client +%dir %{_datadir}/pdc-client +%dir %{plugin_install_path} +%{plugin_install_path}/* + +%files -n python3-pdc-client +%doc README.markdown +%license LICENSE +%{python3_sitelib}/pdc_client* + +%changelog +* Mon Nov 18 2024 sqfu - 1.8.0-1 +- init package \ No newline at end of file