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