ppp/ppp.spec

232 lines
6.5 KiB
RPMSpec
Raw Normal View History

2014-08-11 16:51:51 +11:00
%bcond_without inet6
Summary: The PPP daemon and documentation
Name: ppp
Version: 2.4.7
Release: 1
2012-02-01 14:14:20 +04:00
License: BSD-like
Group: System/Servers
2014-08-11 16:51:51 +11:00
Url: http://www.samba.org/ppp/
Source0: ftp://ftp.samba.org/pub/ppp/%{name}-%{version}.tar.gz
2012-02-01 14:14:20 +04:00
Source1: ppp-2.4.3-pam.conf
Source2: ppp-2.4.1-mppe-crypto.tar.bz2
Source3: README.pppoatm
Source4: ppp.logrotate
Source5: ppp-dhcpc.tar.bz2
2014-08-11 16:51:51 +11:00
Patch0: ppp-2.4.7-make.patch
2012-02-01 14:14:20 +04:00
Patch1: ppp-2.3.6-sample.patch
2014-08-11 16:51:51 +11:00
Patch2: ppp-options.patch
Patch3: ppp-2.4.3-pppdump-Makefile.patch
Patch4: ppp-2.4.7-noexttraffic.patch
2012-02-01 14:14:20 +04:00
# (blino) use external libatm for pppoatm plugin
2014-08-11 16:51:51 +11:00
Patch5: ppp-2.4.3-libatm.patch
Patch6: ppp-2.4.2-pie.patch
Patch7: ppp-2.4.4-multipledefrt.patch
Patch8: ppp-2.4.4-dontwriteetc.patch
Patch9: ppp-2.4.3-pic.patch
Patch10: ppp-2.4.3-etcppp.patch
Patch11: ppp-2.4.5-includes-sha1.patch
Patch12: ppp-2.4.5-makeopt2.patch
Patch13: ppp-2.4.7-nostrip.patch
2012-02-01 14:14:20 +04:00
BuildRequires: libtool
2014-08-11 16:51:51 +11:00
BuildRequires: atm-devel
BuildRequires: pcap-devel
BuildRequires: pkgconfig(openssl)
BuildRequires: pam-devel
2012-02-01 14:14:20 +04:00
%description
The ppp package contains the PPP (Point-to-Point Protocol) daemon
and documentation for PPP support. The PPP protocol provides a
method for transmitting datagrams over serial point-to-point links.
The ppp package should be installed if your machine need to support
the PPP protocol.
2014-08-11 16:51:51 +11:00
%files
%doc FAQ PLUGINS README* scripts sample
%{_sbindir}/chat
%{_sbindir}/pppdump
%attr(5755,root,root) %{_sbindir}/pppd
%attr(0755,root,daemon) %{_sbindir}/pppstats
%{_mandir}/man*/*
%exclude %{_mandir}/man8/*rad*
%dir %{_libdir}/pppd
%{_libdir}/pppd/%{version}
%exclude %{_libdir}/pppd/%{version}/pppoatm.so
%exclude %{_libdir}/pppd/%{version}/rp-pppoe.so
%exclude %{_libdir}/pppd/%{version}/rad*
%exclude %{_libdir}/pppd/%{version}/dhcpc.so
%dir %{_sysconfdir}/ppp
%dir /var/run/ppp
/var/run/ppp/*
%attr(700, root, root) %dir /var/log/ppp
/var/log/ppp/*
%attr(0600,root,daemon) %config(noreplace) %{_sysconfdir}/ppp/chap-secrets
%attr(0600,root,daemon) %config(noreplace) %{_sysconfdir}/ppp/options
%attr(0600,root,daemon) %config(noreplace) %{_sysconfdir}/ppp/pap-secrets
%attr(0600,root,daemon) %{_sysconfdir}/ppp/connect-errors
%attr(0600,root,daemon) %{_sysconfdir}/ppp/resolv.conf
%attr(755,root,daemon) %dir %{_sysconfdir}/ppp/peers
%config(noreplace) %{_sysconfdir}/pam.d/ppp
%config(noreplace) /etc/logrotate.d/ppp
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
#----------------------------------------------------------------------------
%package devel
2012-02-01 14:14:20 +04:00
Summary: PPP devel files
Group: Development/C
2014-08-11 16:51:51 +11:00
Requires: %{name} = %{EVRD}
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%description devel
2012-02-01 14:14:20 +04:00
PPP over ATM plugin for %{name}.
2014-08-11 16:51:51 +11:00
%files devel
%doc README*
%{_includedir}/pppd/*
%{multiarch_includedir}/pppd/pathnames.h
#----------------------------------------------------------------------------
%package pppoatm
2012-02-01 14:14:20 +04:00
Summary: PPP over ATM plugin for %{name}
Group: System/Servers
2014-08-11 16:51:51 +11:00
Requires: %{name} = %{EVRD}
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%description pppoatm
2012-02-01 14:14:20 +04:00
PPP over ATM plugin for %{name}.
2014-08-11 16:51:51 +11:00
%files pppoatm
%doc README
%{_libdir}/pppd/%{version}/pppoatm.so
#----------------------------------------------------------------------------
%package pppoe
2012-02-01 14:14:20 +04:00
Summary: PPP over ethernet plugin for %{name}
Group: System/Servers
2014-08-11 16:51:51 +11:00
Requires: %{name} = %{EVRD}
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%description pppoe
2012-02-01 14:14:20 +04:00
PPP over ethernet plugin for %{name}.
2014-08-11 16:51:51 +11:00
%files pppoe
%doc README
%{_libdir}/pppd/%{version}/rp-pppoe.so
%{_sbindir}/pppoe-discovery
#----------------------------------------------------------------------------
%package radius
2012-02-01 14:14:20 +04:00
Summary: Radius plugin for %{name}
Group: System/Servers
2014-08-11 16:51:51 +11:00
Requires: %{name} = %{EVRD}
2012-02-01 14:14:20 +04:00
Requires: radiusclient-utils
2014-08-11 16:51:51 +11:00
%description radius
2012-02-01 14:14:20 +04:00
Radius plugin for %{name}.
2014-08-11 16:51:51 +11:00
%files radius
%doc README
%{_libdir}/pppd/%{version}/rad*.so
%{_mandir}/man8/*rad*
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
#----------------------------------------------------------------------------
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%package dhcp
Summary: DHCP plugin for %{name}
2012-02-01 14:14:20 +04:00
Group: System/Servers
2014-08-11 16:51:51 +11:00
Requires: %{name} = %{EVRD}
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%description dhcp
DHCP plugin for %{name}.
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%files dhcp
%doc pppd/plugins/dhcp/README
%doc pppd/plugins/dhcp/AUTHORS
%doc pppd/plugins/dhcp/COPYING
%{_libdir}/pppd/%{version}/dhcpc.so
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
#----------------------------------------------------------------------------
2012-02-01 14:14:20 +04:00
%prep
%setup -q
%patch0 -p1 -b .make
%patch1 -p1 -b .sample
2014-08-11 16:51:51 +11:00
%patch2 -p1 -b .options
%patch3 -p1 -b .pppdump-Makefile
2012-02-01 14:14:20 +04:00
# (gg) add noext-traffic option
2014-08-11 16:51:51 +11:00
%patch4 -p1 -b .noext
2012-02-01 14:14:20 +04:00
2014-08-11 16:51:51 +11:00
%patch5 -p1 -b .libatm
%patch6 -p1 -b .pie
%patch7 -p1 -b .multipledefrt
2012-02-01 14:14:20 +04:00
tar -xjf %{SOURCE2}
pushd pppd/plugins
tar -xjf %{SOURCE5}
popd
2014-08-11 16:51:51 +11:00
%patch8 -p1 -b .dontwriteetc
%patch9 -p1 -b .pic
%patch10 -p1 -b .etcppp
%patch11 -p1 -b .incsha1
%patch12 -p1 -b .dhcp
%patch13 -p1 -b .nostrip
2012-02-01 14:14:20 +04:00
# lib64 fixes
perl -pi -e "s|^(LIBDIR.*)\\\$\(DESTDIR\)/lib|\1\\\$(INSTROOT)%{_libdir}|g" pppd/Makefile.linux pppd/plugins/Makefile.linux pppd/plugins/{pppoatm,radius,rp-pppoe,pppol2tp}/Makefile.linux
perl -pi -e "s|(--prefix=/usr)|\1 --libdir=%{_libdir}|g" pppd/plugins/radius/Makefile.linux
perl -pi -e "/_PATH_PLUGIN/ and s,(?:/usr/lib|DESTDIR (\")/lib),\$1%{_libdir}," pppd/pathnames.h
# enable the dhcp plugin
perl -p -i -e "s|^(PLUGINS :=)|SUBDIRS += dhcp\n\$1|g" pppd/plugins/Makefile.linux
# fix /usr/local in scripts path
perl -pi -e "s|/usr/local/bin/pppd|%{_sbindir}/pppd|g;
s|/usr/local/bin/ssh|%{_bindir}/ssh|g;
s|/usr/local/bin/expect|%{_bindir}/expect|g" \
scripts/ppp-on-rsh \
scripts/ppp-on-ssh \
scripts/secure-card
2014-08-11 16:51:51 +11:00
%if %{with inet6}
2012-02-01 14:14:20 +04:00
perl -pi -e "s/#HAVE_INET6/HAVE_INET6/" pppd/Makefile.linux
%endif
%build
perl -pi -e "s/openssl/openssl -DOPENSSL_NO_SHA1/;" openssl/crypto/sha/Makefile
2014-08-11 16:51:51 +11:00
%configure2_5x
%make RPM_OPT_FLAGS="%{optflags}" LIBDIR=%{_libdir}
2012-02-01 14:14:20 +04:00
%make -C pppd/plugins -f Makefile.linux
%install
mkdir -p %{buildroot}{%{_sbindir},%{_bindir},/usr/X11R6/bin/,%{_mandir}/man8,%{_sysconfdir}/{ppp/peers,pam.d}}
%makeinstall LIBDIR=%{buildroot}%{_libdir}/pppd/%{version}/ INSTALL=install -C pppd/plugins/dhcp
%makeinstall INSTROOT=%{buildroot} SUBDIRS="pppoatm rp-pppoe radius pppol2tp"
%multiarch_includes %{buildroot}%{_includedir}/pppd/pathnames.h
# (gg) Allow stripping
chmod u+w %{buildroot}%{_sbindir}/*
chmod go+r scripts/*
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/ppp
install -m 644 %{SOURCE3} %{_builddir}/%{name}-%{version}/
# (stew) fix permissions
chmod 0755 `find %{buildroot} -name "*\.so"`
# Provide pointers for people who expect stuff in old places
touch %{buildroot}/var/log/ppp/connect-errors
touch %{buildroot}/var/run/ppp/resolv.conf
ln -s ../../var/log/ppp/connect-errors %{buildroot}/etc/ppp/connect-errors
ln -s ../../var/run/ppp/resolv.conf %{buildroot}/etc/ppp/resolv.conf
# Logrotate script
mkdir -p %{buildroot}/etc/logrotate.d
install -m 644 %{SOURCE4} %{buildroot}/etc/logrotate.d/ppp