forked from tchellomello/python-amcrest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-amcrest.spec.in
201 lines (158 loc) · 5.4 KB
/
python-amcrest.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
%global package_version @PACKAGE_VERSION@
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python3 1
%else
%global with_python2 1
%endif
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib2: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
# Skips check since rhel default repos lack flake8
%if ! 0%{?rhel}
%{!?with_check:%global with_check 1}
%else
%{!?with_check:%global with_check 0}
%endif
# Default to skipping autoreconf. Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
# touch configure.ac or Makefile.am.
%{!?enable_autotools:%global enable_autotools 0}
%global modname amcrest
%global commit 60535795dadbd09c2e67635978121ffa63ca4a50
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: @PACKAGE_NAME@
Version: @PACKAGE_RPM_VERSION@
Release: @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
Summary: A python module and tool to manage Amcrest camera
License: GPLv2
Group: System Environment/Libraries
URL: https://github.com/tchellomello/python-amcrest
# Keep the below Source0, will be useful for Fedora review process
# Source0: https://github.com/tchellomello/python-amcrest/archive/%{commit}/python-amcrest-%{package_version}-%{shortcommit}.tar.gz
Source0: https://github.com/tchellomello/python-amcrest/archive/%{commit}/python-amcrest-%{package_version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_check}
BuildRequires: python-tools
BuildRequires: python-flake8
%endif
# Autotools BuildRequires
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif
%if 0%{?with_python3} && 0%{?with_check}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-flake8
BuildRequires: python-tools
%endif
Requires: python-requests
Requires: python2-argcomplete
%{!?_licensedir:%global license %%doc}
%description
python amcrest is a python 2 library to manage Amcrest camera
This package also contains the command line tool amcrest-cli tool
%if 0%{?with_python3}
%package -n python3-amcrest
Summary: A python 3 module and tool to manage Amcrest camera
Requires: python3-requests
Requires: python3-argcomplete
%description -n python3-amcrest
python amcrest is a python 3 library to manage Amcrest camera
This package also contains the command line tool amcrest-cli tool
%endif
%package -n amcrest-tui
Summary: text user interface to visualize snapshot via framebuffer
%if 0%{?with_python3}
Requires: python3-amcrest = %{version}-%{release}
%else
Requires: python-amcrest = %{version}-%{release}
%endif
Requires: fbida
%description -n amcrest-tui
python tool to visualize snapshots via framebuffer
%package -n amcrest-cli
Summary: client tool for amcrest camera
%if 0%{?with_python3}
Requires: python3-amcrest = %{version}-%{release}
%else
Requires: python-amcrest = %{version}-%{release}
%endif
%description -n amcrest-cli
Tool to manage amcrest camera
%prep
%setup -q -n %{name}-%{package_version}
%build
%if 0%{?enable_autotools}
autoreconf -if
%endif
%if 0%{?with_python3}
%configure
%endif
%if 0%{?with_python2}
%configure --without-python3
%endif
make %{?_smp_mflags}
%install
make %{?_smp_mflags} install DESTDIR="%{buildroot}"
%post -n amcrest-cli
eval "$(register-python-argcomplete amcrest-cli)"
%check
%if 0%{?with_check}
make check-local
%endif
%if 0%{?with_python2}
%files
%doc AUTHORS
%license COPYING
%dir %{python2_sitelib}/%{modname}
%{python2_sitelib}/%{modname}/*
%endif
%if 0%{?with_python3}
%files -n python3-amcrest
%doc AUTHORS
%license COPYING
%dir %{python3_sitelib}/%{modname}
%{python3_sitelib}/%{modname}/*
%endif
%files -n amcrest-tui
%doc AUTHORS
%license COPYING
%{_bindir}/amcrest-tui
%{_mandir}/man1/amcrest-tui.1.gz
%files -n amcrest-cli
%doc AUTHORS
%license COPYING
%{_bindir}/amcrest-cli
%{_mandir}/man1/amcrest-cli.1.gz
%{_sysconfdir}/profile.d/amcrest-cli-autocomplete.sh
%changelog
* Sun Apr 16 2017 Marcelo Moreira de Mello <[email protected]> 1.1-9
- Added support to new Amcrest firmware V2.400.AC01.15.R.20170328 <[email protected]>
- Added support to new Amcrest firmware V2.420.AC00.17.R.20170322 <[email protected]>
* Sat Apr 08 2017 Marcelo Moreira de Mello <[email protected]> 1.1-8
- Added storage_used_percent function
* Tue Mar 28 2017 Marcelo Moreira de Mello <[email protected]> 1.1-5
- Introduced unittests
- Refactored Python imports
* Tue Jan 31 2017 Marcelo Moreira de Mello <[email protected]> 1.1-4
- Reverted patch 20f527eb which broke external 3rd party applications
* Sat Jan 21 2017 Marcelo Moreira de Mello <[email protected]> 1.1-3
- Exported version via api and command-line
* Sat Jan 21 2017 Marcelo Moreira de Mello <[email protected]> 1.1-2
- Fixed and reorganized tree
- Rebase
* Sat Jan 21 2017 Marcelo Moreira de Mello <[email protected]> 1.1-1
- Exposed method get_base_url()
* Fri Jan 13 2017 Marcelo Moreira de Mello <[email protected]> 1.1-0
- Implemented tests with Travis
- Added configuration file ~/.config/amcrest.conf
- Added NTP support
- Introduced to customize timeout parameters
- Supported notification when motion is dected
- Minor bug fixes and enhancements
* Thu May 07 2015 Douglas Schilling Landgraf <[email protected]> 1.0-0
- Initial take