mirror of https://github.com/facebook/tac_plus
misc fixes to building and EL6..EL9
This commit is contained in:
parent
b89059402c
commit
e5806b40f0
77
tacacs.spec
77
tacacs.spec
|
|
@ -1,5 +1,23 @@
|
|||
%global debug_package %{nil}
|
||||
|
||||
# tcp_wrappers do not exist on stock EL8/EL9
|
||||
%define libwrap 0
|
||||
%define systemd 0
|
||||
|
||||
%if 0%{?el6}
|
||||
%define libwrap 1
|
||||
%endif
|
||||
%if 0%{?el7}
|
||||
%define libwrap 1
|
||||
%endif
|
||||
%if 0%{?el8}
|
||||
%define systemd 1
|
||||
%endif
|
||||
%if 0%{?el9}
|
||||
%define systemd 1
|
||||
%endif
|
||||
|
||||
|
||||
Summary: TACACS+ Daemon
|
||||
Name: tacacs
|
||||
Group: Networking/Servers
|
||||
|
|
@ -11,8 +29,16 @@ Source: %{name}-%{version}.tar.gz
|
|||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
|
||||
BuildRequires: gcc, bison, flex, m4, pam-devel, systemd, libtool, autoconf, automake, python-rpm-macros
|
||||
Requires: pam
|
||||
BuildRequires: gcc, bison, flex, m4, pam-devel, libtool, autoconf, automake, python-rpm-macros
|
||||
|
||||
%if 0%{?libwrap}
|
||||
BuildRequires: tcp_wrappers, tcp_wrappers-devel
|
||||
%endif
|
||||
|
||||
%if 0%{?systemd}
|
||||
Requires: systemd
|
||||
%endif
|
||||
|
||||
%description
|
||||
Tacacs+ Daemon for Linux
|
||||
|
|
@ -30,17 +56,31 @@ autoreconf
|
|||
|
||||
export CFLAGS="-fPIE"
|
||||
|
||||
%if 0%{?libwrap}
|
||||
%configure --enable-acls --enable-uenable
|
||||
%else
|
||||
%configure --enable-acls --enable-uenable --without-libwrap
|
||||
%endif
|
||||
|
||||
%{__make}
|
||||
|
||||
%install
|
||||
export DONT_STRIP=1
|
||||
%{__rm} -rf %{buildroot}
|
||||
%makeinstall
|
||||
# %{__install} -Dp -m0755 tac_plus.sysvinit %{buildroot}%{_initrddir}/tac_plus
|
||||
%{__install} -Dp -m0644 tac_plus.service %{buildroot}%{_unitdir}/tac_plus.service
|
||||
|
||||
%makeinstall
|
||||
|
||||
%if 0%{systemd}
|
||||
%{__install} -Dp -m0644 tac_plus.service %{buildroot}%{_unitdir}/tac_plus.service
|
||||
%else
|
||||
%{__install} -Dp -m0755 tac_plus.sysvinit %{buildroot}%{_initrddir}/tac_plus
|
||||
%endif
|
||||
|
||||
%if 0%{?el6}
|
||||
|
||||
%else
|
||||
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/tacacs/do_auth.py
|
||||
%endif
|
||||
|
||||
### Clean up buildroot
|
||||
%{__rm} -f %{buildroot}%{_infodir}/dir
|
||||
|
|
@ -48,20 +88,42 @@ export DONT_STRIP=1
|
|||
%{__rm} -f %{buildroot}%{_libdir}/*.la
|
||||
|
||||
%post
|
||||
%if 0%{?el6}
|
||||
/sbin/chkconfig --add tac_plus
|
||||
%else
|
||||
%systemd_post tac_plus.service
|
||||
%endif
|
||||
|
||||
%preun
|
||||
%if 0%{?el6}
|
||||
# real uninstall, nothing is left behind
|
||||
if [ $1 -eq 0 ] ; then
|
||||
/sbin/service tac_plus stop
|
||||
|
||||
fi
|
||||
|
||||
%else
|
||||
%systemd_preun tac_plus.service
|
||||
%endif
|
||||
|
||||
%postun
|
||||
%if 0%{?el6}
|
||||
:
|
||||
%else
|
||||
%systemd_postun_with_restart tac_plus.service
|
||||
%endif
|
||||
|
||||
%clean
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
%files
|
||||
|
||||
%if 0%{?systemd}
|
||||
%{_unitdir}/tac_plus.service
|
||||
%else
|
||||
%{_initddir}/tac_plus
|
||||
%endif
|
||||
|
||||
%{_includedir}/tacacs.h
|
||||
%{_bindir}/tac_pwd
|
||||
%{_sbindir}/tac_plus
|
||||
|
|
@ -73,10 +135,15 @@ export DONT_STRIP=1
|
|||
%{_libdir}/libtacacs.so.1.0.0
|
||||
%{_libdir}/libtacacs.so.1
|
||||
%{_libdir}/libtacacs.so
|
||||
#/etc/rc.d/init.d/tac_plus
|
||||
|
||||
|
||||
%if 0%{?el6}
|
||||
%{_datadir}/tacacs/do_auth.pyc
|
||||
%{_datadir}/tacacs/do_auth.pyo
|
||||
%else
|
||||
%{_datadir}/tacacs/do_auth.py
|
||||
%{_datadir}/tacacs/__pycache__/do_auth.cpython-3*.pyc
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed May 17 2023 Kaj Niemi <kajtzu@basen.net> - F4.0.4.28-7fb
|
||||
|
|
|
|||
Loading…
Reference in New Issue