]> git.pld-linux.org Git - SPECS.git/blob - python-LGWebOSRemote.spec
SPECS updated Tue 30 Apr 15:13:02 CEST 2024
[SPECS.git] / python-LGWebOSRemote.spec
1 #
2 # This is template for pure python2/python3 modules (noarch)
3 # use template-specs/python3.spec for python3 only noarch packages
4 # use template-specs/python-ext.spec for binary python packages
5 #
6 #
7 # Conditional build:
8 %bcond_without  tests   # unit tests
9 %bcond_without  python2 # CPython 2.x module
10 %bcond_without  python3 # CPython 3.x module
11
12 # NOTES:
13 # - 'module' should match the Python import path (first component?)
14 # - 'egg_name' should equal to Python egg name
15 # - 'pypi_name' must match the Python Package Index name
16 %define         module          LGTV
17 %define         egg_name        LGTV
18 %define         pypi_name       LGTV
19 Summary:        Command line webOS remote for LGTVs
20 Name:           python-LGWebOSRemote
21 Version:        0.2
22 Release:        0.1
23 License:        MIT
24 Group:          Libraries/Python
25 Source0:        https://github.com/klattimer/LGWebOSRemote/archive/master.zip
26 # Source0-md5:  95e4d2a8e3b94c1fc75a6534c6ac7749
27 URL:            https://github.com/klattimer/LGWebOSRemote
28 %if %{with python2}
29 BuildRequires:  python-modules >= 1:2.5
30 BuildRequires:  python-setuptools
31 %if %{with tests}
32 #BuildRequires: python-
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-modules >= 1:3.2
37 BuildRequires:  python3-setuptools
38 %if %{with tests}
39 #BuildRequires: python3-
40 %endif
41 %endif
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.714
44 Requires:       python-modules >= 1:2.5
45 BuildArch:      noarch
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 Command line webOS remote for LGTVs. This tool uses a connection via
50 websockets to port 3000 on newer LG TVs.
51
52 %package -n python3-LGWebOSRemote
53 Summary:        Command line webOS remote for LGTVs
54 Group:          Libraries/Python
55 Requires:       python3-modules >= 1:3.2
56
57 %description -n python3-LGWebOSRemote
58 Command line webOS remote for LGTVs. This tool uses a connection via
59 websockets to port 3000 on newer LG TVs.
60
61 %prep
62 %setup -q -c
63 mv *-master/* .
64
65 %build
66 %if %{with python2}
67 %py_build
68
69 %if %{with tests}
70 %{__python} -m pytest ...
71 %endif
72 %endif
73
74 %if %{with python3}
75 %py3_build
76
77 %if %{with tests}
78 %{__python3} -m pytest ...
79 %endif
80 %endif
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84
85 %if %{with python2}
86 %py_install
87
88 %if %{with enable_if_package_uses_non_standard_setup_py}
89 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
90 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
91 %endif
92
93 %py_postclean
94 %endif
95
96 %if %{with python3}
97 %py3_install
98 %endif
99
100 install -d $RPM_BUILD_ROOT%{_sysconfdir}/lgtv
101 mv $RPM_BUILD_ROOT/{usr/config,etc/lgtv}/config.json
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %if %{with python2}
107 %files
108 %defattr(644,root,root,755)
109 %doc README.md
110 %{py_sitescriptdir}/%{module}
111 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
112 #%dir %{_sysconfdir}/lgtv
113 #%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lgtv/config.json
114 %endif
115
116 %if %{with python3}
117 %files -n python3-LGWebOSRemote
118 %defattr(644,root,root,755)
119 %doc README.md
120 %attr(755,root,root) %{_bindir}/lgtv
121 %{py3_sitescriptdir}/%{module}
122 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
123 %dir %{_sysconfdir}/lgtv
124 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lgtv/config.json
125 %endif
This page took 1.14247 seconds and 3 git commands to generate.