]> git.pld-linux.org Git - packages/lm_sensors.git/blobdiff - lm_sensors.spec
- updated URL and macros version
[packages/lm_sensors.git] / lm_sensors.spec
index 9ab4a86519bb9ae1810184f08f6b26ab0ae99ff6..9bb5bd661d90dea445d07c1d9cf119c19db1adeb 100644 (file)
@@ -1,49 +1,45 @@
 # TODO
-# - unpackaged:
-#   /usr/sbin/fancontrol.pl (isn't that the same as sh fancontrol script?)
 # - a big trigger warning how to use fancontrol and to init it first
 #
-%define                cmodule         /etc/sysconfig/sensors_modules
-%define                cdaemon         /etc/sysconfig/sensors
-%define                smodule         /etc/rc.d/init.d/sensors_modules
-%define                sdaemon         /etc/rc.d/init.d/sensors
-
-%include       /usr/lib/rpm/macros.perl
+%define                ver     %(echo %{version} | tr . -)
 Summary:       Hardware health monitoring
 Summary(pl.UTF-8):     Monitor stanu sprzętu
 Summary(pt_BR.UTF-8):  Ferramentas para monitoração do hardware
 Summary(ru.UTF-8):     Утилиты для мониторинга аппаратуры
 Summary(uk.UTF-8):     Утиліти для моніторингу апаратури
 Name:          lm_sensors
-Version:       2.10.5
-Release:       1
+Version:       3.5.0
+Release:       2
 License:       GPL v2+
 Group:         Applications/System
-Source0:       http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.gz
-# Source0-md5: 77f96bc8a7773e95b2990d756e4925d6
-Source1:       sensors.init
-Source2:       sensors.sysconfig
+#Source0Download: https://github.com/lm-sensors/lm-sensors/releases
+Source0:       https://github.com/lm-sensors/lm-sensors/archive/V%{ver}/%{name}-%{version}.tar.gz
+# Source0-md5: 37981f5d3a0f649381529cb41c0f1ff3
+Source1:       sensord.init
+Source2:       sensord.sysconfig
 Source3:       fancontrol.init
 Source4:       fancontrol.sysconfig
 Source5:       sensors.sh
-Source6:       sensors_modules.init
-Source7:       sensors_modules.sysconfig
-Patch0:                %{name}-make.patch
-Patch1:                %{name}-ppc.patch
-Patch2:                %{name}-iconv-in-libc.patch
-Patch3:                %{name}-sensors-detect-PATH.patch
-URL:           http://www.lm-sensors.org/
+Source6:       lm_sensors.init
+Source7:       lm_sensors.sysconfig
+Source8:       sensord.service
+Patch0:                %{name}-iconv-in-libc.patch
+Patch1:                %{name}-sensors-detect-PATH.patch
+Patch2:                %{name}-make.patch
+URL:           https://hwmon.wiki.kernel.org/lm_sensors
 BuildRequires: bison
 BuildRequires: flex >= 2.5.1
-BuildRequires: perl-modules >= 5.6
 BuildRequires: rpm-perlprov >= 3.0.3-16
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpmbuild(macros) >= 1.745
 BuildRequires: rrdtool-devel >= 1.2.10
-BuildRequires: sysfsutils-devel
+Requires(post,preun):  /sbin/chkconfig
+Requires(post,preun,postun):   systemd-units >= 38
 Requires:      %{name}-libs = %{version}-%{release}
 Requires:      dev >= 2.9.0-13
-Requires:      dmidecode
-Requires:      %{name}-config
+Requires:      rc-scripts >= 0.4.2.8
+Requires:      systemd-units >= 38
+Requires:      uname(release) >= 2.6.5
+Obsoletes:     lm_sensors-config-default
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -136,27 +132,15 @@ Bibliotecas estáticas para desenvolvimento com lm_sensors
 Пакет lm_sensors-static містить статичні бібліотеки, необхідні для
 побудови програм, які використовують дані сенсорів.
 
-%package config-default
-Summary:       Default sensors configuration files
-Summary(pl.UTF-8):     Domyślne pliki konfiguracyjne lm_sensors
-Group:         Applications/System
-Requires:      %{name} = %{version}-%{release}
-Provides:      %{name}-config
-
-%description config-default
-Default configuration files for lm_sensors.
-
-%description config-default -l pl.UTF-8
-Domyślne pliki konfiguracyjne lm_sensors.
-
 %package sensord
 Summary:       Sensord daemon
 Summary(pl.UTF-8):     Demon sensord
 Group:         Daemons
 Requires(post,preun):  /sbin/chkconfig
+#Requires(post,preun,postun):  systemd-units >= 38
 Requires:      %{name} = %{version}-%{release}
-Requires:      %{name}-config
 Requires:      rc-scripts
+#Requires:     systemd-units >= 38
 
 %description sensord
 Sensord daemon.
@@ -190,31 +174,22 @@ uruchomienie service fancontrol init) oraz upewnić się, że progi
 temperatury są ustawione poprawnie, by nie spalić wnętrza komputera!
 
 %prep
-%setup -q
+%setup -q -n lm-sensors-%{ver}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
 
 %build
 %{__make} user \
        CC="%{__cc}" \
        OPTS="%{rpmcflags}" \
-       LIBDIR=%{_libdir} \
-       LINUX=/dev/null \
-       LINUX_HEADERS=%{_kernelsrcdir}/include \
-       I2C_HEADERS=/usr/include \
-       PROG_EXTRA:="sensord" \
-       SYSFS_SUPPORT:=1
-
-%{__make} -C prog/eepromer \
-       CC="%{__cc}" \
-       CFLAGS="%{rpmcflags} -I../../kernel/include"
+       SYSFS_SUPPORT:=1 \
+       PROG_EXTRA:="sensord"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8,%{systemdunitdir}} \
        $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
 
 %{__make} user_install \
@@ -224,22 +199,19 @@ install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} \
        LIBDIR=%{_libdir} \
        MANDIR=%{_mandir} \
        PROG_EXTRA:="sensord" \
-       LINUX=/dev/null \
-       LINUX_HEADERS=%{_kernelsrcdir}/include \
-       I2C_HEADERS=/usr/include
-
-install prog/eepromer/{eeprom,eepromer}        $RPM_BUILD_ROOT%{_sbindir}
+       SYSFS_SUPPORT:=1
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensors
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensord
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sensord
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/fancontrol
 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/fancontrol
 install %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}
-install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/sensors_modules
-install %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/sensors_modules
+install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lm_sensors
+install %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/lm_sensors
+install -d $RPM_BUILD_ROOT/%{_sysconfdir}/sensors.d 
 
-# i2c API for userspace - included in linux-libc-headers
-rm -f $RPM_BUILD_ROOT%{_includedir}/linux/i2c-dev.h
+install -p prog/init/lm_sensors.service $RPM_BUILD_ROOT%{systemdunitdir}
+install -p %{SOURCE8} $RPM_BUILD_ROOT%{systemdunitdir}/sensord.service
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -247,71 +219,79 @@ rm -rf $RPM_BUILD_ROOT
 %post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
-%post
-if [ -f "%{cmodule}" ]; then
-       /sbin/chkconfig --add sensors_modules
-       %service sensors_modules restart "sensors modules"
-       if [ -f "%{sdaemon}" ]; then
-               /sbin/chkconfig --add sensors
-               %service sensors restart "sensors deamon"
-       fi
-fi
-
-%preun
-if [ "$1" = "0" ]; then
-       if [ -f "%{sdaemon}" ]; then
-               %service sensors stop
-               /sbin/chkconfig --del sensors
-       fi
-       %service sensors_modules stop
+%pre
+if [ -f /var/lock/subsys/sensors_modules ]; then
+       mv -f /var/lock/subsys/sensors_modules /var/lock/subsys/lm_sensors
        /sbin/chkconfig --del sensors_modules
 fi
+if [ -f /etc/sysconfig/sensors_modules ]; then
+       . /etc/sysconfig/sensors_modules
+       [ -z "$BUS" ] || echo BUS_MODULES=\""$BUS"\" >>/etc/sysconfig/lm_sensors
+       [ -z "$CHIP" ] || echo HWMON_MODULES=\""$CHIP"\" >>/etc/sysconfig/lm_sensors
+fi
 
-%post config-default
+%if 0
+#"
+%endif
+
+%post
 if [ "$1" = 1 ]; then
 cat << EOF
  *********************************************************************
  *                                                                   *
  *  NOTE:                                                            *
  *  You have to configure sensors to match your motherboard sensors  *
- *  in  /etc/sensors.conf  and  /etc/sysconfig/sensors_modules. Use  *
- *  sensors-detect script which  can  help you find proper modules.  *
+ *  in /etc/sensors3.conf and /etc/sysconfig/lm_sensors.             *
+ *  Use sensors-detect script to find proper modules.                *
  *                                                                   *
  *********************************************************************
 EOF
 fi
-if [ -f "%{smodule}" ]; then
-       /sbin/chkconfig --add sensors_modules
-       %service sensors_modules restart "sensors modules"
-fi
-if [ -f "%{sdaemon}" ]; then
-       /sbin/chkconfig --add sensors
-       %service sensors restart "sensors daemon"
-fi
+/sbin/chkconfig --add lm_sensors
+NORESTART=1
+%systemd_post lm_sensors.service
 
-%preun config-default
+%preun
 if [ "$1" = "0" ]; then
-       if [ -f "%{sdaemon}" ]; then
-               %service sensors stop
-               /sbin/chkconfig --del sensors
-       fi
-       if [ -f "%{smodule}" ]; then
-               %service sensors_modules stop
-               /sbin/chkconfig --del sensors_modules
-       fi
+       %service lm_sensors stop
+       /sbin/chkconfig --del lm_sensors
 fi
+%systemd_preun lm_sensors.service
 
-%post sensord
-if [ -f "%{cmodule}" ]; then
-       /sbin/chkconfig --add sensors
-       %service sensors restart "sensors daemon"
+%postun
+%systemd_reload
+
+%triggerpostun -- %{name} < 3.3.2-2
+%systemd_trigger lm_sensors.service
+
+%pre sensord
+if [ -f /var/lock/subsys/sensors ]; then
+       mv -f /var/lock/subsys/sensors /var/lock/subsys/sensord
+fi
+if [ -f /etc/rc.d/init.d/sensors ]; then
+       /sbin/chkconfig --del sensors
 fi
+if [ -f /etc/sysconfig/sensors ]; then
+       cp -a /etc/sysconfig/sensors /etc/sysconfig/sensord
+fi
+
+%post sensord
+/sbin/chkconfig --add sensord
+%service sensord restart "sensors daemon"
+%systemd_post sensord.service
 
 %preun sensord
 if [ "$1" = "0" ]; then
-       %service sensors stop
-       /sbin/chkconfig --del sensors
+       %service sensord stop
+       /sbin/chkconfig --del sensord
 fi
+%systemd_preun sensord.service
+
+%postun sensord
+%systemd_reload
+
+%triggerpostun sensord -- %{name}-sensord < 3.3.2-2
+%systemd_trigger sensord.service
 
 %post fancontrol
 if [ "$1" = 1 ]; then
@@ -328,15 +308,10 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc BACKGROUND BUGS CHANGES README README.thinkpad TODO doc/{busses,chips}
-%doc doc/{FAQ,donations,fan-divisors,progs,temperature-sensors,*html,vid}
-%doc prog/{config,daemon,eepromer/README*,matorb,maxilife}
-%attr(755,root,root) %{_bindir}/ddcmon
-%attr(755,root,root) %{_bindir}/decode-*.pl
+%doc CHANGES CONTRIBUTORS README doc/{donations,fan-divisors,progs,temperature-sensors,vid} prog/daemon
+%attr(755,root,root) %{_bindir}/sensors-conf-convert
 %attr(755,root,root) %{_bindir}/sensors
 %attr(755,root,root) %{_bindir}/sensors.sh
-%attr(755,root,root) %{_sbindir}/eeprom*
-%attr(755,root,root) %{_sbindir}/i2c*
 %attr(755,root,root) %{_sbindir}/sensors-detect
 %ifarch %{ix86} %{x8664}
 %attr(755,root,root) %{_sbindir}/isadump
@@ -346,25 +321,25 @@ fi
 %endif
 %{_mandir}/man1/sensors.1*
 %{_mandir}/man5/sensors.conf.5*
-%{_mandir}/man8/i2c*.8*
-%attr(754,root,root) /etc/rc.d/init.d/sensors_modules
-
-%files config-default
-%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sensors.conf
-%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sensors_modules
+%{_mandir}/man5/sensors3.conf.5*
+%{_mandir}/man8/sensors-conf-convert.8*
+%{_mandir}/man8/sensors-detect.8*
+%attr(754,root,root) /etc/rc.d/init.d/lm_sensors
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sensors3.conf
+%dir %{_sysconfdir}/sensors.d
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lm_sensors
+%{systemdunitdir}/lm_sensors.service
 
 %files libs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libsensors.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libsensors.so.[0-9]
+%attr(755,root,root) %ghost %{_libdir}/libsensors.so.5
 
 %files devel
 %defattr(644,root,root,755)
-%doc doc/{developers,kernel}
+%doc doc/developers doc/libsensors-API.txt
 %attr(755,root,root) %{_libdir}/libsensors.so
 %{_includedir}/sensors
-%{_includedir}/linux/sensors.h
 %{_mandir}/man3/libsensors.3*
 
 %files static
@@ -374,10 +349,10 @@ fi
 %files sensord
 %defattr(644,root,root,755)
 %attr(754,root,root) %{_sbindir}/sensord
-%attr(754,root,root) /etc/rc.d/init.d/sensors
-%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sensors
-%{_mandir}/man8/sensors-detect.8*
+%attr(754,root,root) /etc/rc.d/init.d/sensord
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sensord
 %{_mandir}/man8/sensord.8*
+%{systemdunitdir}/sensord.service
 
 %files fancontrol
 %defattr(644,root,root,755)
This page took 0.065022 seconds and 4 git commands to generate.