ppp/ppp.spec

286 lines
8.5 KiB
RPMSpec
Raw Permalink Normal View History

2021-01-07 20:05:20 +00:00
%define _disable_ld_no_undefined %nil
2021-04-02 00:13:56 +03:00
%define _rundir /var/run
%define commit 812e8e5c87da4fd84ae7bc5b6a18c85106188eb3
%define githash %(c=%{commit}; echo ${c:0:7})
2014-08-11 16:51:51 +11:00
Summary: The PPP daemon and documentation
Name: ppp
2025-01-15 14:44:52 +00:00
Version: 2.5.2
2024-06-12 21:20:27 +00:00
Release: 1
License: BSD
2012-02-01 14:14:20 +04:00
Group: System/Servers
2024-06-12 21:20:27 +00:00
URL: https://github.com/ppp-project/ppp
2025-01-15 14:44:52 +00:00
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
2021-04-02 00:13:56 +03:00
Source1000: %{name}.rpmlintrc
2021-01-07 20:05:20 +00:00
Source1: ppp-pam.conf
Source2: ppp-logrotate.conf
Source3: ppp-tmpfiles.conf
Source4: ip-down
Source5: ip-down.ipv6to4
Source6: ip-up
Source7: ip-up.ipv6to4
Source8: ipv6-down
Source9: ipv6-up
Source10: ifup-ppp
Source11: ifdown-ppp
Source12: ppp-watch.tar.xz
Patch0002: ppp-2.4.9-config.patch
Patch0004: 0004-doc-add-configuration-samples.patch
Patch0005: ppp-2.4.9-build-sys-don-t-hardcode-LIBDIR-but-set-it-according.patch
Patch0006: 0006-scritps-use-change_resolv_conf-function.patch
Patch0011: 0011-build-sys-don-t-put-connect-errors-log-to-etc-ppp.patch
Patch0012: ppp-2.4.8-pppd-we-don-t-want-to-accidentally-leak-fds.patch
Patch0013: ppp-2.4.9-everywhere-O_CLOEXEC-harder.patch
Patch0014: 0014-everywhere-use-SOCK_CLOEXEC-when-creating-socket.patch
Patch0015: 0015-pppd-move-pppd-database-to-var-run-ppp.patch
Patch0016: 0016-rp-pppoe-add-manpage-for-pppoe-discovery.patch
Patch0018: 0018-scritps-fix-ip-up.local-sample.patch
Patch0020: 0020-pppd-put-lock-files-in-var-lock-ppp.patch
Patch0023: 0023-build-sys-install-rp-pppoe-plugin-files-with-standar.patch
Patch0024: 0024-build-sys-install-pppoatm-plugin-files-with-standard.patch
Patch0025: ppp-2.4.8-pppd-install-pppd-binary-using-standard-perms-755.patch
Patch0026: ppp-2.4.9-configure-cflags-allow-commas.patch
2025-02-18 10:36:13 +00:00
BuildRequires: autoconf
2012-02-01 14:14:20 +04:00
BuildRequires: libtool
2014-08-11 16:51:51 +11:00
BuildRequires: atm-devel
2025-02-19 22:40:30 +00:00
BuildRequires: pkgconfig(libpcap)
2025-02-18 10:36:13 +00:00
BuildRequires: pkgconfig(openssl3.3)
#BuildRequires: pkgconfig(libcrypto)
2025-02-19 22:40:30 +00:00
BuildRequires: pkgconfig(libsasl2)
2014-08-11 16:51:51 +11:00
BuildRequires: pam-devel
2025-02-18 10:36:13 +00:00
#BuildRequires: openssl-devel
2015-06-29 20:08:41 +03:00
BuildRequires: pkgconfig(systemd)
BuildRequires: glib2-devel
Requires(post): systemd
2015-06-29 20:08:41 +03:00
Requires: glibc >= 2.0.6
Requires: initscripts >= 9.54
2021-01-08 04:48:25 +00:00
Conflicts: %{name} < 2.4.9
Obsoletes: %{name} < 2.4.9
2021-01-08 04:56:20 +00:00
Conflicts: %{name}-dhcp < 2.4.9
Obsoletes: %{name}-dhcp < 2.4.9
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
2021-01-07 20:05:20 +00:00
%doc FAQ README README.cbcp README.linux README.MPPE README.MSCHAP80 README.MSCHAP81 README.pwfd README.pppoe scripts sample README.eap-tls
2014-08-11 16:51:51 +11:00
%{_sbindir}/chat
2021-01-07 20:05:20 +00:00
%{_sbindir}/pppd
2014-08-11 16:51:51 +11:00
%{_sbindir}/pppdump
2021-01-07 20:05:20 +00:00
%{_sbindir}/pppstats
2015-06-29 20:08:41 +03:00
%{_sbindir}/ppp-watch
%dir %{_sysconfdir}/ppp
%{_sysconfdir}/ppp/ip-up
%{_sysconfdir}/ppp/ip-down
%{_sysconfdir}/ppp/ip-up.ipv6to4
%{_sysconfdir}/ppp/ip-down.ipv6to4
%{_sysconfdir}/ppp/ipv6-up
%{_sysconfdir}/ppp/ipv6-down
2024-06-15 11:25:26 +00:00
#{_sysconfdir}/ppp/openssl.cnf
2021-01-07 20:05:20 +00:00
%{_mandir}/man8/chat.8*
%{_mandir}/man8/pppd.8*
%{_mandir}/man8/pppdump.8*
%{_mandir}/man8/pppstats.8*
%{_mandir}/man8/pppoe-discovery.8*
%{_mandir}/man8/ppp-watch.8*
2021-04-02 00:13:56 +03:00
%{_libdir}/pppd/%{version}/minconn.so
%{_libdir}/pppd/%{version}/openl2tp.so
2025-02-19 22:40:30 +00:00
#{_libdir}/pppd/%{version}/passprompt.so
2021-04-02 00:13:56 +03:00
%{_libdir}/pppd/%{version}/passwordfd.so
%{_libdir}/pppd/%{version}/pppol2tp.so
%{_libdir}/pppd/%{version}/winbind.so
2021-01-07 20:05:20 +00:00
%ghost %dir %{_rundir}/ppp
%ghost %dir %{_rundir}/lock/ppp
%dir %{_sysconfdir}/logrotate.d
%attr(700, root, root) %dir %{_localstatedir}/log/ppp
2025-02-19 22:40:30 +00:00
#config(noreplace) %{_sysconfdir}/ppp/eaptls-client
#config(noreplace) %{_sysconfdir}/ppp/eaptls-server
#config(noreplace) %{_sysconfdir}/ppp/chap-secrets
#config(noreplace) %{_sysconfdir}/ppp/options
#config(noreplace) %{_sysconfdir}/ppp/pap-secrets
2014-08-11 16:51:51 +11:00
%config(noreplace) %{_sysconfdir}/pam.d/ppp
%config(noreplace) %{_sysconfdir}/logrotate.d/ppp
2021-01-07 20:05:20 +00:00
%{_tmpfilesdir}/ppp.conf
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ppp
%{_sysconfdir}/sysconfig/network-scripts/ifup-ppp
2025-02-19 22:40:30 +00:00
%config(noreplace) %{_sysconfdir}/ppp/chap-secrets.example
%config(noreplace) %{_sysconfdir}/ppp/eaptls-client.example
%config(noreplace) %{_sysconfdir}/ppp/eaptls-server.example
%config(noreplace) %{_sysconfdir}/ppp/openssl.cnf.example
%config(noreplace) %{_sysconfdir}/ppp/options.example
%config(noreplace) %{_sysconfdir}/ppp/pap-secrets.example
2021-09-10 17:16:48 +03:00
# scripts pon/poff/plog
%{_sbindir}/pon
%{_sbindir}/poff
%{_sbindir}/plog
%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
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/*
2025-02-19 22:40:30 +00:00
%{_libdir}/pkgconfig/pppd.pc
2014-08-11 16:51:51 +11:00
#----------------------------------------------------------------------------
%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
2021-04-02 00:13:56 +03:00
%{_libdir}/pppd/%{version}/pppoe.so
2025-02-19 22:40:30 +00:00
#{_libdir}/pppd/%{version}/rp-pppoe.so
2014-08-11 16:51:51 +11:00
%{_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
%prep
2024-06-15 11:25:26 +00:00
%setup -q
2021-09-10 19:19:50 +03:00
#autopatch -p1
2025-01-15 15:23:37 +00:00
#apply_patches
2012-02-01 14:14:20 +04:00
2021-01-07 20:05:20 +00:00
tar -xJf %{SOURCE12}
2012-02-01 14:14:20 +04:00
%build
2025-02-19 22:40:30 +00:00
export OPENSSL_DIR=/opt/openssl3.3
2025-02-18 10:36:13 +00:00
./autogen.sh
%configure \
--prefix=%{_prefix} \
--exec-prefix=%{_prefix} \
--libdir=%{_libdir} \
--with-plugin-dir=\$\{prefix\}/%{_lib}/pppd/%{version} \
--with-runtime-dir=\$\{localstatedir\}/run/pppd \
--enable-systemd \
--enable-cbcp \
--enable-ipxcp \
--enable-mslanman \
--enable-microsoft-extensions \
--enable-ipv6-support \
--enable-plugins \
--enable-eaptls \
2025-02-19 22:40:30 +00:00
--enable-multilink \
2025-02-18 10:36:13 +00:00
--enable-openssl-engine \
2025-02-19 23:08:19 +00:00
OPENSSL_LDFLAGS="-L/opt/openssl3.3/%{_lib}" \
--with-openssl=/opt/openssl3.3
#configure
#--cflags="$RPM_OPT_FLAGS -fPIC -Wall -fno-strict-aliasing"
#make_build LDFLAGS="%{ldflags} -pie"
2024-06-15 11:25:26 +00:00
#
#make_build -C ppp-watch LDFLAGS="%{ldflags} -pie"
#make
2012-02-01 14:14:20 +04:00
2025-02-18 10:36:13 +00:00
#configure --cflags="$RPM_OPT_FLAGS -fPIC -Wall -fno-strict-aliasing"
2024-06-15 11:25:26 +00:00
%make_build LDFLAGS="%{ldflags} -pie"
%make_build -C ppp-watch LDFLAGS="%{ldflags} -pie"
2012-02-01 14:14:20 +04:00
%install
2024-06-15 11:25:26 +00:00
#makeinstall
2025-02-19 22:40:30 +00:00
#make INSTROOT=%{buildroot} install install-etcppp
%makeinstall
2021-01-07 20:05:20 +00:00
find scripts -type f | xargs chmod a-x
%make ROOT=%{buildroot} -C ppp-watch install
2021-01-07 20:05:20 +00:00
# create log files dir
install -d %{buildroot}%{_localstatedir}/log/ppp
# install pam config
install -d %{buildroot}%{_sysconfdir}/pam.d
2012-02-01 14:14:20 +04:00
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/ppp
2021-01-07 20:05:20 +00:00
# install logrotate script
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 -p %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/ppp
# install tmpfiles drop-in
install -d %{buildroot}%{_tmpfilesdir}
install -m 644 -p %{SOURCE3} %{buildroot}%{_tmpfilesdir}/ppp.conf
2015-06-29 20:08:41 +03:00
# install scripts (previously owned by initscripts package)
install -d %{buildroot}%{_sysconfdir}/ppp
2021-01-07 20:05:20 +00:00
install -p %{SOURCE4} %{buildroot}%{_sysconfdir}/ppp/ip-down
install -p %{SOURCE5} %{buildroot}%{_sysconfdir}/ppp/ip-down.ipv6to4
install -p %{SOURCE6} %{buildroot}%{_sysconfdir}/ppp/ip-up
install -p %{SOURCE7} %{buildroot}%{_sysconfdir}/ppp/ip-up.ipv6to4
install -p %{SOURCE8} %{buildroot}%{_sysconfdir}/ppp/ipv6-down
install -p %{SOURCE9} %{buildroot}%{_sysconfdir}/ppp/ipv6-up
2015-06-29 20:08:41 +03:00
install -d %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/
2021-01-07 20:05:20 +00:00
install -p %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ppp
install -p %{SOURCE11} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifdown-ppp
# ghosts
mkdir -p %{buildroot}%{_rundir}/ppp
mkdir -p %{buildroot}%{_rundir}/lock/ppp
2021-09-10 17:16:48 +03:00
install -Dm0755 scripts/pon %{buildroot}%{_sbindir}/pon
install -Dm0755 scripts/poff %{buildroot}%{_sbindir}/poff
install -Dm0755 scripts/plog %{buildroot}%{_sbindir}/plog
# clean *.a
find %{buildroot} -type f -name "*.a" -exec rm -rf {} \;
# create symlink rp-pppoe.so
2024-06-15 11:25:26 +00:00
#pushd %{buildroot}%{_libdir}/pppd/%{version}
#ln -s pppoe.so rp-pppoe.so
#popd