%define _pamlibdir /%{_lib}/security # Do we have new pam without pam_stack %define use_pam_include %(eval [ $(rpm -q --queryformat '%{VERSION}' pam \| %{__sed} -e "s/\\.//g") -ge 80 ] && echo 1 || echo 0 ) Name: pam_sotp Version: 0.3.3 Release: 1%{?dist} Summary: PAM module that provides support for One Time Passwords (OTP) authentication Group: System Environment/Base License: GPLv2+ URL: http://www.cavecanen.org/cs/projects/%{name} Source0: http://www.cavecanen.org/cs/projects/%{name}/dl/%{name}-%{version}.tar.bz2 Source1: pam_sotp-pam-config_stack Source2: pam_sotp-pam-config_include Source3: pam_sotp-README.RPM Patch0: pam_sotp-0.3.3-no_shadow_group.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pam-devel, sed, links %description Pam_sotp provides a simple one time password mechanism for Linux-PAM (Pluggable Authentication Modules). %prep %setup -q %patch0 -p1 -b .shadow %build %{configure} --with-randomdev=/dev/urandom %{__make} %{?_smp_mflags} /usr/bin/links -dump file://./doc/manual/html/manual.html > manual.txt %install rm -rf $RPM_BUILD_ROOT %{__install} -d %{buildroot}%{_pamlibdir} %{__install} -d %{buildroot}%{_bindir} %{__install} -d %{buildroot}%{_sysconfdir}/pam.d %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sotp %{__make} install DESTDIR=%{buildroot} pam_moduledir=%{_pamlibdir}/ %if %{use_pam_include} %define pam_cfg %{SOURCE2} %else %define pam_cfg %{SOURCE1} %endif %{__install} -m 0644 -p %{pam_cfg} %{buildroot}%{_sysconfdir}/pam.d/otppasswd %{__install} -m 0644 -p %{SOURCE3} README.RPM %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING NEWS README* %doc manual.txt doc/manual/html doc/manual/pdf %{_pamlibdir}/%{name}.so %{_sysconfdir}/pam.d/otppasswd %{_sysconfdir}/sotp %{_bindir}/otppasswd %changelog * Wed Jul 23 2008 Rahul Sundaram 0.3.3-1 - initial build