Summary(pl): Demon arpd
Name: arpd
Version: 1.0.2
-Release: 1
+Release: 5
License: GPL
-Group: Applications/Networking
-Group(pl): Aplikacje/Sieciowe
-Group(de): Applikationen/Netzwerkwesen
+Group: Daemons
+Group(de): Server
+Group(pl): Serwery
Source0: %{name}-%{version}.tar.gz
Source1: %{name}-init
Patch0: %{name}-%{version}.debian-patch
Patch1: %{name}-%{version}.pld-patch
Patch2: %{name}-makefile-patch
+Patch3: %{name}-more_tables.patch
+Patch4: %{name}-uid.patch
Prereq: /sbin/chkconfig
Prereq: rc-scripts >= 0.2.0
Prereq: fileutils
-#BuildRequires:
-BuildRoot: %{tmpdir}/%{name}-%{version}.orig
+Requires: dev >= 2.8.0-3
+#BuildRequires: fakeroot
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-User-space arp daemon.
-It requires kernel arpd support which isn't supported by standard
-PLD kernel. It shouldn't be run without that!!
+The ARP daemon moves the management of the ARP (Address Resolution
+Protocol) table from kernel to user space. It is useful for sites with
+LARGE network segments (256+ systems per segment), because the kernel
+hash tables are not optimized to handle this situation. To use the ARP
+daemon your kernel needs to have ARPD and NETLINK support enabled. The
+standard kernels of PLD lack this support. It shouldn't be run without
+that!! This version can alocate 2048 entries.
+
+This is version which runs at UID=40.
%description -l pl
-Demon arpd.
-Standardowe j±dro ma organiczon± wielko¶æ tablicy arp do 255. Ten demon
-likwiduje t± niedogodno¶æ wystêpuj±c± w du¿ych sieciach
+Demon ARP przekazuje zarz±dzanie tablic± ARP (Address Resolution
+Protocol) z kernel'a do przestrzeni u¿ytkownika. Jest to bardzo
+u¿yteczne dla miejsc o du¿ych segmentach sieci (256+ systemów na
+segment), poniewa¿ tablice w j±drze nie s± zoptymalizowane na takie
+sytuacje. Aby u¿ywaæ tego demona musisz mieæ ARPD support oraz NETLINK
+support uaktywnione w j±drze. Uwaga! Stanadardowe j±dro PLD nie ma
+supportu ARPD!!. Demon nie powinien byæ startowany bez tego!! Ta
+wersja potrafi zaakceptowaæ 2048 pozycji.
-Uwaga: wymaga arpd support, którego nie ma w standardowym j±drze PLD!!
-Nie powinien byæ startowany bez tego!!
+Ta wersja pracuje na UID=40.
%prep
%setup -q -n %{name}-%{version}.orig
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3
+%patch4 -p1
%build
-
%{__make}
-%install -n -n %{name}-%{version}
+%install
rm -rf $RPM_BUILD_ROOT
-
install -d $RPM_BUILD_ROOT/{usr/sbin,etc/rc.d/init.d}
-install arpd $RPM_BUILD_ROOT/usr/sbin/arpd
+
+install arpd $RPM_BUILD_ROOT%{_sbindir}/arpd
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/arpd
-gzip -9nf CHANGES Copyright debian/*
+gzip -9nf CHANGES
+
+# making device with fakeroot:
+#cd $RPM_BUILD_ROOT/var/lib/arpd
+#mknod arpd c 36 8
+
+%pre
+if [ -n "`id -u arpd 2>/dev/null`" ]; then
+ if [ "`id -u arpd`" != "40" ]; then
+ echo "Warning: user arpd haven't uid=40. Correct this before installing arpd." 1>&2
+ exit 1
+ fi
+else
+ echo "Adding arpd user (UID=40)"
+ /usr/sbin/useradd -u 40 -r -d /no/home -s /bin/false -c "arpd user" -g daemon arpd 1>&2
+fi
%post
/sbin/chkconfig --add arpd
-if [ ! -f /dev/arpd ]; then
- mknod /dev/arpd c 36 8
-fi
-echo "Warning!!"
-echo "You need arpd kernel support which isn't provided by standard PLD-kernel!!"
if [ -f /var/lock/subsys/arpd ]; then
/etc/rc.d/init.d/arpd restart 1>&2
else
echo "Run \"/etc/rc.d/init.d/arpd start\" to start arpd daemon."
fi
+chown arpd:root /dev/arpd
%preun
/sbin/chkconfig --del arpd
fi
+%postun
+if [ "$1" = "0" ]; then
+ echo "Removing arpd user (UID=40)"
+ /usr/sbin/userdel arpd
+fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc *.gz
-%doc README.html debian/*
-%attr(754,root,root) /usr/sbin/arpd
+%doc *.gz README.html
+%attr(754,root,root) %{_sbindir}/arpd
%attr(754,root,root) /etc/rc.d/init.d/arpd
+#%dir %attr(750,arpd,root) /var/lib/arpd/*