commit e77aebc02abc55438bec645abcfb32bc7375568fc0f91917c6b32892ed0a955a Author: Tomáš Chvátal Date: Wed May 20 08:13:17 2020 +0000 Accepting request 807482 from home:Guillaume_G Initial version 0.1.8 OBS-URL: https://build.opensuse.org/request/show/807482 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-usbsdmux?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-usbsdmux.changes b/python-usbsdmux.changes new file mode 100644 index 0000000..f2df379 --- /dev/null +++ b/python-usbsdmux.changes @@ -0,0 +1,16 @@ +------------------------------------------------------------------- +Wed May 20 07:35:06 UTC 2020 - Guillaume GARDET + +- Move udev to a separate package +- Use update-alternatives + +------------------------------------------------------------------- +Wed Apr 22 13:42:04 UTC 2020 - Guillaume GARDET + +- Add udev rule to have /dev/usb-sd-mux/id- links + +------------------------------------------------------------------- +Wed Apr 22 12:54:23 UTC 2020 - Guillaume GARDET + +- Version 0.1.8 + diff --git a/python-usbsdmux.spec b/python-usbsdmux.spec new file mode 100644 index 0000000..af795e9 --- /dev/null +++ b/python-usbsdmux.spec @@ -0,0 +1,102 @@ +# +# spec file for package python-usbsdmux +# +# Copyright (c) 2020 SUSE LLC +# +# 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 https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 +%define orig_name usbsdmux +Name: python-usbsdmux +Version: 0.1.8 +Release: 0 +Summary: Tool to control an usb-sd-mux from the command line +License: LGPL-2.1-or-later +URL: https://shop.linux-automation.com/index.php?route=product/product&product_id=50 +Source0: https://github.com/pengutronix/usbsdmux/archive/%{version}.tar.gz#/%{orig_name}-%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: pkgconfig +BuildRequires: python-rpm-macros +BuildRequires: pkgconfig(udev) +Requires: %{orig_name}-udev +Requires(post): update-alternatives +Requires(postun): update-alternatives +%python_subpackages + +%description +Tool to control USB-SD-mux hardware from linux-automation.com + +Full manual is available at https://www.linux-automation.com/usbsdmux-M01/ + +%package -n %{orig_name}-udev +Summary: Udev rules for usbsdmux + +%description -n %{orig_name}-udev +Udev rules for usbsdmux + +%prep +%setup -q -n %{orig_name}-%{version} + +%build +%python_build + +%install +%python_install +# Fix interpreter +for i in %{buildroot}%{python_sitelib}/usbsdmux/{__main__.py,ctypehelper.py,pca9536.py,service.py,usb2642eeprom.py,usb2642i2c.py,usbsdmux.py}; do + sed -i 's#%{_bindir}/env python3#%{_bindir}/python3#' $i + chmod +x $i +done +%python_clone -a %{buildroot}%{_bindir}/usbsdmux +%python_clone -a %{buildroot}%{_bindir}/usbsdmux-configure +%python_clone -a %{buildroot}%{_bindir}/usbsdmux-service +# Install udev rules +mkdir -p %{buildroot}%{_udevrulesdir} +cp contrib/udev/99-usbsdmux.rules %{buildroot}%{_udevrulesdir} +# Run fdupes +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%post +%python_install_alternative usbsdmux +%python_install_alternative usbsdmux-configure +%python_install_alternative usbsdmux-service + +%postun +%python_uninstall_alternative usbsdmux +%python_install_alternative usbsdmux-configure +%python_install_alternative usbsdmux-service + +%post -n %{orig_name}-udev +%udev_rules_update + +%postun -n %{orig_name}-udev +%udev_rules_update + +%files %{python_files} +%doc README.rst +%license COPYING +%python_alternative %{_bindir}/usbsdmux +%python_alternative %{_bindir}/usbsdmux-configure +%python_alternative %{_bindir}/usbsdmux-service +%dir %{python_sitelib}/usbsdmux +%{python_sitelib}/usbsdmux/* +%{python_sitelib}/*.egg-info* + +%files -n %{orig_name}-udev +%{_udevrulesdir}/*.rules + +%changelog diff --git a/usbsdmux-0.1.8.tar.gz b/usbsdmux-0.1.8.tar.gz new file mode 100644 index 0000000..d4b5419 --- /dev/null +++ b/usbsdmux-0.1.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c71eba0eeeca1230435b19166a9c23d4cdbc60d39fcfcf79b406690fb18c6fd +size 25774