hostname/hostname.spec

53 lines
1.5 KiB
RPMSpec
Raw Normal View History

2019-09-30 10:52:45 -04:00
Summary: Utility to set/show the host name or domain name
Name: hostname
Version: 3.20
Release: 7
License: GPLv2+
URL: http://packages.qa.debian.org/h/hostname.html
Source0: http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_%{version}.tar.gz
Source1: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
Source2: nis-domainname
Source3: nis-domainname.service
Patch1: hostname-rh.patch
%description
This package provides funcions to display or set system's hostname or NIS domain
name, and displays its DNS name as well.
%prep
%autosetup -n %{name} -p1
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .
%build
%make_build CFLAGS="%{optflags} $CFLAGS -D_GNU_SOURCE" LDFLAGS="$RPM_LD_FLAGS"
%install
make BASEDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} install
install -m 0755 -d $RPM_BUILD_ROOT%{_libexecdir}/%{name}
install -m 0755 -d $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system
install -m 0755 nis-domainname $RPM_BUILD_ROOT%{_libexecdir}/%{name}
install -m 0644 nis-domainname.service $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system
%preun
if [ $1 -eq 0 ]; then
systemctl --no-reload disable --now nis-domainname.service &>/dev/null || :
fi
%post
if [ $1 -eq 1 ]; then
systemctl --no-reload preset nis-domainname.service &>/dev/null || :
fi
%files
%doc COPYRIGHT
%{!?_licensedir:%global license %%doc}
%license gpl-2.0.txt
%{_bindir}/*
%{_mandir}/man1/*
%{_prefix}/lib/systemd/system/*
%{_libexecdir}/%{name}/*
%changelog
* Fri Sep 20 2019 Alex Chao <zhaolei746@huawei.com> - 3.20-7
- Package init