]> git.pld-linux.org Git - packages/domoticz.git/blob - domoticz.spec
- correct install
[packages/domoticz.git] / domoticz.spec
1 Summary:        Open source Home Automation System
2 Name:           domoticz
3 Version:        3.8153
4 Release:        0.1
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
9 # Source0-md5:  ad7b1d0491cd17e54bbe7368bcfd5170
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
22 BuildRequires:  boost-devel
23 BuildRequires:  cmake
24 BuildRequires:  curl-devel
25 BuildRequires:  libmosquitto-devel
26 BuildRequires:  libmosquittopp-devel
27 BuildRequires:  libopenzwave-devel >= 1.5.0
28 BuildRequires:  libstdc++-devel
29 BuildRequires:  libusb-devel
30 BuildRequires:  lua-devel
31 BuildRequires:  openssl-devel
32 BuildRequires:  python3-devel
33 BuildRequires:  sqlite-devel
34 BuildRequires:  systemd-devel
35 BuildRequires:  tinyxpath-devel
36 BuildRequires:  zlib-devel
37
38 Requires(pre):  shadow-utils
39 Requires(post): systemd
40 Requires(postun):       systemd
41 Requires(preun):        systemd
42
43 Requires:       google-droid-sans-fonts
44 Suggests:       system-python-libs >= 3.4
45
46 Provides:       bundled(js-ace)
47 Provides:       bundled(js-angular-ui-bootstrap) = 0.13.4
48 Provides:       bundled(js-angularamd) = 0.2.1
49 Provides:       bundled(js-angularjs) = 1.5.8
50 Provides:       bundled(js-blockly)
51 Provides:       bundled(js-bootbox)
52 Provides:       bundled(js-bootstrap) = 3.2.0
53 Provides:       bundled(js-colpick)
54 Provides:       bundled(js-d3)
55 Provides:       bundled(js-datatables-datatools) = 2.2.3
56 Provides:       bundled(js-dateformat) = 1.2.3
57 Provides:       bundled(js-filesaver) = 0.0-git20140725
58 Provides:       bundled(js-highcharts) = 4.2.6
59 Provides:       bundled(js-html5shiv) = 3.6.2
60 Provides:       bundled(js-i18next) = 1.8.0
61 Provides:       bundled(js-ion-sound) = 3.0.6
62 Provides:       bundled(js-jquery) = 1.12.0
63 Provides:       bundled(js-jquery-noty) = 2.1.0
64 Provides:       bundled(js-less) = 1.3.0
65 Provides:       bundled(js-ngdraggable)
66 Provides:       bundled(js-nggrid)
67 Provides:       bundled(js-ozwcp)
68 Provides:       bundled(js-require) = 2.1.14
69 Provides:       bundled(js-respond) = 1.1.0
70 Provides:       bundled(js-wow) = 0.1.9
71 Provides:       bundled(js-zeroclipboard) = 1.0.4
72
73 %description
74 Domoticz is a Home Automation System that lets you monitor and
75 configure various devices like: Lights, Switches, various
76 sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water
77 and much more. Notifications/Alerts can be sent to any mobile device
78
79 %prep
80 %setup -q
81 %patch1 -p1 -b.version
82 %patch2 -p1 -b.tinyxpath
83 %patch3 -p1 -b.openzwave
84 %patch4 -p1 -b.openzwave-Dev
85 %patch5 -p1 -b.python
86 rm -f hardware/openzwave/*.h
87 rm -rf hardware/openzwave/aes
88 rm -rf hardware/openzwave/command_classes
89 rm -rf hardware/openzwave/platform
90 rm -rf hardware/openzwave/value_classes
91 rm -rf sqlite/
92 rm -rf tinyxpath/
93
94 %build
95 install -d build && cd build
96 %cmake \
97       -DUSE_STATIC_LIBSTDCXX=NO \
98       -DUSE_STATIC_OPENZWAVE=NO \
99       -DUSE_BUILTIN_LUA=NO \
100       -DUSE_BUILTIN_MQTT=NO \
101       -DUSE_BUILTIN_SQLITE=NO \
102       -DUSE_BUILTIN_TINYXPATH=NO \
103       -DUSE_STATIC_BOOST=NO \
104       -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \
105       ..
106
107 %{__make}
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111 %{__make} -C build install \
112       DESTDIR=$RPM_BUILD_ROOT
113
114 # remove docs, we grab them in files below
115 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
116
117 # move binary to standard directory
118 install -d $RPM_BUILD_ROOT%{_bindir}/
119 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
120
121 # install systemd service and config
122 install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
123 install -d $RPM_BUILD_ROOT%{systemdunitdir}/
124 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/
125 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
126
127 # create database/ssl cert directory
128 install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
129
130 # Disable the app's self-update script
131
132 # Unbundle DroidSans.ttf
133 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
134 ln -s %{_fontdir}/google-droid/DroidSans.ttf \
135       $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
136 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
137 ln -s %{_fontdir}/google-droid/DroidSans.ttf \
138       $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
139 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
140 ln -s %{_fontdir}/google-droid/DroidSans.ttf \
141       $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/
142
143 # OpenZWave Control Panel temp file
144 ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
145       $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
146
147 %clean
148 rm -rf $RPM_BUILD_ROOT
149
150 %pre
151 getent group domoticz >/dev/null || groupadd -r domoticz
152 getent passwd domoticz >/dev/null || \
153 useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
154 -c "Domoticz Home Automation Server" domoticz
155 # For OpenZWave USB access (/dev/ttyACM#)
156 usermod -G domoticz,dialout domoticz
157
158 %post
159 %systemd_post %{name}.service
160
161 %preun
162 %systemd_preun %{name}.service
163
164 %postun
165 %systemd_postun_with_restart %{name}.service
166
167 %files
168 %defattr(644,root,root,755)
169 %doc License.txt
170 %doc README.md History.txt
171 %attr(755,root,root) %{_bindir}/%{name}
172 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
173 %{_datadir}/%{name}/
174 %attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/
175 %{systemdunitdir}/%{name}.service
This page took 0.074963 seconds and 4 git commands to generate.