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