Accepting request 734896 from home:frank_kunz

I want to maintain brickv in Factory and would like to use electronics as the devel/feeder project.

OBS-URL: https://build.opensuse.org/request/show/734896
OBS-URL: https://build.opensuse.org/package/show/electronics/brickv?expand=0&rev=1
This commit is contained in:
Dmitry Roshchin 2019-10-06 11:53:57 +00:00 committed by Git OBS Bridge
commit dd68355ca2
8 changed files with 246 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

View File

@ -0,0 +1,44 @@
From 9d865bd9027f0fea4835886495ce235b6591a016 Mon Sep 17 00:00:00 2001
From: Frank Kunz <mailinglists@kunz-im-inter.net>
Date: Mon, 30 Sep 2019 12:02:07 +0200
Subject: [PATCH 1/2] Support to use local iso codes and mobile providers
database
This allows to select an already installed iso codes and mobile
providers database during build instead of downloading them. It
simplifies package build when the build environment does not have
an internet connection. To select local installed files the two
environment variables SERVICEPROVIDERS_XML_PATH and ISOCODES_JSON_PATH
can be set. E.g.:
SERVICEPROVIDERS_XML_PATH=/path/to/serviceproviders.xml ISOCODES_JSON_PATH=/path/to/iso_3166-1.json ./build_src.py
Signed-off-by: Frank Kunz <mailinglists@kunz-im-inter.net>
---
.../plugins/red/build_serviceproviders.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/brickv/plugin_system/plugins/red/build_serviceproviders.py b/src/brickv/plugin_system/plugins/red/build_serviceproviders.py
index 018923dc..96397755 100644
--- a/src/brickv/plugin_system/plugins/red/build_serviceproviders.py
+++ b/src/brickv/plugin_system/plugins/red/build_serviceproviders.py
@@ -31,8 +31,14 @@ import urllib.error
import xml.etree.ElementTree as ET
from pprint import pformat
-XML_URL = 'https://git.gnome.org/browse/mobile-broadband-provider-info/plain/serviceproviders.xml'
-ISO3166_URL = 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/master/data/iso_3166-1.json'
+try:
+ XML_URL = 'file://{0}'.format(os.environ['SERVICEPROVIDERS_XML_PATH'])
+except KeyError:
+ XML_URL = 'https://git.gnome.org/browse/mobile-broadband-provider-info/plain/serviceproviders.xml'
+try:
+ ISO3166_URL = 'file://{0}'.format(os.environ['ISOCODES_JSON_PATH'])
+except KeyError:
+ ISO3166_URL = 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/master/data/iso_3166-1.json'
DATA_FILE = 'serviceprovider_data.py'
try:
--
2.23.0

55
0002-Fix-shebang.patch Normal file
View File

@ -0,0 +1,55 @@
From 16462d6580d79bfca47e7312bdb53f3fcfd33427 Mon Sep 17 00:00:00 2001
From: Frank Kunz <mailinglists@kunz-im-inter.net>
Date: Mon, 30 Sep 2019 13:39:06 +0200
Subject: [PATCH 2/2] Fix shebang
Files that do not provide direct executable code should
not have a shebang line.
Signed-off-by: Frank Kunz <mailinglists@kunz-im-inter.net>
---
src/brickv/bin_validator.py | 1 -
src/brickv/hex_validator.py | 1 -
src/brickv/object_creator.py | 1 -
src/brickv/qhexedit.py | 1 -
4 files changed, 4 deletions(-)
diff --git a/src/brickv/bin_validator.py b/src/brickv/bin_validator.py
index a071d538..9bbc07c9 100644
--- a/src/brickv/bin_validator.py
+++ b/src/brickv/bin_validator.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
diff --git a/src/brickv/hex_validator.py b/src/brickv/hex_validator.py
index a71a3df8..28936ab8 100644
--- a/src/brickv/hex_validator.py
+++ b/src/brickv/hex_validator.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
diff --git a/src/brickv/object_creator.py b/src/brickv/object_creator.py
index 4ecb3899..e904a6fc 100644
--- a/src/brickv/object_creator.py
+++ b/src/brickv/object_creator.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
diff --git a/src/brickv/qhexedit.py b/src/brickv/qhexedit.py
index 23fb2a49..b2fcd7ff 100644
--- a/src/brickv/qhexedit.py
+++ b/src/brickv/qhexedit.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Loic Jaquemet loic.jaquemet+python@gmail.com
--
2.23.0

3
_service Normal file
View File

@ -0,0 +1,3 @@
<services>
<service name="download_files" mode="disabled"/>
</services>

3
brickv-2.4.9.tar.xz Normal file
View File

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

38
brickv.changes Normal file
View File

@ -0,0 +1,38 @@
-------------------------------------------------------------------
Mon Sep 30 18:00:37 UTC 2019 - Frank Kunz <frank@kunz-im-inter.net>
- added doc files
-------------------------------------------------------------------
Mon Sep 30 13:48:52 UTC 2019 - Frank Kunz <frank@kunz-im-inter.net>
- Remove shebang from files where not needed
(0002-Fix-shebang.patch)
- Add support to overwrite iso codes and local providers
(0001-Support-to-use-local-iso-codes-and-mobile-providers-.patch)
- Force UTF-8 for build scripts
- Switch off source service
-------------------------------------------------------------------
Sat Sep 28 10:40:10 UTC 2019 - Frank Kunz <frank@kunz-im-inter.net>
- install udev rule
- install desktop file
-------------------------------------------------------------------
Sat Sep 28 09:01:17 UTC 2019 - Frank Kunz <frank@kunz-im-inter.net>
- fix install command
-------------------------------------------------------------------
Sat Sep 28 08:28:50 UTC 2019 - Frank Kunz <frank@kunz-im-inter.net>
- use mobile providers list and iso codes provided by the distribution
(0001-SUSE-Use-local-providers-and-iso-codes.patch)
- add requied python packages dependencies
- use fdupes macro for cleanup duplicated files
-------------------------------------------------------------------
Wed Sep 25 16:47:31 UTC 2019 - Frank Kunz <frank@kunz-im-inter.net>
- intial version 2.4.9

79
brickv.spec Normal file
View File

@ -0,0 +1,79 @@
#
# spec file for package brickv
#
# Copyright (c) 2019 Frank Kunz
#
# 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.
Name: brickv
Version: 2.4.9
Release: 0
Summary: Tinkerforge Brick Viewer
License: GPL-2.0-only
Group: Development/Tools/Debuggers
Url: http://www.tinkerforge.com
Source0: %{name}-%{version}.tar.xz
Patch0: 0001-Support-to-use-local-iso-codes-and-mobile-providers-.patch
Patch1: 0002-Fix-shebang.patch
BuildRequires: python3-setuptools
BuildRequires: python3-rpm-macros
BuildRequires: python3-qt5
BuildRequires: fdupes
BuildRequires: mobile-broadband-provider-info
BuildRequires: iso-codes
BuildRequires: update-desktop-files
Requires: python3-qt5
Requires: python3-serial
Requires: python3-pytz
Requires: python3-tzlocal
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Small Qt GUI to control and test all Bricks and Bricklets from Tinkerforge.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
export SERVICEPROVIDERS_XML_PATH=/usr/share/mobile-broadband-provider-info/serviceproviders.xml
export ISOCODES_JSON_PATH=/usr/share/iso-codes/json/iso_3166-1.json
# force UTF-8 for build scripts
export LANG=C.UTF-8
pushd src
python3 build_src.py
# remove no more needed build scripts
rm -f build_src.py brickv/plugin_system/plugins/red/build_extra.py brickv/plugin_system/plugins/red/build_scripts.py
popd
%install
pushd src
python3 setup.py install --root=%{buildroot} --prefix=/usr
install -m 644 -D -t %{buildroot}%{_libexecdir}/udev/rules.d build_data/linux/%{name}/lib/udev/rules.d/99-tinkerforge-brickv.rules
install -m 644 -D -t %{buildroot}/usr/share/pixmaps build_data/linux/%{name}/usr/share/pixmaps/brickv-icon.png
install -m 644 -D -t %{buildroot}/usr/share/applications build_data/linux/%{name}/usr/share/applications/%{name}.desktop
popd
%fdupes -s %{buildroot}%{python3_sitelib}/brickv/
%suse_update_desktop_file -r %{name} Development Debugger
%files -n %{name}
%defattr(-,root,root)
%doc src/changelog README.rst
%{_bindir}/%{name}
%{python3_sitelib}/brickv*
%{_libexecdir}/udev/rules.d/*.rules
/usr/share/pixmaps/*
/usr/share/applications/*
%changelog