Sync from SUSE:SLFO:Main hostname revision 37fa8e6c98c62279be00111ee55348d2

This commit is contained in:
Adrian Schröter 2024-05-03 13:35:29 +02:00
commit c90684a544
6 changed files with 241 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
hostname-3.23.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

97
hostname.changes Normal file
View File

@ -0,0 +1,97 @@
-------------------------------------------------------------------
Tue Dec 27 12:26:47 UTC 2022 - Ludwig Nussel <lnussel@suse.com>
- Replace transitional %usrmerged macro with regular version check (boo#1206798)
-------------------------------------------------------------------
Mon Oct 19 16:04:14 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
- prepare usrmerge (boo#1029961)
-------------------------------------------------------------------
Wed Aug 26 07:43:53 UTC 2020 - Dirk Mueller <dmueller@suse.com>
- update to 3.23:
* Increase buffer size for all FQDNs to NI_MAXHOST as suggested by manpage.
(Closes: #942311)
* Use the same size for getdomainname().
* Bumped Standards-Version, no changes needed.
-------------------------------------------------------------------
Fri May 15 13:30:45 UTC 2020 - Neal Gompa <ngompa13@gmail.com>
- Fix LIBEXECDIR substitution for systemd service
-------------------------------------------------------------------
Sun Apr 12 14:06:27 UTC 2020 - Neal Gompa <ngompa13@gmail.com>
- Add nis-domainname.service for FreeIPA
-------------------------------------------------------------------
Thu Oct 18 03:10:44 UTC 2018 - sean@suspend.net
- Update to 3.21:
* Minor fixes to the manpage
-------------------------------------------------------------------
Mon Mar 26 17:24:51 CEST 2018 - kukuk@suse.de
- Use %license instead of %doc [bsc#1082318]
-------------------------------------------------------------------
Sun Feb 18 21:23:47 UTC 2018 - avindra@opensuse.org
- Update to 3.20
* debian-specific change only
- includes 3.19
* Fix lintian warnings.
- includes 3.18
* Make sure memory is initialized to zero before attempting to
read hostname.
- includes 3.17
* Use _GNU_SOURCE feature test macro, instead of glibc internal
__USE_GNU.
* Use getdomainname instead of yp_get_default_domain because it
is more widely available and avoids the -lnsl dependency.
* localnisdomain is kept, even though it should be the same as
localdomain, so the behaviour is not changed in case of an error.
* Replace 'dh-clean -k' with 'dh-prep'
- cleanup with spec-cleaner
-------------------------------------------------------------------
Tue Aug 15 21:55:30 CEST 2017 - kukuk@suse.de
- Add build require libnsl-devel in preparation of libnsl removal
from glibc.
-------------------------------------------------------------------
Thu Mar 31 14:25:58 CEST 2016 - kukuk@suse.de
- Add ypdomainname and nisdomainname, too. Were removed from yp-tools.
-------------------------------------------------------------------
Tue Sep 8 12:32:33 UTC 2015 - nemysis@openSUSE.org
- Update to 3.16, announce message:
* Changed buffer size to the recommended 255 character when working with
names instead of IPs. (Closes: #796922)
* Bumped Standards-Version to 3.9.6, no changes needed.
- Use %{name} instead of hostname
- Use CFLAGS="%{optflags}" to fix 'File is compiled without RPM_OPT_FLAGS'
- Add changelog to Documentation
-------------------------------------------------------------------
Thu Jun 11 07:31:16 UTC 2015 - dimstar@opensuse.org
- BuildIgnore hostname (ourselves): net-tools has a dependency on
hostname, and net-tools is part of the VMInstall package set. As
we know we do not rely on our own code to build, we can safely
ignore hostname and break that nasty buildcycle.
-------------------------------------------------------------------
Wed Jun 10 08:39:32 UTC 2015 - gber@opensuse.org
- initial packaging

94
hostname.spec Normal file
View File

@ -0,0 +1,94 @@
#
# spec file for package hostname
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: hostname
Version: 3.23
Release: 0
Summary: Utility to Set/Show the Host Name or Domain Name
License: GPL-2.0-or-later
Group: Productivity/Networking/Other
URL: https://tracker.debian.org/pkg/hostname
Source0: http://http.debian.net/debian/pool/main/h/%{name}/%{name}_%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: nis-domainname
Source2: nis-domainname.service.in
BuildRequires: gcc
BuildRequires: systemd-rpm-macros
# net-tools requires hostname, but we know we do not rely on ourselves to build
#!BuildIgnore: hostname
%description
This package provides commands which can be used to display the system's DNS
name, and to display or set its hostname or NIS domain name.
%prep
%setup -q -n %{name}
cp %{SOURCE1} %{SOURCE2} .
%build
make %{?_smp_mflags} CFLAGS="%{optflags} -D_GNU_SOURCE"
%install
install -D -p -m 755 %{name} %{buildroot}%{_bindir}/%{name}
%if 0%{?suse_version} < 1550
install -d -m 755 %{buildroot}/bin/
ln -sf %{_bindir}/%{name} %{buildroot}/bin/%{name}
%endif
install -D -p -m 644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
for prog in dnsdomainname domainname ypdomainname nisdomainname; do
%if 0%{?suse_version} < 1550
ln -sf %{_bindir}/%{name} %{buildroot}/bin/$prog
%endif
ln -sf %{_bindir}/%{name} %{buildroot}%{_bindir}/$prog
ln -sf hostname.1 %{buildroot}%{_mandir}/man1/${prog}.1
done
sed -e "s|@LIBEXECDIR@|%{_libexecdir}|g" nis-domainname.service.in > nis-domainname.service
install -m 0755 -d %{buildroot}%{_libexecdir}/%{name}
install -m 0755 -d %{buildroot}%{_unitdir}
install -p -m 0755 nis-domainname %{buildroot}%{_libexecdir}/%{name}
install -p -m 0644 nis-domainname.service %{buildroot}%{_unitdir}
%post
%systemd_post nis-domainname.service
%preun
%systemd_preun nis-domainname.service
%files
%license COPYRIGHT
%doc debian/changelog
%if 0%{?suse_version} < 1550
/bin/%{name}
/bin/domainname
/bin/dnsdomainname
/bin/nisdomainname
/bin/ypdomainname
%endif
%{_bindir}/%{name}
%{_bindir}/domainname
%{_bindir}/dnsdomainname
%{_bindir}/nisdomainname
%{_bindir}/ypdomainname
%{_mandir}/man1/%{name}.1%{ext_man}
%{_mandir}/man1/domainname.1%{ext_man}
%{_mandir}/man1/dnsdomainname.1%{ext_man}
%{_mandir}/man1/nisdomainname.1%{ext_man}
%{_mandir}/man1/ypdomainname.1%{ext_man}
%{_unitdir}/nis-domainname.service
%{_libexecdir}/%{name}/
%changelog

10
nis-domainname Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
source /etc/sysconfig/network/config
if [ -n "${NETCONFIG_NIS_STATIC_DOMAIN}" ] && [ "${NETCONFIG_NIS_SETDOMAINNAME}" = "yes" ] && [ -x /usr/bin/nisdomainname ]; then
nisdomainname ${NETCONFIG_NIS_STATIC_DOMAIN}
exit $?
fi
exit 0

14
nis-domainname.service.in Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Read and set NIS domainname from /etc/sysconfig/network/config
Before=ypbind.service yppasswdd.service ypserv.service ypxfrd.service sysinit.target
DefaultDependencies=no
Conflicts=shutdown.target
ConditionPathExists=/etc/sysconfig/network/config
[Service]
ExecStart=@LIBEXECDIR@/hostname/nis-domainname
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target