]>
Commit | Line | Data |
---|---|---|
9dda6696 AM |
1 | Summary: Open source Home Automation System |
2 | Name: domoticz | |
9ee4483e AM |
3 | Version: 4.9700 |
4 | Release: 1 | |
9dda6696 AM |
5 | License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT |
6 | Group: Base | |
7 | URL: http://www.domoticz.com | |
8 | Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz | |
9ee4483e | 9 | # Source0-md5: 726d838d5d80eed4335b0dfeefb2af6c |
9dda6696 AM |
10 | Source1: %{name}.service |
11 | Source2: %{name}.conf | |
12 | # Source says its version 3.5876, but it's really 3.8153 | |
13 | Patch1: %{name}-version.patch | |
14 | # Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759) | |
15 | Patch2: %{name}-tinyxpath.patch | |
16 | # Use system openzwave includes | |
17 | Patch3: %{name}-openzwave.patch | |
18 | # Work against Dev branch of OpenZWave upstream | |
19 | Patch4: %{name}-openzwave-Dev.patch | |
20 | # Fix python detection (https://github.com/domoticz/domoticz/pull/1749) | |
21 | Patch5: %{name}-python.patch | |
9ee4483e AM |
22 | Patch6: domoticz-ozw-barrier-support-0002.patch |
23 | Patch7: domoticz-cp-js.patch | |
9dda6696 AM |
24 | BuildRequires: boost-devel |
25 | BuildRequires: cmake | |
26 | BuildRequires: curl-devel | |
27 | BuildRequires: libmosquitto-devel | |
28 | BuildRequires: libmosquittopp-devel | |
29 | BuildRequires: libopenzwave-devel >= 1.5.0 | |
30 | BuildRequires: libstdc++-devel | |
31 | BuildRequires: libusb-devel | |
32 | BuildRequires: lua-devel | |
33 | BuildRequires: openssl-devel | |
34 | BuildRequires: python3-devel | |
35 | BuildRequires: sqlite-devel | |
36 | BuildRequires: systemd-devel | |
37 | BuildRequires: tinyxpath-devel | |
38 | BuildRequires: zlib-devel | |
06cb1c68 AM |
39 | Requires(pre): /usr/sbin/groupadd |
40 | Requires(pre): /usr/sbin/useradd | |
9dda6696 AM |
41 | Requires(post): systemd |
42 | Requires(postun): systemd | |
43 | Requires(preun): systemd | |
06cb1c68 | 44 | Requires: fonts-TTF-Google-Droid |
9dda6696 AM |
45 | Provides: bundled(js-ace) |
46 | Provides: bundled(js-angular-ui-bootstrap) = 0.13.4 | |
47 | Provides: bundled(js-angularamd) = 0.2.1 | |
48 | Provides: bundled(js-angularjs) = 1.5.8 | |
49 | Provides: bundled(js-blockly) | |
50 | Provides: bundled(js-bootbox) | |
51 | Provides: bundled(js-bootstrap) = 3.2.0 | |
52 | Provides: bundled(js-colpick) | |
53 | Provides: bundled(js-d3) | |
54 | Provides: bundled(js-datatables-datatools) = 2.2.3 | |
55 | Provides: bundled(js-dateformat) = 1.2.3 | |
56 | Provides: bundled(js-filesaver) = 0.0-git20140725 | |
57 | Provides: bundled(js-highcharts) = 4.2.6 | |
58 | Provides: bundled(js-html5shiv) = 3.6.2 | |
59 | Provides: bundled(js-i18next) = 1.8.0 | |
60 | Provides: bundled(js-ion-sound) = 3.0.6 | |
61 | Provides: bundled(js-jquery) = 1.12.0 | |
62 | Provides: bundled(js-jquery-noty) = 2.1.0 | |
63 | Provides: bundled(js-less) = 1.3.0 | |
64 | Provides: bundled(js-ngdraggable) | |
65 | Provides: bundled(js-nggrid) | |
66 | Provides: bundled(js-ozwcp) | |
67 | Provides: bundled(js-require) = 2.1.14 | |
68 | Provides: bundled(js-respond) = 1.1.0 | |
69 | Provides: bundled(js-wow) = 0.1.9 | |
70 | Provides: bundled(js-zeroclipboard) = 1.0.4 | |
71 | ||
72 | %description | |
73 | Domoticz is a Home Automation System that lets you monitor and | |
74 | configure various devices like: Lights, Switches, various | |
75 | sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water | |
76 | and much more. Notifications/Alerts can be sent to any mobile device | |
77 | ||
78 | %prep | |
79 | %setup -q | |
80 | %patch1 -p1 -b.version | |
81 | %patch2 -p1 -b.tinyxpath | |
82 | %patch3 -p1 -b.openzwave | |
83 | %patch4 -p1 -b.openzwave-Dev | |
84 | %patch5 -p1 -b.python | |
9ee4483e AM |
85 | %patch6 -p1 |
86 | %patch7 -p1 | |
9dda6696 AM |
87 | rm -f hardware/openzwave/*.h |
88 | rm -rf hardware/openzwave/aes | |
89 | rm -rf hardware/openzwave/command_classes | |
90 | rm -rf hardware/openzwave/platform | |
91 | rm -rf hardware/openzwave/value_classes | |
92 | rm -rf sqlite/ | |
93 | rm -rf tinyxpath/ | |
94 | ||
95 | %build | |
96 | install -d build && cd build | |
97 | %cmake \ | |
98 | -DUSE_STATIC_LIBSTDCXX=NO \ | |
99 | -DUSE_STATIC_OPENZWAVE=NO \ | |
100 | -DUSE_BUILTIN_LUA=NO \ | |
101 | -DUSE_BUILTIN_MQTT=NO \ | |
102 | -DUSE_BUILTIN_SQLITE=NO \ | |
103 | -DUSE_BUILTIN_TINYXPATH=NO \ | |
104 | -DUSE_STATIC_BOOST=NO \ | |
105 | -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \ | |
106 | .. | |
00bce45c | 107 | |
9dda6696 AM |
108 | %{__make} |
109 | ||
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
00bce45c AM |
112 | %{__make} -C build install \ |
113 | DESTDIR=$RPM_BUILD_ROOT | |
9dda6696 AM |
114 | |
115 | # remove docs, we grab them in files below | |
116 | rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt | |
117 | ||
118 | # move binary to standard directory | |
119 | install -d $RPM_BUILD_ROOT%{_bindir}/ | |
120 | mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/ | |
121 | ||
122 | # install systemd service and config | |
123 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ | |
124 | install -d $RPM_BUILD_ROOT%{systemdunitdir}/ | |
125 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/ | |
126 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} | |
127 | ||
128 | # create database/ssl cert directory | |
129 | install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/ | |
130 | ||
131 | # Disable the app's self-update script | |
132 | ||
133 | # Unbundle DroidSans.ttf | |
134 | rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf | |
06cb1c68 | 135 | ln -s /usr/share/fonts/TTF/DroidSans.ttf \ |
9dda6696 AM |
136 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/ |
137 | rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf | |
06cb1c68 | 138 | ln -s /usr/share/fonts/TTF/DroidSans.ttf \ |
9dda6696 AM |
139 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/ |
140 | rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf | |
06cb1c68 | 141 | ln -s /usr/share/fonts/TTF/DroidSans.ttf \ |
9dda6696 AM |
142 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/ |
143 | ||
144 | # OpenZWave Control Panel temp file | |
145 | ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \ | |
146 | $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml | |
147 | ||
148 | %clean | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | ||
151 | %pre | |
152 | getent group domoticz >/dev/null || groupadd -r domoticz | |
153 | getent passwd domoticz >/dev/null || \ | |
154 | useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \ | |
155 | -c "Domoticz Home Automation Server" domoticz | |
156 | # For OpenZWave USB access (/dev/ttyACM#) | |
157 | usermod -G domoticz,dialout domoticz | |
158 | ||
159 | %post | |
160 | %systemd_post %{name}.service | |
161 | ||
162 | %preun | |
163 | %systemd_preun %{name}.service | |
164 | ||
165 | %postun | |
166 | %systemd_postun_with_restart %{name}.service | |
167 | ||
168 | %files | |
169 | %defattr(644,root,root,755) | |
170 | %doc License.txt | |
171 | %doc README.md History.txt | |
172 | %attr(755,root,root) %{_bindir}/%{name} | |
173 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
174 | %{_datadir}/%{name}/ | |
175 | %attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/ | |
176 | %{systemdunitdir}/%{name}.service |