X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;ds=sidebyside;f=domoticz.spec;h=2ce07c726dabbe69102ccd81c57c3dd9e145ef7f;hb=77898dff43643e23448a31e0149536167f0278a5;hp=3eaf4fce8d49eecde04b959b266fae3742442d60;hpb=06cb1c68089503dfd75c8b32aab29ac09e132e28;p=packages%2Fdomoticz.git diff --git a/domoticz.spec b/domoticz.spec index 3eaf4fc..2ce07c7 100644 --- a/domoticz.spec +++ b/domoticz.spec @@ -1,71 +1,53 @@ Summary: Open source Home Automation System Name: domoticz -Version: 3.8153 -Release: 0.1 +Version: 2021.1 +Release: 1 License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT Group: Base URL: http://www.domoticz.com -Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz -# Source0-md5: ad7b1d0491cd17e54bbe7368bcfd5170 +Source0: https://github.com/domoticz/domoticz/archive/%{version}/%{name}-%{version}.tar.gz +# Source0-md5: 28349806fc3ddb0514ea7d9255ceecd0 Source1: %{name}.service Source2: %{name}.conf -# Source says its version 3.5876, but it's really 3.8153 -Patch1: %{name}-version.patch # Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759) -Patch2: %{name}-tinyxpath.patch -# Use system openzwave includes -Patch3: %{name}-openzwave.patch -# Work against Dev branch of OpenZWave upstream -Patch4: %{name}-openzwave-Dev.patch +Patch0: %{name}-tinyxpath.patch # Fix python detection (https://github.com/domoticz/domoticz/pull/1749) -Patch5: %{name}-python.patch -BuildRequires: boost-devel -BuildRequires: cmake +Patch1: %{name}-python.patch +Patch2: no-git.patch +Patch3: %{name}-gpio.patch +Patch4: %{name}-no_updates.patch +BuildRequires: boost-devel >= 1.66.0 +BuildRequires: cereal-devel +BuildRequires: cmake >= 3.16.0 BuildRequires: curl-devel +BuildRequires: jsoncpp-devel +BuildRequires: libfmt-devel BuildRequires: libmosquitto-devel -BuildRequires: libmosquittopp-devel BuildRequires: libopenzwave-devel >= 1.5.0 -BuildRequires: libstdc++-devel -BuildRequires: libusb-devel -BuildRequires: lua-devel +BuildRequires: libstdc++-devel >= 6:4.9 +BuildRequires: libusb-compat-devel +BuildRequires: linux-libc-headers +BuildRequires: lua53-devel +BuildRequires: minizip-devel BuildRequires: openssl-devel -BuildRequires: python3-devel -BuildRequires: sqlite-devel -BuildRequires: systemd-devel +BuildRequires: pkgconfig +BuildRequires: python3 >= 1:3.4 +BuildRequires: python3-devel >= 1:3.4 +BuildRequires: rpmbuild(macros) >= 1.644 +BuildRequires: sqlite3-devel +BuildRequires: tinyxml-devel BuildRequires: tinyxpath-devel BuildRequires: zlib-devel -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/sbin/useradd -Requires(post): systemd -Requires(postun): systemd -Requires(preun): systemd -Requires: fonts-TTF-Google-Droid -Provides: bundled(js-ace) -Provides: bundled(js-angular-ui-bootstrap) = 0.13.4 -Provides: bundled(js-angularamd) = 0.2.1 -Provides: bundled(js-angularjs) = 1.5.8 -Provides: bundled(js-blockly) -Provides: bundled(js-bootbox) -Provides: bundled(js-bootstrap) = 3.2.0 -Provides: bundled(js-colpick) -Provides: bundled(js-d3) -Provides: bundled(js-datatables-datatools) = 2.2.3 -Provides: bundled(js-dateformat) = 1.2.3 -Provides: bundled(js-filesaver) = 0.0-git20140725 -Provides: bundled(js-highcharts) = 4.2.6 -Provides: bundled(js-html5shiv) = 3.6.2 -Provides: bundled(js-i18next) = 1.8.0 -Provides: bundled(js-ion-sound) = 3.0.6 -Provides: bundled(js-jquery) = 1.12.0 -Provides: bundled(js-jquery-noty) = 2.1.0 -Provides: bundled(js-less) = 1.3.0 -Provides: bundled(js-ngdraggable) -Provides: bundled(js-nggrid) -Provides: bundled(js-ozwcp) -Provides: bundled(js-require) = 2.1.14 -Provides: bundled(js-respond) = 1.1.0 -Provides: bundled(js-wow) = 0.1.9 -Provides: bundled(js-zeroclipboard) = 1.0.4 +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd +Requires(post,preun,postun): systemd-units >= 38 +Requires: fonts-TTF-Google-Droid +Requires: fonts-TTF-OpenSans +Requires: libopenzwave >= 1.5.0 +Requires: setup >= 2.10.1 +Suggests: python3-libs +Provides: group(domoticz) +Provides: user(domoticz) %description Domoticz is a Home Automation System that lets you monitor and @@ -75,82 +57,82 @@ and much more. Notifications/Alerts can be sent to any mobile device %prep %setup -q -%patch1 -p1 -b.version -%patch2 -p1 -b.tinyxpath -%patch3 -p1 -b.openzwave -%patch4 -p1 -b.openzwave-Dev -%patch5 -p1 -b.python -rm -f hardware/openzwave/*.h -rm -rf hardware/openzwave/aes -rm -rf hardware/openzwave/command_classes -rm -rf hardware/openzwave/platform -rm -rf hardware/openzwave/value_classes -rm -rf sqlite/ -rm -rf tinyxpath/ +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +APPVERSION="%{version}" +echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h +echo '#define APPHASH "%{snap}"' >> appversion.h +APPDATE=$(date --date="%{date}" "+%s") +echo "#define APPDATE ${APPDATE}" >> appversion.h + +%{__rm} -r extern tinyxpath %build install -d build && cd build +export CXXFLAGS="%{rpmcxxflags} -DPYTHON_LIBDIR=\\\"%{_libdir}\\\"" %cmake \ - -DUSE_STATIC_LIBSTDCXX=NO \ - -DUSE_STATIC_OPENZWAVE=NO \ - -DUSE_BUILTIN_LUA=NO \ - -DUSE_BUILTIN_MQTT=NO \ - -DUSE_BUILTIN_SQLITE=NO \ - -DUSE_BUILTIN_TINYXPATH=NO \ - -DUSE_STATIC_BOOST=NO \ - -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \ - .. + -DUSE_BUILTIN_JSONCPP=NO \ + -DUSE_BUILTIN_LIBFMT=NO \ + -DUSE_BUILTIN_MINIZIP=NO \ + -DUSE_BUILTIN_MQTT=NO \ + -DUSE_BUILTIN_SQLITE=NO \ + -DUSE_BUILTIN_TINYXPATH=NO \ + -DUSE_LUA_STATIC=NO \ + -DUSE_OPENSSL_STATIC=NO \ + -DUSE_STATIC_BOOST=NO \ + -DUSE_STATIC_LIBSTDCXX=NO \ + -DUSE_STATIC_OPENZWAVE=NO \ + -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \ + .. %{__make} %install rm -rf $RPM_BUILD_ROOT + %{__make} -C build install \ - DESTDIR=$RPM_BUILD_ROOT + DESTDIR=$RPM_BUILD_ROOT + +install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/sysconfig,%{systemdunitdir},%{_sharedstatedir}/%{name}} # remove docs, we grab them in files below -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt +%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt # move binary to standard directory -install -d $RPM_BUILD_ROOT%{_bindir}/ -mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/ +mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir} -# install systemd service and config -install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ -install -d $RPM_BUILD_ROOT%{systemdunitdir}/ -cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/ +cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir} cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} -# create database/ssl cert directory -install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/ - -# Disable the app's self-update script - # Unbundle DroidSans.ttf -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf -ln -s /usr/share/fonts/TTF/DroidSans.ttf \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/ -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf -ln -s /usr/share/fonts/TTF/DroidSans.ttf \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/ -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf -ln -s /usr/share/fonts/TTF/DroidSans.ttf \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/ +%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element{al,-light,-dark}/fonts/{Droid,Open}Sans.ttf +ln -s %{_fontsdir}/TTF/DroidSans.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts +ln -s %{_fontsdir}/TTF/OpenSans-Regular.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/OpenSans.ttf +ln -s %{_fontsdir}/TTF/DroidSans.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts +ln -s %{_fontsdir}/TTF/OpenSans-Regular.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/OpenSans.ttf +ln -s %{_fontsdir}/TTF/DroidSans.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts +ln -s %{_fontsdir}/TTF/OpenSans-Regular.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/OpenSans.ttf # OpenZWave Control Panel temp file ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml + $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml %clean rm -rf $RPM_BUILD_ROOT %pre -getent group domoticz >/dev/null || groupadd -r domoticz -getent passwd domoticz >/dev/null || \ -useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \ --c "Domoticz Home Automation Server" domoticz -# For OpenZWave USB access (/dev/ttyACM#) -usermod -G domoticz,dialout domoticz +%groupadd -g 342 domoticz +%useradd -u 342 -r -d %{_datadir} -s /bin/false -c "Domoticz Home Automation Server" -G dialout,i2c -g domoticz domoticz %post %systemd_post %{name}.service @@ -159,14 +141,17 @@ usermod -G domoticz,dialout domoticz %systemd_preun %{name}.service %postun -%systemd_postun_with_restart %{name}.service +if [ "$1" = "0" ]; then + %userremove mpd + %groupremove mpd +fi +%systemd_reload %files %defattr(644,root,root,755) -%doc License.txt -%doc README.md History.txt +%doc License.txt README.md History.txt %attr(755,root,root) %{_bindir}/%{name} %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} -%{_datadir}/%{name}/ -%attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/ +%{_datadir}/%{name} +%dir %attr(750,domoticz,domoticz) %{_sharedstatedir}/%{name} %{systemdunitdir}/%{name}.service