File pam_smb.spec of Package pam_smb

#
# spec file for package pam_smb
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           pam_smb
BuildRequires:  libtool
BuildRequires:  pam-devel
Version:        2.0.0rc6
Release:        0
Summary:        A PAM Module for User Authentication using an NT Server
License:        LGPL-2.1+
Group:          Productivity/Security
Url:            http://www.csn.ul.ie/~airlied/pam_smb/
Source:         %{name}-%{version}.tar.bz2
Source1:        rc.pamsmbd
Source2:        login.example
Source3:        baselibs.conf
Patch:          %{name}-%{version}.patch
Patch2:         %{name}-%{version}-daemon-fix.patch
Patch3:         %{name}-%{version}-gcc-fix.patch
Patch4:         %{name}-%{version}-configure.patch
Patch5:         %{name}-%{version}-array-fix.patch
Patch6:         %{name}-%{version}-invalid-flag.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         coreutils sed grep diffutils fillup

%description
Module pam_smb is a PAM module which allows authentication of UNIX
users using an NT server.

%prep
%setup -q -n %{name}-2.0.0-rc6
%patch
%patch2
%patch3
%patch4
%patch5
%patch6
cp %{S:2} .

%build
libtoolize -f
aclocal
autoconf
%configure
make %{?_smp_mflags}

%install
install -d 755 $RPM_BUILD_ROOT/%{_lib}/security
install -d 755 $RPM_BUILD_ROOT/{etc/init.d,usr/sbin}
install -m 755 pamsmbm/pam_smb_auth.so $RPM_BUILD_ROOT/%{_lib}/security
install -m 755 pamsmbd/pamsmbd $RPM_BUILD_ROOT/usr/sbin/
install -m 644 pam_smb.conf.example $RPM_BUILD_ROOT/etc/pam_smb.conf
install -m 755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/pamsmbd
ln -sf ../../etc/init.d/pamsmbd $RPM_BUILD_ROOT/usr/sbin/rcpamsmbd

%post
%{fillup_and_insserv pamsmbd}

%preun
%stop_on_removal pamsmbd

%postun
%restart_on_update pamsmbd
%insserv_cleanup

%files
%defattr(-,root,root)
%doc CHANGES COPYING CREDITS README TODO login.example
%config /etc/pam_smb.conf
/%{_lib}/security/pam_smb_auth.so
%config /etc/init.d/*
%{_sbindir}/*

%changelog
openSUSE Build Service is sponsored by