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