Hello community,

here is the log from the commit of package smartmontools for openSUSE:Factory 
checked in at 2012-12-19 13:29:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/smartmontools (Old)
 and      /work/SRC/openSUSE:Factory/.smartmontools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "smartmontools", Maintainer is "sbra...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/smartmontools/smartmontools.changes      
2012-12-05 14:08:59.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.smartmontools.new/smartmontools.changes 
2012-12-19 13:29:17.000000000 +0100
@@ -1,0 +2,8 @@
+Wed Dec 12 19:47:57 CET 2012 - sbra...@suse.cz
+
+- Use sysconfig variables (sed on smartd.service.in) and generate
+  smartd_opts for systemd smartd.service.
+- Remove obsolete parsing of /etc/default/smartmontools
+  (it is no more in upstream installation).
+
+-------------------------------------------------------------------
@@ -16 +24 @@
-- Update to version 6.0:
+- Update to version 6.0 (bnc#789204):

New:
----
  smartmontools.generate_smartd_opts.in

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ smartmontools.spec ++++++
--- /var/tmp/diff_new_pack.RfyCLD/_old  2012-12-19 13:29:19.000000000 +0100
+++ /var/tmp/diff_new_pack.RfyCLD/_new  2012-12-19 13:29:19.000000000 +0100
@@ -24,6 +24,7 @@
 Source2:        smartmontools.sysconfig
 Source3:        %{name}-rpmlintrc
 Source4:        %{name}.keyring
+Source5:        %{name}.generate_smartd_opts.in
 Patch1:         smartmontools-default-enabled.patch
 Patch3:         smartmontools-silent-unsupported.patch
 Patch4:         smartmontools-removable.patch
@@ -36,6 +37,7 @@
 Patch11:        smartd-service-novm.patch
 PreReq:         %fillup_prereq
 PreReq:         %insserv_prereq
+# Needed by generate_smartd_opt:
 PreReq:         coreutils
 %if 0%{?suse_version} > 1130
 %if 0%{?suse_version} < 1230
@@ -45,10 +47,11 @@
 %if 0%{?suse_version} <= 1100
 Requires:       powersave
 %endif
-%{?systemd_requires}
 Url:            http://smartmontools.sourceforge.net/
 BuildRequires:  gcc-c++
+%if 0%{?suse_version} > 1220
 BuildRequires:  gpg-offline
+%endif
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if 0%{?suse_version} >= 1110
 BuildRequires:  libselinux-devel
@@ -78,9 +81,11 @@
 commands man smartctl and man smartd will provide more information.
 
 %prep
+%if 0%{?gpg_verify:1}
 %gpg_verify %{S:1}
+%endif
 %setup -q
-cp -a %{SOURCE2} .
+cp -a %{SOURCE2} %{SOURCE5} .
 %patch1
 %patch3
 %patch4
@@ -88,6 +93,8 @@
 %patch8 -p1
 %patch10 -p1
 %patch11
+# PATCH-FEATURE-OPENSUSE (sed on smartd.service.in) sbra...@suse.cz -- Use 
generated smartd_opts (from SUSE sysconfig file). Systemd smartd.service cannot 
be smart enough to parse SUSE sysconfig file and generate smartd_opts on fly. 
And we do not want to launch shell just for it in every boot.
+sed -i 
"s:/usr/local/etc/sysconfig/smartmontools:%{_localstatedir}/lib/smartmontools/smartd_opts:"
 smartd.service.in
 
 %build
 %if %suse_version > 1000
@@ -108,6 +115,7 @@
        --enable-savestates\
        --enable-attributelog
 make %{?_smp_mflags} BUILD_INFO='"(SUSE RPM)"'
+sed "s:@libdir@:%{_libdir}:g;s:@localstatedir@:%{_localstatedir}:g" 
<smartmontools.generate_smartd_opts.in >generate_smartd_opts
 
 %install
 %makeinstall
@@ -115,20 +123,28 @@
 cp smartd.initd %{buildroot}%{_sysconfdir}/init.d/smartd
 chmod +x %{buildroot}%{_sysconfdir}/init.d/smartd
 ln -s ../..%{_sysconfdir}/init.d/smartd %{buildroot}%{_sbindir}/rcsmartd
-%if 0%{?suse_version} <= 1100
+%if 0%{?suse_version} <= 1100 || 0%{?suse_version} > 1140
 mkdir -p %{buildroot}%{_prefix}/lib/smartmontools
+%endif
+%if 0%{?suse_version} <= 1100
 cp examplescripts/Example4 
%{buildroot}%{_prefix}/lib/smartmontools/smart-notify
 chmod +x %{buildroot}%{_prefix}/lib/smartmontools/smart-notify
 %endif
 mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
 cp smartmontools.sysconfig 
%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.smartmontools
 mkdir -p %{buildroot}%{_localstatedir}/lib/smartmontools
+%if 0%{?suse_version} > 1140
+touch %{buildroot}%{_localstatedir}/lib/smartmontools/smartd_opts
+install generate_smartd_opts %{buildroot}%{_prefix}/lib/smartmontools/
+%endif
 cat >%{buildroot}%{_sysconfdir}/smart_drivedb.h <<EOF
 /* smart_drivedb.h: Custom drive database. See also 
%{_datadir}/smartmontools/drivedb.h. */
 EOF
 %if 0%{?suse_version} >= 1210
        cp smartd.service %{buildroot}/%{_unitdir}
 %endif
+# INSTALL file is intended only for packagers.
+rm %{buildroot}%{_defaultdocdir}/%{name}/INSTALL
 
 %clean
 rm -rf %{buildroot}
@@ -139,90 +155,16 @@
 %endif
 
 %post
-# Migrate %{_sysconfdir}/default/smartmontools to sysconfig 
(<=11.0,>=10.2,upstream)
-#BEGIN smartd_opts_migrate
-# generated by genopts
-function optarg_parse()
-{
-    OPTARG_INTERVAL=false
-    OPTARG_LOGFACILITY=false
-    until [ $# -eq 0 ]
-    do
-       case "$1" in
-       --interval )
-           shift
-           OPTARG_INTERVAL=true
-           OPTVAL_INTERVAL="$1"
-           ;;
-       --interval=* )
-           OPTARG_INTERVAL=true
-           OPTVAL_INTERVAL="${1#--interval=}"
-           ;;
-       --logfacility )
-           shift
-           OPTARG_LOGFACILITY=true
-           OPTVAL_LOGFACILITY="$1"
-           ;;
-       --logfacility=* )
-           OPTARG_LOGFACILITY=true
-           OPTVAL_LOGFACILITY="${1#--logfacility=}"
-           ;;
-       -* )
-           OPTTMP="${1:1}"
-           until [[ -z "$OPTTMP" ]]
-           do
-               case "${OPTTMP:0:1}" in
-               i )
-                   OPTARG_INTERVAL=true
-                   OPTVAL_INTERVAL="${OPTTMP:1}"
-                   if [[ -z "$OPTVAL_INTERVAL" ]]
-                   then
-                       shift
-                       OPTVAL_INTERVAL="$1"
-                   else
-                       break
-                   fi
-                   ;;
-               l )
-                   OPTARG_LOGFACILITY=true
-                   OPTVAL_LOGFACILITY="${OPTTMP:1}"
-                   if [[ -z "$OPTVAL_LOGFACILITY" ]]
-                   then
-                       shift
-                       OPTVAL_LOGFACILITY="$1"
-                   else
-                       break
-                   fi
-                   ;;
-               esac
-           OPTTMP="${OPTTMP:1}"
-           done
-           ;;
-       * )
-           ARGV=("${ARGV[@]}" "$1")
-           ;;
-       esac
-    shift
-    done
-}
-if test -f %{_sysconfdir}/default/smartmontools -a \! -f 
%{_sysconfdir}/sysconfig/smartmontools ; then
-    . %{_sysconfdir}/default/smartmontools
-    optarg_parse $smartd_opts
-    EXPR=
-    if $OPTARG_INTERVAL ; then
-       echo "SMARTD_CHECK_INTERVAL=\"$OPTVAL_INTERVAL\"" 
>>%{_sysconfdir}/sysconfig/smartmontools
-       EXPR="s/=\"1800\"/=\"$OPTVAL_INTERVAL\"/;"
-    fi
-    if $OPTARG_LOGFACILITY ; then
-       echo "SMARTD_LOG_FACILITY=\"$OPTVAL_LOGFACILITY\"" 
>>%{_sysconfdir}/sysconfig/smartmontools
-       EXPR="${EXPR}s/=\"daemon\"/=\"$OPTVAL_LOGFACILITY\"/;"
-    fi
-    sed "$EXPR" </var/adm/fillup-templates/sysconfig.smartmontools 
>%{_sysconfdir}/sysconfig/smartmontools
-    rm %{_sysconfdir}/default/smartmontools
-fi
-#END smartd_opts_migrate
+# First prepare sysconfig.
+%{fillup_only}
+
+%if 0%{?suse_version} > 1140
+# Then generate initial %{_localstatedir}/lib/smartmontools/smartd_opts needed 
by smartd.service.
+SMARTD_SKIP_INIT=1 %{_prefix}/lib/smartmontools/generate_smartd_opts
+%endif
+
 # Turn smartd on by default.
-%{fillup_and_insserv -y smartd}
+%{fillup_and_insserv -f -y smartd}
 
 %if 0%{?suse_version} >= 1210
        #systemd
@@ -248,8 +190,11 @@
 %doc %{_docdir}/%{name}
 %{_datadir}/smartmontools
 %doc %{_mandir}/man*/*
-%{_localstatedir}/lib/smartmontools
-%if 0%{?suse_version} <= 1100
+%dir %{_localstatedir}/lib/smartmontools
+%if 0%{?suse_version} > 1140
+%ghost %{_localstatedir}/lib/smartmontools/smartd_opts
+%endif
+%if 0%{?suse_version} <= 1100 || 0%{?suse_version} > 1140
 %{_prefix}/lib/smartmontools
 %endif
 %if 0%{?suse_version} >= 1210


++++++ smartmontools.generate_smartd_opts.in ++++++
#! /bin/bash

# smartmontools sysconfig command line options generator
# Copyright (C) 2012 Stanislav Brabec <sbra...@suse.cz>

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version. 
# You should have received a copy of the GNU General Public License (for
# example COPYING); if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.

# Following code must be in sync with sysv init script!

# source configuration file.
[ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools
smartd_opts=
if test -n "$SMARTD_CHECK_INTERVAL" -a "$SMARTD_CHECK_INTERVAL" != 1800 ; then
        smartd_opts=" -i $SMARTD_CHECK_INTERVAL"
fi
if test -n "$SMARTD_LOG_FACILITY" -a "$SMARTD_LOG_FACILITY" != "daemon" ; then
        smartd_opts="$smartd_opts -l $SMARTD_LOG_FACILITY"
fi
if test -n "$SMARTD_DRIVEDB" ; then
        smartd_opts="$smartd_opts -B $SMARTD_DRIVEDB"
fi
if test "$SMARTD_SAVESTATES" = "no" ; then
        smartd_opts="$smartd_opts -s \"\""
fi
if test "$SMARTD_ATTRLOG" = "no" ; then
        smartd_opts="$smartd_opts -A \"\""
fi
if test -n "$SMARTD_EXTRA_OPTS" ; then
        smartd_opts="$smartd_opts $SMARTD_EXTRA_OPTS"
fi

mkdir -p @localstatedir@/lib/smartmontools

echo "# Generated by @libdir@/smartmontools/generate_smartd_opts
smartd_opts=\"$smartd_opts\"" >@localstatedir@/lib/smartmontools/smartd_opts

# SMARTD_SKIP_INIT is used during installation.
if test -z "$SMARTD_SKIP_INIT" ; then
        # Behavior of both "Command" and "ServiceRestart" is undefined. Restart 
service here.
        /etc/init.d/smartd try-restart
fi
++++++ smartmontools.sysconfig ++++++
--- /var/tmp/diff_new_pack.RfyCLD/_old  2012-12-19 13:29:19.000000000 +0100
+++ /var/tmp/diff_new_pack.RfyCLD/_new  2012-12-19 13:29:20.000000000 +0100
@@ -1,6 +1,6 @@
 ## Path:       Hardware/S.M.A.R.T.
 ## Description:        Hard disc health monitoring
-## ServiceRestart: smartd
+## Command:     /usr/lib/smartmontools/generate_smartd_opts
 
 ## Type:       integer(10:)
 ## Default:    1800

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to