From 15f0aba705b0ea1864936ea2f790878161cb7133f1abd9ec0ec311296dcf85af Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 4 Jun 2014 10:41:28 +0000 Subject: [PATCH 1/4] - HOSTNAME renamed to hostname [bnc#858908] OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=20 --- HOSTNAME => hostname | 0 netcfg.changes | 5 +++++ netcfg.spec | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) rename HOSTNAME => hostname (100%) diff --git a/HOSTNAME b/hostname similarity index 100% rename from HOSTNAME rename to hostname diff --git a/netcfg.changes b/netcfg.changes index 8ebbcf9..b000d63 100644 --- a/netcfg.changes +++ b/netcfg.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 4 10:36:22 UTC 2014 - pgajdos@suse.com + +- HOSTNAME renamed to hostname [bnc#858908] + ------------------------------------------------------------------- Thu Feb 6 16:30:09 UTC 2014 - pgajdos@suse.com diff --git a/netcfg.spec b/netcfg.spec index 7837497..8c59b55 100644 --- a/netcfg.spec +++ b/netcfg.spec @@ -37,7 +37,7 @@ Source8: hosts.lpd Source9: networks Source10: protocols Source11: services.bz2 -Source12: HOSTNAME +Source12: hostname Source13: aliases Source14: ethers Source15: netgroup @@ -64,7 +64,7 @@ cp %{S:16} . %install mkdir -p $RPM_BUILD_ROOT/etc -for i in HOSTNAME aliases defaultdomain exports ftpusers host.conf hosts hosts.allow hosts.deny hosts.equiv hosts.lpd netgroup networks protocols services.bz2 ethers; do +for i in hostname aliases defaultdomain exports ftpusers host.conf hosts hosts.allow hosts.deny hosts.equiv hosts.lpd netgroup networks protocols services.bz2 ethers; do install $RPM_SOURCE_DIR/$i $RPM_BUILD_ROOT/etc done bunzip2 $RPM_BUILD_ROOT/etc/services.bz2 @@ -90,7 +90,7 @@ exit 0 %files %defattr(644,root,root,755) -%verify(not md5 size mtime) %config(noreplace) /etc/HOSTNAME +%verify(not md5 size mtime) %config(noreplace) /etc/hostname %verify(not md5 size mtime) %config(noreplace) /etc/aliases %verify(not md5 size mtime) %config(noreplace) /etc/defaultdomain %verify(not md5 size mtime) %config(noreplace) /etc/ethers From 10c67627c8d9181420825760702e84b68c93bbe53e6dd7ad65bd61491c7cc913 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 9 Jun 2014 08:37:53 +0000 Subject: [PATCH 2/4] OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=21 --- netcfg.spec | 69 ++++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/netcfg.spec b/netcfg.spec index 8c59b55..08fbb03 100644 --- a/netcfg.spec +++ b/netcfg.spec @@ -17,14 +17,11 @@ Name: netcfg -PreReq: coreutils aaa_base +Version: 11.5 +Release: 0 Summary: Network Configuration Files in /etc License: BSD-3-Clause Group: System/Base -Version: 11.5 -Release: 0 -BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: defaultdomain Source1: exports Source2: ftpusers @@ -46,37 +43,42 @@ Source100: services-compare.pl Source101: services-compare.sh Source102: services-create.pl Source103: services_UPDATING -Patch: services-suse.diff +Patch0: services-suse.diff +# FIXME: use proper Requires(pre/post/preun/...) +PreReq: aaa_base +PreReq: coreutils +PreReq: permissions +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch %description All of the basic configuration files for the network programs including -/etc/aliases, /etc/protocols, and /etc/services. +%{_sysconfdir}/aliases, %{_sysconfdir}/protocols, and %{_sysconfdir}/services. These are often used by network routines in the C library and therefore must be installed for all network programs. - - %prep %build -cp %{S:16} . +cp %{SOURCE16} . %install -mkdir -p $RPM_BUILD_ROOT/etc +mkdir -p %{buildroot}/etc for i in hostname aliases defaultdomain exports ftpusers host.conf hosts hosts.allow hosts.deny hosts.equiv hosts.lpd netgroup networks protocols services.bz2 ethers; do - install $RPM_SOURCE_DIR/$i $RPM_BUILD_ROOT/etc + install $RPM_SOURCE_DIR/$i %{buildroot}/etc done -bunzip2 $RPM_BUILD_ROOT/etc/services.bz2 -patch -p0 $RPM_BUILD_ROOT/etc/services < $RPM_SOURCE_DIR/services-suse.diff -rm -f $RPM_BUILD_ROOT/etc/services.orig +bunzip2 %{buildroot}%{_sysconfdir}/services.bz2 +patch -p0 %{buildroot}%{_sysconfdir}/services < $RPM_SOURCE_DIR/services-suse.diff +rm -f %{buildroot}%{_sysconfdir}/services.orig +ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME %pre if [ "0$1" -ge "2" ]; then # If we have a /etc/netgroup.rpmsave and no /etc/netgroup, copy # /etc/netgroup.rpmsave and use it later instead of the new one. - if [ -f /etc/netgroup.rpmsave -a ! -e /etc/netgroup ]; then - cp /etc/netgroup.rpmsave /etc/...netgroup.new.rpmnew + if [ -f %{_sysconfdir}/netgroup.rpmsave -a ! -e %{_sysconfdir}/netgroup ]; then + cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/...netgroup.new.rpmnew fi fi @@ -90,22 +92,23 @@ exit 0 %files %defattr(644,root,root,755) -%verify(not md5 size mtime) %config(noreplace) /etc/hostname -%verify(not md5 size mtime) %config(noreplace) /etc/aliases -%verify(not md5 size mtime) %config(noreplace) /etc/defaultdomain -%verify(not md5 size mtime) %config(noreplace) /etc/ethers -%verify(not md5 size mtime) %config(noreplace) /etc/exports -%verify(not md5 size mtime) %config(noreplace) /etc/ftpusers -%config(noreplace) /etc/host.conf -%verify(not md5 size mtime) %config(noreplace) /etc/hosts -%verify(not md5 size mtime) %config(noreplace) /etc/hosts.allow -%verify(not md5 size mtime) %config(noreplace) /etc/hosts.deny -%verify(not md5 size mtime) %config(noreplace) /etc/hosts.equiv -%verify(not md5 size mtime) %config(noreplace) /etc/hosts.lpd -%config(noreplace) /etc/netgroup -%config(noreplace) /etc/networks -%config(noreplace) /etc/protocols -%config(noreplace) /etc/services +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hostname +/etc/HOSTNAME +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/aliases +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/defaultdomain +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ethers +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/exports +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ftpusers +%config(noreplace) %{_sysconfdir}/host.conf +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.allow +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.deny +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.equiv +%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hosts.lpd +%config(noreplace) %{_sysconfdir}/netgroup +%config(noreplace) %{_sysconfdir}/networks +%config(noreplace) %{_sysconfdir}/protocols +%config(noreplace) %{_sysconfdir}/services %doc COPYING %changelog From 2052abef7fd767dd737e96c7b83a5b84c9826b8c1dcd40ed4231ae8751db80d3 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 11 Jun 2014 09:24:00 +0000 Subject: [PATCH 3/4] - move /etc/HOSTNAME to /etc/hostname during update OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=22 --- netcfg.changes | 5 +++++ netcfg.spec | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/netcfg.changes b/netcfg.changes index b000d63..2b2b033 100644 --- a/netcfg.changes +++ b/netcfg.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 11 08:47:56 UTC 2014 - pgajdos@suse.com + +- move /etc/HOSTNAME to /etc/hostname during update + ------------------------------------------------------------------- Wed Jun 4 10:36:22 UTC 2014 - pgajdos@suse.com diff --git a/netcfg.spec b/netcfg.spec index 08fbb03..8f9b160 100644 --- a/netcfg.spec +++ b/netcfg.spec @@ -81,6 +81,21 @@ if [ "0$1" -ge "2" ]; then cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/...netgroup.new.rpmnew fi fi +#/etc/HOSTNAME renamed to /etc/hostname [bnc#858908] +#On Tue, Jun 10, 2014 at 03:23:00PM +0200, Frederic Crozat wrote: +#> So, it means netcfg should have a %pre which check if /etc/HOSTNAME is a +#> filename (and not a symlink) and in that case, rename the file +#> to /etc/hostname. This should ensure /etc/HOSTNAME is properly created +#> by RPM. +set -x +if [ "0$1" -ge "2" ]; then + if [ -f /etc/HOSTNAME -a ! -h /etc/HOSTNAME ]; then + if [ -f /etc/hostname ]; then + mv /etc/hostname /etc/hostname.rpmsave + fi + mv /etc/HOSTNAME /etc/hostname + fi +fi %post test -f etc/defaultdomain.rpmnew -a ! -s etc/defaultdomain.rpmnew && rm -f etc/defaultdomain.rpmnew From bd2f068dcb2d753b8c71e29a3e02ceae43fabe47a2d2b86959dae95853aebfa2 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 11 Jun 2014 09:30:50 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=23 --- netcfg.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/netcfg.spec b/netcfg.spec index 8f9b160..11af4e2 100644 --- a/netcfg.spec +++ b/netcfg.spec @@ -87,7 +87,6 @@ fi #> filename (and not a symlink) and in that case, rename the file #> to /etc/hostname. This should ensure /etc/HOSTNAME is properly created #> by RPM. -set -x if [ "0$1" -ge "2" ]; then if [ -f /etc/HOSTNAME -a ! -h /etc/HOSTNAME ]; then if [ -f /etc/hostname ]; then