clean out some cruft from rpm spec. use appropriate names for weewx merging.

This commit is contained in:
Matthew Wall
2013-04-01 22:54:00 +00:00
parent e30ed370bb
commit 2777bf4330
2 changed files with 6 additions and 15 deletions

View File

@@ -72,10 +72,13 @@ configure_weewxconf() {
# use weewx setup utilities to merge new features into existing weewx.conf
merge_weewxconf() {
OLDVER="$1"
NEWVER="$2"
echo saving previous config file as $cfgfile-$OLDVER
mv $cfgfile $cfgfile-$OLDVER
echo merging new features into config file
$mergeapp --install-dir / --old-cfg $cfgfile-$OLDVER --new-cfg $cfgfile
echo saving distribution config file as $cfgfile-$NEWVER
mv $cfgfile.dpkg-dist $cfgfile-$NEWVER
echo merging previous and distribution into $cfgfile
$mergeapp --install-dir / --a $cfgfile-$NEWVER -b $cfgfile-$OLDVER --c $cfgfile
}
case "$1" in
@@ -86,7 +89,7 @@ configure)
CFGVERSION=`grep version $cfgfile | sed -e 's/\s*version\s*=\s*//'`
if dpkg --compare-versions $CFGVERSION lt $NEWVERSION; then
# this is an old config, so merge new features into it
merge_weewxconf $2
merge_weewxconf $2 $NEWVERSION
else
# this is a new config, so insert debconf values into it
configure_weewxconf

View File

@@ -2,29 +2,17 @@
# License: GPLv3
# Author: (c) 2013 Matthew Wall
# default configuration when OS is not known - this will fail. when it does,
# add a vendor section with an appropriate configuration.
%define layout unknown
# suse
%if 0%{?suse_version} || 0%{?sles_version}
%if 0%{?suse_version}
%define relos .suse%{suse_version}
%endif
%if 0%{?sles_version}
%define relos .sles%{sles_version}
%endif
%define layout suse
%define apacheconfdir %{_sysconfdir}/apache2/conf.d
%define apachecmd apache2
%endif
# redhat, fedora, centos
%if "%{_vendor}" == "redhat"
%define relos %{?dist:%{dist}}
%define layout redhat
%define apacheconfdir %{_sysconfdir}/httpd/conf.d
%define apachecmd httpd
%endif
%global relnum 1