Summary: PPP Over Ethernet (xDSL support)
Name: rp-pppoe
Version: 3.13
Release: 3%{?_dist_release}
Group: System Environment/Daemons
License: GPL
URL: https://dianne.skoll.ca/projects/rp-pppoe/

Source0: https://dianne.skoll.ca/projects/rp-pppoe/download/%{name}-%{version}.tar.gz
Source1: tkpppoe.desktop
Source2: rp-pppoe-3.5-ja.msg
Source3: tkpppoe-html_ja.tar.gz
Patch0: rp-pppoe-3.2-vine.patch
Patch1: rp-pppoe-3.5-tkpppoe_help.patch
Patch2: rp-pppoe-3.5-tkpppoe_i18n.patch
Patch10: rp-pppoe-3.11-initscripts-7.2.10.patch

Requires: ppp >= 2.3.7
Requires(pre): /sbin/chkconfig
BuildRequires: nkf >= 2.01
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux

%package gui
Summary: GUI wrapper around the rp-pppoe PPPoE client
Summary(ja): rp-pppoe GUIラッパー
Group: Applications/Internet 
Requires: %{name} = %{version}-%{release}
Requires: tk >= 8.6

%description
PPPoE (Point-to-Point Protocol over Ethernet) is a protocol used by
many ADSL Internet Service Providers. Roaring Penguin has a free
client for Linux systems to connect to PPPoE service providers.

The client is a user-mode program and does not require any kernel
modifications. It is fully compliant with RFC 2516, the official PPPoE
specification.

%description -l ja
PPPoE (Point-to-Point Protocol over Ethernet)は、多くのADSL,FTTH  
インターネットサービスプロバイダで用いられているプロトコルです。
このパッケージは、PPPoE サービスプロバイダに接続するための、
Linuxシステム用のフリーのクライアントです。

このクライアントはユーザーモードプログラムであり、カーネルの
修正を一切必要としません。このクライアントは、公式なPPPoEの
仕様であるRFC 2516に完全に従っています。

%description gui
This is a graphical wrapper around the rp-pppoe PPPoE client.  PPPoE is
a protocol used by many DSL Internet Service Providers.

%description -l ja gui
これはPPPoEクライアント rp-pppoe のGUIラッパーです。PPPoEは多くの
ADSL,FTTHインターネットサービスプロバイダで用いられているプロトコルです。

PPPoEクライアントをGUIで使いたい場合には、このパッケージをインストール
してください。tclとtkのパーケージもインストールしておく必要があります。

%prep
%setup -q -a 3
%patch0 -p1
%patch1 -b .org
%patch2 -b .i18n
%patch10 -p1 -b .initscripts7210
(cd gui
%__install %{SOURCE2} ja.euc
nkf -E -w ja.euc > ja.msg
)

%build
cd src
%configure
cd ..
make -C src
make -C gui

%install
%__rm -rf %{buildroot}
# make install RPM_INSTALL_ROOT=%{buildroot} -C src
# make install RPM_INSTALL_ROOT=%{buildroot} -C gui
make -C src install DESTDIR=%{buildroot}
make -C gui install DESTDIR=%{buildroot}

%__install -m 644 gui/html/* %{buildroot}/%{_datadir}/tkpppoe

%__install -d %{buildroot}/%{_datadir}/applications
%__install -m 644 %{SOURCE1} %{buildroot}/%{_datadir}/applications/tkpppoe.desktop

# %post
# /sbin/chkconfig --add pppoe

%preun
if [ $1 = 0 ]; then
    /sbin/chkconfig --del pppoe
    /etc/rc.d/init.d/pppoe stop
fi

%clean
# rm -rf %{buildroot}

%files
%defattr(-,root,root)
%license doc/LICENSE
%doc doc/CHANGES doc/HOW-TO-CONNECT doc/KERNEL-MODE-PPPOE
%doc doc/PROBLEMS README
%config %{_sysconfdir}/rc.d/init.d/pppoe
%config(noreplace) %{_sysconfdir}/ppp/pppoe.conf
%config(noreplace) %{_sysconfdir}/ppp/pppoe-server-options
%config(noreplace) %{_sysconfdir}/ppp/firewall-masq
%config(noreplace) %{_sysconfdir}/ppp/firewall-standalone
%{_sysconfdir}/ppp/plugins/*
%{_sbindir}/pppoe
%{_sbindir}/pppoe-server
%{_sbindir}/pppoe-sniff
%{_sbindir}/pppoe-relay
%{_sbindir}/pppoe-connect
%{_sbindir}/pppoe-start
%{_sbindir}/pppoe-stop
%{_sbindir}/pppoe-setup
%{_sbindir}/pppoe-status
%{_mandir}/man5/*
%{_mandir}/man8/*

%files gui
%defattr(-,root,root)
%doc doc/CHANGES doc/HOW-TO-CONNECT doc/LICENSE doc/KERNEL-MODE-PPPOE
%doc doc/PROBLEMS README
%dir /etc/ppp/rp-pppoe-gui
%{_sbindir}/pppoe-wrapper
%{_bindir}/tkpppoe
%{_datadir}/tkpppoe
%{_mandir}/man1/*
%config(missingok) %{_datadir}/applications/tkpppoe.desktop

%changelog
* Fri Oct 04 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.13-1
- new upstream release.

* Fri Nov  2 2012 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 3.11-1
- new upstream release 
- update patch10

* Sun Apr 17 2011 Shu KONNO <owa@bg.wakwak.com> 3.10-3
- rebuilt with rpm-4.8.1-3

* Thu Apr 30 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10-2
- spec in utf-8

* Sat Feb 07 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 3.10-1
- new upstream release

* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 3.8-1vl5
- applied new versioning policy

* Sun Dec 16 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 3.8-0vl5
- update patch10 to set DEVNAME in pppoe-connect

* Sat Nov 17 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 3.8-0vl4
- update pppoe-{start,stop,connect,status} fot initscripts-7.2.10
  (<BTS:0560>)

* Tue Jan 16 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 3.8-0vl3
- separete .desktop as Source1 to use UTF-8 encoding.

* Sat Jan 13 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 3.8-0vl2
- change .desktop installation directory. <BTS:VineLinux:405>

* Mon Sep 11 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 3.8-0vl1
- rebuild for Vine 4.0/VineSeed

* Mon Jul 24 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 3.8-0vl0.1
- test package for Vine 3.2
- new upstream release 3.8
- change filename adsl-* to pppoe-* in file section

* Sun Jul 20 2003 Masaki Shinomiya <shino@pos.to> 3.5-0vl3
- ja.msg in UTF-8, japanese html help file
- both translation originally by Ryoji Kawagishi
- allow mozilla for help browser, tkpppoe.desktop, i18n.patch
- group of the gui package to Applications/Internet
- vendor and distribution

* Sat Mar 15 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.5-0vl2
- rebuild with new toolchains

* Sun Sep 29 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 3.5-0vl1
- new upstream release 3.5

* Fri Jun 07 2002 Tomoya TAKA <taka@vinelinux.org> 3.4-0vl1
- update to 3.4
- split tkpppoe.desktop from spec file (%%{SOURCE1})

* Sun Feb 24 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-0vl2
- remove %%post script
  - do not chkconfig --add at install time, we need some configuration before using.

* Fri Sep 14 2001 Toru Sagami <sagami@vinelinux.org>
- 3.3-0vl1

* Fri Jul 20 2001 <sagami@vinelinux.org>
- 3.2-0vl1: added patch for vine-release and erased BuildPreReq

* Thu Jul 05 2001 <sagami@vinelinux.org>
- 3.1-0vl1
- use more (not better!) macros
- added BuildPreReq /etc/redhat-release (trick of a kind)

* Wed Jun 27 2001 Tomoya TAKA <tomoya@olive.plala.or.jp>
- 3.0-1vl2
- add %%config(noreplace)
- add /etc/X11/applnk/Internet/tkpppoe.desktop to rp-pppoe-gui
- add Prereq: /sbin/chkconfig

* Wed Apr 18 2001 Tomoya TAKA <tomoya@olive.plala.or.jp>
- 3.0-1vl1
- first package tailored for Vine Linux 2.x
- merge rp-pppoe-gui-3.0-1
