forked from facebook/tac_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tacacs.spec
160 lines (127 loc) · 2.9 KB
/
tacacs.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
%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
Version: F4.0.4.28
Release: 1%{?dist}
License: Cisco
Source: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
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
%prep
%setup
%build
export CFLAGS="-DHAVE_PAM -fPIE"
libtoolize --force
autoreconf --install
automake --add-missing
autoreconf
%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
%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
# no need to do anything on el6
%if 0%{?el7}
%py_byte_compile %{__python} %{buildroot}%{_datadir}/tacacs/do_auth.py
%endif
%if 0%{?el8}
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/tacacs/do_auth.py
%endif
%if 0%{?el9}
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/tacacs/do_auth.py
%endif
### Clean up buildroot
%{__rm} -f %{buildroot}%{_infodir}/dir
%{__rm} -f %{buildroot}%{_libdir}/*.a
%{__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
%{_datadir}/tacacs/users_guide
%{_datadir}/tacacs/tac_convert
%{_mandir}/man5/tac_plus.conf.5.gz
%{_mandir}/man8/tac_pwd.8.gz
%{_mandir}/man8/tac_plus.8.gz
%{_libdir}/libtacacs.so.1.0.0
%{_libdir}/libtacacs.so.1
%{_libdir}/libtacacs.so
%{_datadir}/tacacs/do_auth.py
%if 0%{?el6}
%{_datadir}/tacacs/do_auth.pyc
%{_datadir}/tacacs/do_auth.pyo
%endif
%if 0%{?el7}
%{_datadir}/tacacs/do_auth.pyc
%{_datadir}/tacacs/do_auth.pyo
%endif
%if 0%{?el9}
%{_datadir}/tacacs/__pycache__/do_auth.cpython-3*.pyc
%endif
%changelog
* Wed May 17 2023 Kaj Niemi <[email protected]> - F4.0.4.28-7fb
- tcpwrappers does not exist on EL9 anymore
- run autoconf, libtool, automake to create everything from scratch
- other small fixes