From 91839366de2708754884ebd784365a7315c4ed18 Mon Sep 17 00:00:00 2001 From: zyppe <210hcl@gmail.com> Date: Fri, 9 Feb 2024 17:21:52 +0800 Subject: [PATCH] Initialize for hostname --- .gitignore | 1 + .hostname.metadata | 1 + hostname.changes | 20 +++++++++++++++ hostname.spec | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 .gitignore create mode 100644 .hostname.metadata create mode 100644 hostname.changes create mode 100644 hostname.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c7cfe5d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hostname_3.16.tar.gz diff --git a/.hostname.metadata b/.hostname.metadata new file mode 100644 index 0000000..1dddd04 --- /dev/null +++ b/.hostname.metadata @@ -0,0 +1 @@ +ef3a30f46c4f7f20ce4abb92940cb78fae4eedecdcd8c9a1a2248606870e9583 hostname_3.16.tar.gz diff --git a/hostname.changes b/hostname.changes new file mode 100644 index 0000000..17d0f60 --- /dev/null +++ b/hostname.changes @@ -0,0 +1,20 @@ +* 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 diff --git a/hostname.spec b/hostname.spec new file mode 100644 index 0000000..6f21267 --- /dev/null +++ b/hostname.spec @@ -0,0 +1,61 @@ +# +# spec file for package hostname +# +# Copyright (c) 2022-2023 ZhuningOS +# + + +Name: hostname +Version: 3.16 +Release: 2.22 +Summary: Utility to Set/Show the Host Name or Domain Name +License: GPL-2.0+ +Group: Productivity/Networking/Other +Url: https://tracker.debian.org/pkg/hostname +Source: http://http.debian.net/debian/pool/main/h/%{name}/%{name}_%{version}.tar.gz +# net-tools requires hostname, but we know we do not rely on ourselves to build +#!BuildIgnore: hostname +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: libnsl-devel + +%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 + +%build +make %{?_smp_mflags} CFLAGS="%{optflags}" + +%install +install -D -p -m 755 %{name} %{buildroot}%{_bindir}/%{name} +install -d -m 755 %{buildroot}/bin/ +ln -sf %{_bindir}/%{name} %{buildroot}/bin/%{name} +install -D -p -m 644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 +for prog in dnsdomainname domainname ypdomainname nisdomainname; do + ln -sf %{_bindir}/%{name} %{buildroot}/bin/$prog + ln -sf %{_bindir}/%{name} %{buildroot}%{_bindir}/$prog + ln -sf hostname.1 %{buildroot}%{_mandir}/man1/${prog}.1 +done + +%files +%defattr(-,root,root) +%doc COPYRIGHT debian/changelog +/bin/%{name} +/bin/domainname +/bin/dnsdomainname +/bin/nisdomainname +/bin/ypdomainname +%{_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} + +%changelog