# # spec file for package hostname # # Copyright (c) 2024 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.25 Release: 1.2 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.xz#/%{name}-%{version}.tar.xz 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 * Wed Dec 4 2024 ming li - update to 3.25: * Removed old rule that moved file from /usr/bin to /bin. (Closes: #1056978) hostname 3.24: [ Gioele Barabucci ] * d/control: Add VCS URLs (Closes: #1050091) * Makefile: Adopt GNU/debhelper conventions * d/rules: Simplify using debhelper 13 (Closes: #1050093) * d/rules: Extract program version using sed * d/control: Update standards version to 4.6.2, no changes needed * d/control: Specify Rules-Requires-Root: no [ binlingyu ] * Fix memory leak [ lingyu bin ] * Update .gitlab-ci.yml file [ Michael Meskes ] * Fixed VCS information * Enable build with ubuntu suffixes. Thanks to Matthias Klose (Closes: #995889) * Update standards version to 4.7.0, no changes needed * Release 3.24 hostname 3.23+nmu1: * Non-maintainer upload. * Convert d/copyright to machine-readable format. (Closes: #1013131) * Upgrade to 3.0 source format. (Closes: #1007059) * Tue Dec 27 2022 Ludwig Nussel - Replace transitional %%usrmerged macro with regular version check (boo#1206798) * Mon Oct 19 2020 Ludwig Nussel - prepare usrmerge (boo#1029961) * Wed Aug 26 2020 Dirk Mueller - 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 2020 Neal Gompa - Fix LIBEXECDIR substitution for systemd service * Sun Apr 12 2020 Neal Gompa - Add nis-domainname.service for FreeIPA * Thu Oct 18 2018 sean@suspend.net - Update to 3.21: * Minor fixes to the manpage * Mon Mar 26 2018 kukuk@suse.de - Use %%license instead of %%doc [bsc#1082318] * Sun Feb 18 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 2017 kukuk@suse.de - Add build require libnsl-devel in preparation of libnsl removal from glibc. * Thu Mar 31 2016 kukuk@suse.de - Add ypdomainname and nisdomainname, too. Were removed from yp-tools. * Tue Sep 8 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 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 2015 gber@opensuse.org - initial packaging