OBJS=hostname.o
hostname: $(OBJS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
- ln -fs hostname dnsdomainname
- ln -fs hostname domainname
- ln -fs hostname ypdomainname
- ln -fs hostname nisdomainname
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl
install: hostname
install -d ${BASEDIR}$(MANDIR)/man1
- install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
+ install -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1
install -d ${BASEDIR}$(BINDIR)
- install -o root -g root -m 0755 hostname ${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
--- /dev/null
+Name: hostname
+Version: 3.20
+Release: 0
+License: GPL-2.0+
+Summary: Utility to set/show the host name or domain name
+Url: http://packages.qa.debian.org/h/hostname.html
+Group: System/Base
+Source0: http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_%{version}.tar.gz
+Source1001: hostname.manifest
+
+%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 hostname
+cp %{SOURCE1001} .
+
+%build
+make CFLAGS="%{optflags} $CFLAGS -D_GNU_SOURCE "
+
+%install
+make BASEDIR=%{buildroot} install
+
+%remove_docs
+
+%files
+%manifest %{name}.manifest
+%license COPYRIGHT
+/bin/*