]> git.pld-linux.org Git - packages/domoticz.git/blame - domoticz.spec
updated deps
[packages/domoticz.git] / domoticz.spec
CommitLineData
9dda6696
AM
1Summary: Open source Home Automation System
2Name: domoticz
72784cf7 3Version: 2020.2
0abc31de 4Release: 3
9dda6696
AM
5License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT
6Group: Base
7URL: http://www.domoticz.com
72784cf7
AM
8Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz
9# Source0-md5: fd383a13d13d0976c72f332d6db1d24e
9dda6696
AM
10Source1: %{name}.service
11Source2: %{name}.conf
10f7a92e 12
9dda6696
AM
13# Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759)
14Patch2: %{name}-tinyxpath.patch
15# Use system openzwave includes
16Patch3: %{name}-openzwave.patch
17# Work against Dev branch of OpenZWave upstream
18Patch4: %{name}-openzwave-Dev.patch
19# Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
20Patch5: %{name}-python.patch
d051ba14 21Patch6: no-git.patch
0abc31de 22Patch7: boost-1.73.patch
4987f952 23BuildRequires: boost-devel >= 1.66.0
72784cf7 24BuildRequires: cereal-devel
4987f952 25BuildRequires: cmake >= 3.16.0
9dda6696 26BuildRequires: curl-devel
4987f952 27BuildRequires: jsoncpp-devel
9dda6696 28BuildRequires: libmosquitto-devel
9dda6696 29BuildRequires: libopenzwave-devel >= 1.5.0
4987f952
JP
30BuildRequires: libstdc++-devel >= 6:4.8.1
31BuildRequires: libusb-compat-devel
32BuildRequires: linux-libc-headers
33BuildRequires: lua53-devel
72784cf7 34BuildRequires: minizip-devel
9dda6696 35BuildRequires: openssl-devel
4987f952
JP
36BuildRequires: pkgconfig
37BuildRequires: python3 >= 1:3.4
38BuildRequires: python3-devel >= 1:3.4
39BuildRequires: sqlite3-devel
40BuildRequires: tinyxml-devel
9dda6696
AM
41BuildRequires: tinyxpath-devel
42BuildRequires: zlib-devel
06cb1c68
AM
43Requires(pre): /usr/sbin/groupadd
44Requires(pre): /usr/sbin/useradd
9dda6696
AM
45Requires(post): systemd
46Requires(postun): systemd
47Requires(preun): systemd
06cb1c68 48Requires: fonts-TTF-Google-Droid
4987f952 49Requires: libopenzwave >= 1.5.0
9dda6696
AM
50Provides: bundled(js-ace)
51Provides: bundled(js-angular-ui-bootstrap) = 0.13.4
52Provides: bundled(js-angularamd) = 0.2.1
53Provides: bundled(js-angularjs) = 1.5.8
54Provides: bundled(js-blockly)
55Provides: bundled(js-bootbox)
56Provides: bundled(js-bootstrap) = 3.2.0
57Provides: bundled(js-colpick)
58Provides: bundled(js-d3)
59Provides: bundled(js-datatables-datatools) = 2.2.3
60Provides: bundled(js-dateformat) = 1.2.3
61Provides: bundled(js-filesaver) = 0.0-git20140725
62Provides: bundled(js-highcharts) = 4.2.6
63Provides: bundled(js-html5shiv) = 3.6.2
64Provides: bundled(js-i18next) = 1.8.0
65Provides: bundled(js-ion-sound) = 3.0.6
66Provides: bundled(js-jquery) = 1.12.0
67Provides: bundled(js-jquery-noty) = 2.1.0
68Provides: bundled(js-less) = 1.3.0
69Provides: bundled(js-ngdraggable)
70Provides: bundled(js-nggrid)
71Provides: bundled(js-ozwcp)
72Provides: bundled(js-require) = 2.1.14
73Provides: bundled(js-respond) = 1.1.0
74Provides: bundled(js-wow) = 0.1.9
75Provides: bundled(js-zeroclipboard) = 1.0.4
76
77%description
78Domoticz is a Home Automation System that lets you monitor and
79configure various devices like: Lights, Switches, various
80sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water
81and much more. Notifications/Alerts can be sent to any mobile device
82
83%prep
72784cf7 84%setup -q
10f7a92e
AM
85
86APPVERSION="%{version}"
87echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h
88echo '#define APPHASH "%{snap}"' >> appversion.h
89APPDATE=$(date --date="%{date}" "+%s")
90echo "#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
99rm -f hardware/openzwave/*.h
100rm -rf hardware/openzwave/aes
101rm -rf hardware/openzwave/command_classes
102rm -rf hardware/openzwave/platform
103rm -rf hardware/openzwave/value_classes
104rm -rf sqlite/
105rm -rf tinyxpath/
106
107%build
108install -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
126rm -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
131rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
132
133# move binary to standard directory
134install -d $RPM_BUILD_ROOT%{_bindir}/
135mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
136
137# install systemd service and config
138install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
139install -d $RPM_BUILD_ROOT%{systemdunitdir}/
140cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/
141cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
142
143# create database/ssl cert directory
144install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
145
146# Disable the app's self-update script
147
148# Unbundle DroidSans.ttf
149rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
06cb1c68 150ln -s /usr/share/fonts/TTF/DroidSans.ttf \
9dda6696
AM
151 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
152rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
06cb1c68 153ln -s /usr/share/fonts/TTF/DroidSans.ttf \
9dda6696
AM
154 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
155rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
06cb1c68 156ln -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
160ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
161 $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
162
163%clean
164rm -rf $RPM_BUILD_ROOT
165
166%pre
167getent group domoticz >/dev/null || groupadd -r domoticz
168getent passwd domoticz >/dev/null || \
169useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
170-c "Domoticz Home Automation Server" domoticz
171# For OpenZWave USB access (/dev/ttyACM#)
172usermod -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
This page took 0.067049 seconds and 4 git commands to generate.