a20b14
Summary: Utility to set/show the host name or domain name
a20b14
Name: hostname
a20b14
Version: 3.20
a20b14
Release: 6%{?dist}
a20b14
License: GPLv2+
a20b14
Group: System Environment/Base
a20b14
URL: http://packages.qa.debian.org/h/hostname.html
a20b14
Source0: http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_%{version}.tar.gz
a20b14
Source1: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
a20b14
Source2: nis-domainname
a20b14
Source3: nis-domainname.service
a20b14
BuildRequires: gcc
a20b14
a20b14
# NOTE: We are *not* requiring systemd on purpose, because we want to allow
a20b14
#       hostname package to be installed in containers without the systemd.
a20b14
a20b14
# Initial changes
a20b14
Patch1: hostname-rh.patch
a20b14
a20b14
%description
a20b14
This package provides commands which can be used to display the system's
a20b14
DNS name, and to display or set its hostname or NIS domain name.
a20b14
a20b14
%prep
a20b14
%setup -q -n hostname
a20b14
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .
a20b14
%patch1 -p1
a20b14
a20b14
%build
a20b14
make CFLAGS="%{optflags} $CFLAGS -D_GNU_SOURCE" LDFLAGS="$RPM_LD_FLAGS"
a20b14
a20b14
%install
a20b14
make BASEDIR=%{buildroot} BINDIR=%{_bindir} install
a20b14
a20b14
install -m 0755 -d %{buildroot}%{_libexecdir}/%{name}
a20b14
install -m 0755 -d %{buildroot}%{_prefix}/lib/systemd/system
a20b14
install -m 0755 nis-domainname         %{buildroot}%{_libexecdir}/%{name}
a20b14
install -m 0644 nis-domainname.service %{buildroot}%{_prefix}/lib/systemd/system
a20b14
a20b14
%post
a20b14
if [ $1 -eq 1 ]; then
a20b14
  # Initial installation...
a20b14
  systemctl --no-reload preset nis-domainname.service &>/dev/null || :
a20b14
fi
a20b14
a20b14
%preun
a20b14
if [ $1 -eq 0 ]; then
a20b14
  # Package removal, not upgrade...
a20b14
  systemctl --no-reload disable --now nis-domainname.service &>/dev/null || :
a20b14
fi
a20b14
a20b14
# NOTE: Nothing to do for upgrade (in postun), nis-domainname.service is oneshot.
a20b14
a20b14
%files
a20b14
%doc COPYRIGHT
a20b14
%{!?_licensedir:%global license %%doc}
a20b14
%license gpl-2.0.txt
a20b14
%{_bindir}/*
a20b14
%{_mandir}/man1/*
a20b14
%{_prefix}/lib/systemd/system/*
a20b14
%{_libexecdir}/%{name}/*
a20b14
a20b14
%changelog
a20b14
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.20-6
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a20b14
a20b14
* Thu May 31 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 3.20-5
a20b14
- nis-domainname.service moved here from initscripts package
a20b14
a20b14
* Wed Mar  7 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.20-4
a20b14
- Add gcc to BuildRequires
a20b14
a20b14
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.20-3
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a20b14
a20b14
* Thu Feb  1 2018 Florian Weimer <fweimer@redhat.com> - 3.20-2
a20b14
- Build with linker flags from redhat-rpm-config
a20b14
a20b14
* Thu Feb  1 2018 Pavel Zhukov <pzhukov@redhat.com> - 3.20-1
a20b14
- New version 3.20
a20b14
a20b14
* Wed Jan 31 2018 Pavel Zhukov <landgraf@fedoraproject.org> - 3.19-2
a20b14
- New version 3.19
a20b14
a20b14
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.18-4
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
a20b14
a20b14
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.18-3
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a20b14
a20b14
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.18-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a20b14
a20b14
* Wed Aug 10 2016 Pavel Šimerda <psimerda@redhat.com> - 3.18-1
a20b14
- New version 3.18
a20b14
a20b14
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.15-7
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a20b14
a20b14
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.15-6
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a20b14
a20b14
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 3.15-5
a20b14
- Rebuilt for Fedora 23 Change
a20b14
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
a20b14
a20b14
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.15-4
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
a20b14
a20b14
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 3.15-3
a20b14
- fix license handling
a20b14
a20b14
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.15-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a20b14
a20b14
* Mon Nov 04 2013 Jiri Popelka <jpopelka@redhat.com> - 3.15-1
a20b14
- 3.15
a20b14
a20b14
* Wed Oct 16 2013 Jiri Popelka <jpopelka@redhat.com> - 3.14-3
a20b14
- use BINDIR
a20b14
a20b14
* Mon Oct 14 2013 Jaromír Končický <jkoncick@redhat.com> - 3.14-2
a20b14
- Install binaries into /usr/bin
a20b14
a20b14
* Sun Sep 08 2013 Jiri Popelka <jpopelka@redhat.com> - 3.14-1
a20b14
- 3.14
a20b14
a20b14
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.13-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a20b14
a20b14
* Tue Jun 18 2013 Jiri Popelka <jpopelka@redhat.com> - 3.13-1
a20b14
- 3.13: -v references removed upstream
a20b14
a20b14
* Tue Mar 26 2013 Jiri Popelka <jpopelka@redhat.com> - 3.12-4
a20b14
- remove void -v option from --help
a20b14
a20b14
* Fri Mar 08 2013 Jiri Popelka <jpopelka@redhat.com> - 3.12-3
a20b14
- do not ship outdated french man pages (#919198)
a20b14
a20b14
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.12-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a20b14
a20b14
* Fri Dec 07 2012  Jiri Popelka <jpopelka@redhat.com> - 3.12-1
a20b14
- 3.12: man page improvements
a20b14
a20b14
* Fri Nov 30 2012  Jiri Popelka <jpopelka@redhat.com> - 3.11-4
a20b14
- revert /usr move for now
a20b14
a20b14
* Fri Nov 30 2012  Jiri Popelka <jpopelka@redhat.com> - 3.11-3
a20b14
- remove some rh-specific bits from rh.patch as they are no longer valid (#881913)
a20b14
- remove outdated de & pt man pages
a20b14
- /usr move: use _bindir macro
a20b14
a20b14
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
a20b14
a20b14
* Tue Feb 21 2012  Jiri Popelka <jpopelka@redhat.com> - 3.11-1
a20b14
- 3.11
a20b14
a20b14
* Wed Jan 18 2012  Jiri Popelka <jpopelka@redhat.com> - 3.10-1
a20b14
- 3.10
a20b14
a20b14
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.09-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
a20b14
a20b14
* Thu Dec 29 2011  Jiri Popelka <jpopelka@redhat.com> - 3.09-1
a20b14
- 3.09
a20b14
a20b14
* Sat Dec 24 2011  Jiri Popelka <jpopelka@redhat.com> - 3.08-1
a20b14
- 3.08
a20b14
a20b14
* Fri Dec 23 2011  Jiri Popelka <jpopelka@redhat.com> - 3.07-1
a20b14
- 3.07
a20b14
a20b14
* Mon Mar 07 2011  Jiri Popelka <jpopelka@redhat.com> - 3.06-1
a20b14
- 3.06
a20b14
a20b14
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.05-2
a20b14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a20b14
a20b14
* Tue Nov 16 2010  Jiri Popelka <jpopelka@redhat.com> - 3.05-1
a20b14
- 3.05
a20b14
a20b14
* Fri Apr 30 2010 Ville Skyttä <ville.skytta@iki.fi> - 3.04-2
a20b14
- Mark localized man pages with %%lang.
a20b14
a20b14
* Thu Mar 25 2010  Jiri Popelka <jpopelka@redhat.com> - 3.04-1
a20b14
- 3.04
a20b14
a20b14
* Tue Feb 02 2010  Jiri Popelka <jpopelka@redhat.com> - 3.03-1
a20b14
- 3.03
a20b14
a20b14
* Tue Nov 10 2009  Jiri Popelka <jpopelka@redhat.com> - 3.01-1
a20b14
- Initial package. Up to now hostname has been part of net-tools package.
a20b14
- This package is based on Debian's hostname because Debian has had hostname
a20b14
  as separate package since 1997 and the code is much better then the old one
a20b14
  contained in net-tools.