3aa01fd
Name:		domoticz
415d1f4
Version:	3.8153
70a7e43
Release:	3%{?dist}
3aa01fd
Summary:	Open source Home Automation System
3aa01fd
3aa01fd
License:	GPLv3+ and ASL 2.0 and Boost and BSD and MIT
3aa01fd
URL:		http://www.domoticz.com
3aa01fd
Source0:	https://github.com/domoticz/domoticz/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
3aa01fd
Source1:	%{name}.service
3aa01fd
Source2:	%{name}.conf
3aa01fd
415d1f4
# Source says its version 3.5876, but it's really 3.8153
3aa01fd
Patch1:		%{name}-version.patch
70a7e43
# Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759)
415d1f4
Patch2:		%{name}-tinyxpath.patch
415d1f4
# Use system openzwave includes
415d1f4
Patch3:		%{name}-openzwave.patch
415d1f4
# Work against Dev branch of OpenZWave upstream
415d1f4
Patch4:		%{name}-openzwave-Dev.patch
70a7e43
# Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
70a7e43
Patch5:		%{name}-python.patch
3aa01fd
3aa01fd
BuildRequires:	boost-devel
3aa01fd
BuildRequires:	cmake
3aa01fd
BuildRequires:	curl-devel
70a7e43
BuildRequires:	fontpackages-devel
3aa01fd
BuildRequires:	gcc-c++
3aa01fd
BuildRequires:	git
415d1f4
BuildRequires:	libopenzwave-devel >= 1.5.0
3aa01fd
BuildRequires:	libusb-devel
3aa01fd
BuildRequires:	lua-devel
3aa01fd
BuildRequires:	mosquitto-devel
3aa01fd
BuildRequires:	openssl-devel
415d1f4
BuildRequires:	python3-devel
3aa01fd
BuildRequires:	sqlite-devel
3aa01fd
BuildRequires:	systemd-devel
415d1f4
BuildRequires:	tinyxpath-devel
3aa01fd
BuildRequires:	zlib-devel
3aa01fd
3aa01fd
Requires(pre):	shadow-utils
3aa01fd
Requires(post):	systemd
3aa01fd
Requires(postun):	systemd
3aa01fd
Requires(preun):	systemd
3aa01fd
3aa01fd
Requires:	google-droid-sans-fonts
70a7e43
Recommends:	system-python-libs >= 3.4
3aa01fd
3aa01fd
Provides:	bundled(js-ace)
3aa01fd
Provides:	bundled(js-angularamd) = 0.2.1
3aa01fd
Provides:	bundled(js-angularjs) = 1.5.8
3aa01fd
Provides:	bundled(js-blockly)
3aa01fd
Provides:	bundled(js-bootbox)
3aa01fd
Provides:	bundled(js-bootstrap) = 3.2.0
3aa01fd
Provides:	bundled(js-colpick)
3aa01fd
Provides:	bundled(js-d3)
3aa01fd
Provides:	bundled(js-datatables-datatools) = 2.2.3
3aa01fd
Provides:	bundled(js-dateformat) = 1.2.3
3aa01fd
Provides:	bundled(js-filesaver) = 0.0-git20140725
3aa01fd
Provides:	bundled(js-highcharts) = 4.2.6
3aa01fd
Provides:	bundled(js-html5shiv) = 3.6.2
3aa01fd
Provides:	bundled(js-i18next) = 1.8.0
3aa01fd
Provides:	bundled(js-jquery) = 1.12.0
3aa01fd
Provides:	bundled(js-ngdraggable)
3aa01fd
Provides:	bundled(js-nggrid)
3aa01fd
Provides:	bundled(js-jquery-noty) = 2.1.0
3aa01fd
Provides:	bundled(js-require) = 2.1.14
3aa01fd
Provides:	bundled(js-respond) = 1.1.0
3aa01fd
Provides:	bundled(js-angular-ui-bootstrap) = 0.13.4
3aa01fd
Provides:	bundled(js-wow) = 0.1.9
3aa01fd
Provides:	bundled(js-ozwcp)
3aa01fd
Provides:	bundled(js-less) = 1.3.0
3aa01fd
Provides:	bundled(js-ion-sound) = 3.0.6
3aa01fd
Provides:	bundled(js-zeroclipboard) = 1.0.4
3aa01fd
3aa01fd
3aa01fd
%description
3aa01fd
Domoticz is a Home Automation System that lets you monitor and configure various
3aa01fd
devices like: Lights, Switches, various sensors/meters like Temperature, Rain,
3aa01fd
Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to
3aa01fd
any mobile device
3aa01fd
3aa01fd
3aa01fd
%prep
3aa01fd
%setup -q
3aa01fd
%patch1 -p1 -b.version
415d1f4
%patch2 -p1 -b.tinyxpath
415d1f4
%patch3 -p1 -b.openzwave
415d1f4
%patch4 -p1 -b.openzwave-Dev
70a7e43
%patch5 -p1 -b.python
415d1f4
rm -f hardware/openzwave/*.h
415d1f4
rm -rf hardware/openzwave/aes
415d1f4
rm -rf hardware/openzwave/command_classes
415d1f4
rm -rf hardware/openzwave/platform
415d1f4
rm -rf hardware/openzwave/value_classes
70a7e43
rm -rf sqlite/
415d1f4
rm -rf tinyxpath/
3aa01fd
3aa01fd
3aa01fd
%build
3aa01fd
%cmake \
3aa01fd
 -DUSE_STATIC_LIBSTDCXX=NO \
3aa01fd
 -DUSE_STATIC_OPENZWAVE=NO \
3aa01fd
 -DUSE_BUILTIN_LUA=NO \
3aa01fd
 -DUSE_BUILTIN_MQTT=NO \
3aa01fd
 -DUSE_BUILTIN_SQLITE=NO \
70a7e43
 -DUSE_BUILTIN_TINYXPATH=NO \
3aa01fd
 -DUSE_STATIC_BOOST=NO \
3aa01fd
 -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name}
3aa01fd
make %{?_smp_mflags}
3aa01fd
3aa01fd
3aa01fd
%install
3aa01fd
%make_install
3aa01fd
3aa01fd
# remove docs, we grab them in files below
3aa01fd
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
3aa01fd
3aa01fd
# move binary to standard directory
3aa01fd
mkdir -p $RPM_BUILD_ROOT%{_bindir}/
3aa01fd
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
3aa01fd
3aa01fd
# install systemd service and config
3aa01fd
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
3aa01fd
mkdir -p $RPM_BUILD_ROOT%{_unitdir}/
3aa01fd
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/
3aa01fd
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
3aa01fd
3aa01fd
# create database/ssl cert directory
3aa01fd
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
3aa01fd
3aa01fd
# Disable the app's self-update script
3aa01fd
chmod 644 $RPM_BUILD_ROOT%{_datadir}/%{name}/updatedomo
3aa01fd
3aa01fd
# Unbundle DroidSans.ttf
3aa01fd
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
3aa01fd
ln -s %{_fontdir}/google-droid/DroidSans.ttf \
3aa01fd
      $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
3aa01fd
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
3aa01fd
ln -s %{_fontdir}/google-droid/DroidSans.ttf \
3aa01fd
      $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
3aa01fd
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
3aa01fd
ln -s %{_fontdir}/google-droid/DroidSans.ttf \
3aa01fd
      $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/
3aa01fd
d689dd1
# OpenZWave Control Panel temp file
70a7e43
ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
70a7e43
      $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
d689dd1
3aa01fd
3aa01fd
%pre
3aa01fd
getent group domoticz >/dev/null || groupadd -r domoticz
3aa01fd
getent passwd domoticz >/dev/null || \
3aa01fd
useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
3aa01fd
-c "Domoticz Home Automation Server" domoticz
415d1f4
# For OpenZWave USB access (/dev/ttyACM#)
415d1f4
usermod -G domoticz,dialout domoticz
3aa01fd
3aa01fd
3aa01fd
%post
3aa01fd
%systemd_post %{name}.service
3aa01fd
3aa01fd
3aa01fd
%preun
3aa01fd
%systemd_preun %{name}.service
3aa01fd
3aa01fd
3aa01fd
%postun
3aa01fd
%systemd_postun_with_restart %{name}.service
3aa01fd
3aa01fd
3aa01fd
%files
3aa01fd
%license License.txt
3aa01fd
%doc README.md History.txt
3aa01fd
%{_bindir}/%{name}
3aa01fd
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
3aa01fd
%{_datadir}/%{name}/
97b4254
%attr(0755,domoticz,domoticz) %{_sharedstatedir}/%{name}/
3aa01fd
%{_unitdir}/%{name}.service
3aa01fd
3aa01fd
3aa01fd
%changelog
70a7e43
* Fri Sep 08 2017 Michael Cronenworth <mike@cchtml.com> - 3.8153-3
70a7e43
- Fix OpenZWave control panel symlink (RHBZ#1482266)
70a7e43
- Fix Python detection
70a7e43
d689dd1
* Mon Jul 31 2017 Michael Cronenworth <mike@cchtml.com> - 3.8153-2
d689dd1
- Fix OpenZWave control panel
d689dd1
415d1f4
* Mon Jul 31 2017 Michael Cronenworth <mike@cchtml.com> - 3.8153-1
415d1f4
- New upstream version
415d1f4
- Unbundle tinyxpath
415d1f4
c179cb9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5877-3
c179cb9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c179cb9
8f9e10b
* Fri Jul 21 2017 Kalev Lember <klember@redhat.com> - 3.5877-2
8f9e10b
- Rebuilt for Boost 1.64
8f9e10b
3aa01fd
* Wed Jul 19 2017 Michael Cronenworth <mike@cchtml.com> - 3.5877-1
3aa01fd
- Initial spec