Summary: Multi-purpose application level gateway
Name: delegate
Version: 9.9.13
Release: 1%{?_dist_release}
Group: Applications/System
Source: ftp://ftp.etl.go.jp/pub/DeleGate/delegate%{version}.tar.gz
URL: http://www.delegate.org/
License: see COPYRIGHT
Buildroot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux

%define __spec_install_post \
    %{?__debug_package:%{__debug_install_post}} \
    %{__arch_install_post} \
    %{__os_install_post} \
    ./src/delegated -Fesign -w $RPM_BUILD_ROOT/usr/sbin/delegated \
%{nil}

%description
Delegated is the DeleGate server process which relays TCP/IP protocols
 like HTTP, Gopher, Whois, FTP, Telnet, NNTP, SMTP, POP, and so on.

%description -l ja
Delegateは、HTTP, Gopher, FTP, Wais, Telnet, NNTP, SMTP,POP, Whois 
などTCP/IP上の各種プロトコルに対する汎用のプロトコル中継システムです。

%prep
%setup -q -n %{name}%{version}

%build
make CC=gcc PATH=".:$PATH" ADMIN=root@localhost

%install
rm -rf $RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT/usr/sbin
install -m 0700 src/delegated $RPM_BUILD_ROOT/usr/sbin
install -m 0700 bin/expire $RPM_BUILD_ROOT/usr/sbin
install -m 0700 -d $RPM_BUILD_ROOT/var/spool/delegate

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if  ! grep -q '^delegate:' /etc/group
then
    /usr/sbin/groupadd delegate
fi

if  ! grep -q '^delegate:' /etc/passwd
then
    /usr/sbin/useradd -M -g delegate delegate
fi


%files
%defattr(-,delegate,delegate)
%license COPYRIGHT
%doc CHANGES CREDITS README* DG9note.html
%doc doc/
/usr/sbin/delegated
/usr/sbin/expire
%dir /var/spool/delegate


%changelog
* Tue Jul  5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.9.13-1
- new upstream release.

* Sun Jan 12 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.9.7-2
- rebuilt with current environment.

* Wed May 02 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.9.7-1
- new upstream release.
- made to resign stripped binary.

* Fri Apr 24 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 9.9.2-1
- applied new versioning policy, spec in UTF-8
- s/Copyright/License/
- updated to 9.9.2
- changed Group to Applications/Services

* Sat Sep 21 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 7.7.1-0vl2
- groupadd in the %%pre section

* Tue Dec  4 2001 Jun Nishii <jun@vinelinux.org> 7.7.1-0vl1
- ver.up
- rewrite spec

* Sun Aug 1 1999 Tetsuhiro Nakane <nakane@ecc.denso.co.jp>
- 1st release