diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index d192750..a5e85fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,2 @@ -hostname_3.04.tar.gz -/hostname_3.05.tar.gz -/hostname_3.06.tar.gz -/hostname_3.07.tar.gz -/hostname_3.08.tar.gz -/hostname_3.09.tar.gz -/hostname_3.10.tar.gz -/hostname_3.11.tar.gz -/hostname_3.12.tar.gz -/hostname_3.13.tar.gz -/hostname_3.14.tar.gz +/gpl-2.0.txt +/hostname_*.tar.xz diff --git a/changelog b/changelog new file mode 100644 index 0000000..599e045 --- /dev/null +++ b/changelog @@ -0,0 +1,185 @@ +* Thu Jul 18 2024 Fedora Release Engineering - 3.23-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jan 24 2024 Fedora Release Engineering - 3.23-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering - 3.23-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Oct 02 2023 Martin Osvald - 3.23-10 +- SPDX migration + +* Thu Jul 20 2023 Fedora Release Engineering - 3.23-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 3.23-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 3.23-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 3.23-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 3.23-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 3.23-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 3.23-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 3.23-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Nov 14 2019 Pavel Zhukov - 3.23-1 +- New version 3.23 (#1771102) + +* Fri Aug 30 2019 Pavel Zhukov - 3.22-1 +- New release v3.22 (#1747011) + +* Thu Jul 25 2019 Fedora Release Engineering - 3.20-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Apr 3 2019 Pavel Zhukov - 3.20-7 +- Own whole libexec/hostname directory (#1695488) + +* Fri Feb 01 2019 Fedora Release Engineering - 3.20-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 3.20-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu May 31 2018 David Kaspar [Dee'Kej] - 3.20-5 +- nis-domainname.service moved here from initscripts package + +* Wed Mar 7 2018 Pavel Zhukov - 3.20-4 +- Add gcc to BuildRequires + +* Wed Feb 07 2018 Fedora Release Engineering - 3.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Feb 1 2018 Florian Weimer - 3.20-2 +- Build with linker flags from redhat-rpm-config + +* Thu Feb 1 2018 Pavel Zhukov - 3.20-1 +- New version 3.20 + +* Wed Jan 31 2018 Pavel Zhukov - 3.19-2 +- New version 3.19 + +* Wed Aug 02 2017 Fedora Release Engineering - 3.18-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 3.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 3.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Aug 10 2016 Pavel Šimerda - 3.18-1 +- New version 3.18 + +* Wed Feb 03 2016 Fedora Release Engineering - 3.15-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 3.15-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Feb 21 2015 Till Maas - 3.15-5 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sat Aug 16 2014 Fedora Release Engineering - 3.15-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway - 3.15-3 +- fix license handling + +* Sat Jun 07 2014 Fedora Release Engineering - 3.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Nov 04 2013 Jiri Popelka - 3.15-1 +- 3.15 + +* Wed Oct 16 2013 Jiri Popelka - 3.14-3 +- use BINDIR + +* Mon Oct 14 2013 Jaromír Končický - 3.14-2 +- Install binaries into /usr/bin + +* Sun Sep 08 2013 Jiri Popelka - 3.14-1 +- 3.14 + +* Sat Aug 03 2013 Fedora Release Engineering - 3.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jun 18 2013 Jiri Popelka - 3.13-1 +- 3.13: -v references removed upstream + +* Tue Mar 26 2013 Jiri Popelka - 3.12-4 +- remove void -v option from --help + +* Fri Mar 08 2013 Jiri Popelka - 3.12-3 +- do not ship outdated french man pages (#919198) + +* Thu Feb 14 2013 Fedora Release Engineering - 3.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Dec 07 2012 Jiri Popelka - 3.12-1 +- 3.12: man page improvements + +* Fri Nov 30 2012 Jiri Popelka - 3.11-4 +- revert /usr move for now + +* Fri Nov 30 2012 Jiri Popelka - 3.11-3 +- remove some rh-specific bits from rh.patch as they are no longer valid (#881913) +- remove outdated de & pt man pages +- /usr move: use _bindir macro + +* Thu Jul 19 2012 Fedora Release Engineering - 3.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Feb 21 2012 Jiri Popelka - 3.11-1 +- 3.11 + +* Wed Jan 18 2012 Jiri Popelka - 3.10-1 +- 3.10 + +* Fri Jan 13 2012 Fedora Release Engineering - 3.09-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Dec 29 2011 Jiri Popelka - 3.09-1 +- 3.09 + +* Sat Dec 24 2011 Jiri Popelka - 3.08-1 +- 3.08 + +* Fri Dec 23 2011 Jiri Popelka - 3.07-1 +- 3.07 + +* Mon Mar 07 2011 Jiri Popelka - 3.06-1 +- 3.06 + +* Wed Feb 09 2011 Fedora Release Engineering - 3.05-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Nov 16 2010 Jiri Popelka - 3.05-1 +- 3.05 + +* Fri Apr 30 2010 Ville Skyttä - 3.04-2 +- Mark localized man pages with %%lang. + +* Thu Mar 25 2010 Jiri Popelka - 3.04-1 +- 3.04 + +* Tue Feb 02 2010 Jiri Popelka - 3.03-1 +- 3.03 + +* Tue Nov 10 2009 Jiri Popelka - 3.01-1 +- Initial package. Up to now hostname has been part of net-tools package. +- This package is based on Debian's hostname because Debian has had hostname + as separate package since 1997 and the code is much better then the old one + contained in net-tools. diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..ce1b655 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,16 @@ +--- !Policy +product_versions: + - fedora-* +decision_contexts: [bodhi_update_push_testing] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + +#gating rawhide +--- !Policy +product_versions: + - fedora-* +decision_contexts: [bodhi_update_push_stable] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/hostname-rh.patch b/hostname-rh.patch index 979fbe8..2d1d151 100644 --- a/hostname-rh.patch +++ b/hostname-rh.patch @@ -1,8 +1,9 @@ -diff -up hostname/hostname.1.rh hostname/hostname.1 ---- hostname/hostname.1.rh 2013-09-06 12:04:07.000000000 +0200 -+++ hostname/hostname.1 2013-09-08 19:59:45.343534437 +0200 -@@ -80,6 +80,28 @@ complete FQDN of the system is returned - .B "THE FQDN" +diff --git a/hostname.1 b/hostname.1 +index 74dd306..02eefa7 100644 +--- a/hostname.1 ++++ b/hostname.1 +@@ -80,6 +80,28 @@ complete FQDN of the system is returned with + .B THE FQDN below). +.LP @@ -17,7 +18,7 @@ diff -up hostname/hostname.1.rh hostname/hostname.1 +and +.BR gethostbyname(3) +is that -+.BR gethostbyname(3) ++.BR gethostbyname(5) +is network aware, so it consults +.IR /etc/nsswitch.conf +and @@ -31,7 +32,7 @@ diff -up hostname/hostname.1.rh hostname/hostname.1 When called with one argument or with the .B \-\-file @@ -105,8 +127,7 @@ command (see - .B "THE FQDN" + .B THE FQDN below). .LP -The host name is usually set once at system startup in @@ -40,46 +41,3 @@ diff -up hostname/hostname.1.rh hostname/hostname.1 (normally by reading the contents of a file which contains the host name, e.g. .IR /etc/hostname ). -diff -up hostname/Makefile.rh hostname/Makefile ---- hostname/Makefile.rh 2013-09-08 19:59:45.343534437 +0200 -+++ hostname/Makefile 2013-09-08 20:05:50.763966053 +0200 -@@ -3,30 +3,28 @@ CFLAGS+=-O2 -Wall - # uncomment the following line if you want to install to a different base dir. - #BASEDIR=/mnt/test - -+BINDIR:=/bin -+ - OBJS=hostname.o - - hostname: $(OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl -- ln -fs hostname dnsdomainname -- ln -fs hostname domainname -- ln -fs hostname ypdomainname -- ln -fs hostname nisdomainname - - install: hostname - install -d ${BASEDIR}/usr/share/man/man1 -- install -o root -g root -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1 -+ install -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/dnsdomainname.1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/domainname.1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/ypdomainname.1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/nisdomainname.1 - #install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1 - -- install -d ${BASEDIR}/bin -- install -o root -g root -m 0755 hostname ${BASEDIR}/bin -- ln -fs hostname ${BASEDIR}/bin/dnsdomainname -- ln -fs hostname ${BASEDIR}/bin/domainname -- ln -fs hostname ${BASEDIR}/bin/nisdomainname -- ln -fs hostname ${BASEDIR}/bin/ypdomainname -+ install -d ${BASEDIR}$(BINDIR) -+ install -m 0755 hostname ${BASEDIR}$(BINDIR) -+ ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname -+ ln -fs hostname ${BASEDIR}$(BINDIR)/domainname -+ ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname -+ ln -fs hostname ${BASEDIR}$(BINDIR)/ypdomainname - - clean: - -rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname diff --git a/hostname.spec b/hostname.spec index 98baf4a..4ad0e49 100644 --- a/hostname.spec +++ b/hostname.spec @@ -1,11 +1,18 @@ Summary: Utility to set/show the host name or domain name Name: hostname -Version: 3.14 -Release: 1%{?dist} -License: GPLv2+ -Group: System Environment/Base -URL: http://packages.qa.debian.org/h/hostname.html -Source0: http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_%{version}.tar.gz +Version: 3.25 +Release: %autorelease +License: GPL-2.0-or-later +URL: https://tracker.debian.org/pkg/hostname +Source0: https://ftp.debian.org/debian/pool/main/h/hostname/hostname_%{version}.tar.xz +Source1: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt +Source2: nis-domainname +Source3: nis-domainname.service +BuildRequires: gcc +BuildRequires: make + +# NOTE: We are *not* requiring systemd on purpose, because we want to allow +# hostname package to be installed in containers without the systemd. # Initial changes Patch1: hostname-rh.patch @@ -16,90 +23,42 @@ DNS name, and to display or set its hostname or NIS domain name. %prep %setup -q -n hostname -%patch1 -p1 -b .rh +cp %{SOURCE1} %{SOURCE2} %{SOURCE3} . +%patch -P 1 -p1 %build -make CFLAGS="$RPM_OPT_FLAGS $CFLAGS" +make CFLAGS="%{optflags} $CFLAGS -D_GNU_SOURCE" LDFLAGS="$RPM_LD_FLAGS" %install -make BASEDIR=%{buildroot} install +make DESTDIR=%{buildroot} install + +install -m 0755 -d %{buildroot}%{_libexecdir}/%{name} +install -m 0755 -d %{buildroot}%{_prefix}/lib/systemd/system +install -m 0755 nis-domainname %{buildroot}%{_libexecdir}/%{name} +install -m 0644 nis-domainname.service %{buildroot}%{_prefix}/lib/systemd/system + +%post +if [ $1 -eq 1 ]; then + # Initial installation... + systemctl --no-reload preset nis-domainname.service &>/dev/null || : +fi + +%preun +if [ $1 -eq 0 ]; then + # Package removal, not upgrade... + systemctl --no-reload disable --now nis-domainname.service &>/dev/null || : +fi + +# NOTE: Nothing to do for upgrade (in postun), nis-domainname.service is oneshot. %files %doc COPYRIGHT -/bin/* +%{!?_licensedir:%global license %%doc} +%license gpl-2.0.txt +%{_bindir}/* %{_mandir}/man1/* +%{_prefix}/lib/systemd/system/* +%{_libexecdir}/%{name} %changelog -* Sun Sep 08 2013 Jiri Popelka - 3.14-1 -- 3.14 - -* Sat Aug 03 2013 Fedora Release Engineering - 3.13-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Tue Jun 18 2013 Jiri Popelka - 3.13-1 -- 3.13: -v references removed upstream - -* Tue Mar 26 2013 Jiri Popelka - 3.12-4 -- remove void -v option from --help - -* Fri Mar 08 2013 Jiri Popelka - 3.12-3 -- do not ship outdated french man pages (#919198) - -* Thu Feb 14 2013 Fedora Release Engineering - 3.12-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Fri Dec 07 2012 Jiri Popelka - 3.12-1 -- 3.12: man page improvements - -* Fri Nov 30 2012 Jiri Popelka - 3.11-4 -- revert /usr move for now - -* Fri Nov 30 2012 Jiri Popelka - 3.11-3 -- remove some rh-specific bits from rh.patch as they are no longer valid (#881913) -- remove outdated de & pt man pages -- /usr move: use _bindir macro - -* Thu Jul 19 2012 Fedora Release Engineering - 3.11-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Tue Feb 21 2012 Jiri Popelka - 3.11-1 -- 3.11 - -* Wed Jan 18 2012 Jiri Popelka - 3.10-1 -- 3.10 - -* Fri Jan 13 2012 Fedora Release Engineering - 3.09-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Thu Dec 29 2011 Jiri Popelka - 3.09-1 -- 3.09 - -* Sat Dec 24 2011 Jiri Popelka - 3.08-1 -- 3.08 - -* Fri Dec 23 2011 Jiri Popelka - 3.07-1 -- 3.07 - -* Mon Mar 07 2011 Jiri Popelka - 3.06-1 -- 3.06 - -* Wed Feb 09 2011 Fedora Release Engineering - 3.05-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Tue Nov 16 2010 Jiri Popelka - 3.05-1 -- 3.05 - -* Fri Apr 30 2010 Ville Skyttä - 3.04-2 -- Mark localized man pages with %%lang. - -* Thu Mar 25 2010 Jiri Popelka - 3.04-1 -- 3.04 - -* Tue Feb 02 2010 Jiri Popelka - 3.03-1 -- 3.03 - -* Tue Nov 10 2009 Jiri Popelka - 3.01-1 -- Initial package. Up to now hostname has been part of net-tools package. -- This package is based on Debian's hostname because Debian has had hostname - as separate package since 1997 and the code is much better then the old one - contained in net-tools. +%autochangelog diff --git a/nis-domainname b/nis-domainname new file mode 100755 index 0000000..b8d1059 --- /dev/null +++ b/nis-domainname @@ -0,0 +1,10 @@ +#!/usr/bin/bash + +source /etc/sysconfig/network + +if [ -n "${NISDOMAIN}" ] && [ -x /usr/bin/nisdomainname ]; then + nisdomainname ${NISDOMAIN} + exit $? +fi + +exit 0 diff --git a/nis-domainname.service b/nis-domainname.service new file mode 100644 index 0000000..9c92742 --- /dev/null +++ b/nis-domainname.service @@ -0,0 +1,14 @@ +[Unit] +Description=Read and set NIS domainname from /etc/sysconfig/network +Before=ypbind.service yppasswdd.service ypserv.service ypxfrd.service sysinit.target +DefaultDependencies=no +Conflicts=shutdown.target +ConditionPathExists=/etc/sysconfig/network + +[Service] +ExecStart=/usr/libexec/hostname/nis-domainname +Type=oneshot +RemainAfterExit=yes + +[Install] +WantedBy=sysinit.target diff --git a/plans/all.fmf b/plans/all.fmf new file mode 100644 index 0000000..bab1e43 --- /dev/null +++ b/plans/all.fmf @@ -0,0 +1,6 @@ +summary: Test plan with all Fedora tests +discover: + how: fmf + url: https://src.fedoraproject.org/tests/hostname.git +execute: + how: tmt diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..0e7f58d --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,6 @@ +--- +badfuncs: + allowed: + # hostname uses gethostbyname (safely) to display alias name(s). + /usr/bin/hostname: + - gethostbyname diff --git a/sources b/sources index b7d0b69..2726704 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -4674720aeed0326a53ca397a664f69c4 hostname_3.14.tar.gz +SHA512 (hostname_3.25.tar.xz) = 57b8e741cd3d895112d93ca8a7cbec95f3ad1a90c5691377ab8b242906bdcb932fa3401159432ec86f24bbbfe24c078832792c70e62e8d65a2317ee05a5efc64 +SHA512 (gpl-2.0.txt) = aee80b1f9f7f4a8a00dcf6e6ce6c41988dcaedc4de19d9d04460cbfb05d99829ffe8f9d038468eabbfba4d65b38e8dbef5ecf5eb8a1b891d9839cda6c48ee957