CASA.spec was updated with the changes requested by Ben Kahn and Craig Gardner.

This commit is contained in:
Cameron (Kamran) Mashayekhi 2005-10-27 16:11:49 +00:00
parent eddf865f0b
commit 2b1f17d7a7

View File

@ -24,7 +24,7 @@ Source: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
requires: mono >= 1.1.7
ExclusiveArch: %ix86 x86_64
NoSource: 0
#NoSource: 0
%description
CASA (Common Authentication Services Adaptor) is a common authentication
@ -43,7 +43,7 @@ Provides: CASA-devel
%description devel
This package contains all necessary include files and libraries needed
to develop applications that can use CASA (Common Authnetication Services Adapter)
for credential storage and signle sign on.
for credential storage and single sign-on.
%package gui
Summary: The CASA Console Utility
@ -72,12 +72,15 @@ to one another.
export PATH=.:$PATH
mk-cai-all
%install
mkdir -p %{buildroot}%{prefix}
mkdir %{buildroot}%{prefix}/CASA
mkdir %{buildroot}%{prefix}/CASA/%{_lib}
mkdir %{buildroot}%{prefix}/CASA/%{binsource}
mkdir %{buildroot}%{prefix}/CASA/bin
mkdir %{buildroot}%{prefix}/CASA/include
mkdir %{buildroot}%{prefix}/CASA/images
mkdir %{buildroot}%{prefix}/CASA/doc
mkdir -p %{buildroot}/%{_lib}/security
install -m 755 %{_lib}/lux/ndbg/libmicasa.so.%version %{buildroot}%{prefix}/CASA/%{_lib}
@ -91,26 +94,22 @@ install -m 755 %{_lib}/lux/ndbg/Novell.CASA.CASAPolicy.dll %{buildroot}%{prefix}
install -m 755 %{_lib}/lux/ndbg/Novell.CASA.DataEngines.GnomeKeyring.dll %{buildroot}%{prefix}/CASA/%{_lib}
install -m 755 %{_lib}/lux/ndbg/Novell.CASA.DataEngines.KWallet.dll %{buildroot}%{prefix}/CASA/%{_lib}
#install -m 755 %{binsource}/lux/ndbg/nwautologin %{buildroot}%{prefix}/CASA/%{binsource}
install -m 755 %{binsource}/lux/ndbg/micasad.exe %{buildroot}%{prefix}/CASA/%{binsource}
install -m 755 %{binsource}/lux/ndbg/CASAManager.exe %{buildroot}%{prefix}/CASA/%{binsource}
install -m 755 c_gui/CASAManager.sh %{buildroot}%{prefix}/CASA/%{binsource}
install -m 755 %{binsource}/lux/ndbg/micasad.exe %{buildroot}%{prefix}/CASA/bin
install -m 755 %{binsource}/lux/ndbg/CASAManager.exe %{buildroot}%{prefix}/CASA/bin
install -m 755 c_gui/CASAManager.sh %{buildroot}%{prefix}/CASA/bin
install -m 755 c_gui/CASAManager.desktop %{buildroot}%{prefix}/CASA/
cp -f c_gui/images/* %{buildroot}%{prefix}/CASA/images
install -m 755 c_micasad/startup/micasad %{buildroot}%{prefix}/CASA/%{binsource}
install -m 755 c_micasad/startup/micasad.sh %{buildroot}%{prefix}/CASA/%{binsource}
#install -m 755 c_clientlogin/novell-ncl-autologin.sh %{buildroot}%{prefix}/CASA/%{binsource}
install -m 755 c_micasad/startup/micasad %{buildroot}%{prefix}/CASA/bin
install -m 755 c_micasad/startup/micasad.sh %{buildroot}%{prefix}/CASA/bin
#install -m 755 c_clientlogin/novell-ncl-autologin.sh %{buildroot}%{prefix}/CASA/bin
install -m 755 %{_lib}/lux/ndbg/pam_micasa.so %{buildroot}/%{_lib}/security
cp -f include/micasa.h %{buildroot}%{prefix}/CASA/include/
cp -f include/micasa_mgmd.h %{buildroot}%{prefix}/CASA/include/
%install
install -d %{buildroot}%{prefix}/%{_lib}
install -d %{buildroot}%{prefix}/%{binsource}
install -d %{buildroot}%{prefix}/bin
install -d %{buildroot}%{prefix}/include
install -d %{buildroot}%{prefix}/CASA/%{_lib}
install -d %{buildroot}%{prefix}/CASA/%{binsource}
install -d %{buildroot}%{prefix}/CASA/bin
install -d %{buildroot}%{prefix}/CASA/doc
install -d %{buildroot}%{prefix}/CASA/include
install -d %{buildroot}%{prefix}/CASA/images
@ -118,15 +117,26 @@ install -d %{buildroot}/%{_lib}/security
#install -m 644 %{buildroot}%{prefix}/%{_lib}/miCASA.jar %{buildroot}%{prefix}/CASA/%{_lib}
#install -m 644 doc/CASA_Admin_Guide.pdf %{buildroot}%{prefix}/CASA/doc
#install -m 644 doc/miCASA_API_Guide.pdf %{buildroot}%{prefix}/CASA/doc
#install -m 644 doc/README.txt %{buildroot}%{prefix}/CASA/doc
ln -s ../CASA/%{binsource}/micasad.exe %{buildroot}%{prefix}/%{binsource}/micasad.exe
ln -s ../CASA/%{binsource}/micasad.sh %{buildroot}%{prefix}/%{binsource}/micasad.sh
ln -s ../CASA/%{binsource}/micasad %{buildroot}%{prefix}/%{binsource}/micasad
ln -s ../CASA/%{binsource}/CASAManager.exe %{buildroot}%{prefix}/%{binsource}/CASAManager.exe
ln -s ../CASA/%{binsource}/CASAManager.sh %{buildroot}%{prefix}/%{binsource}/CASAManager.sh
install -m 644 doc/CASA_Reference_Guide.pdf %{buildroot}%{prefix}/CASA/doc
install -m 644 doc/License.txt %{buildroot}%{prefix}/CASA/doc
install -m 644 doc/Readme.txt %{buildroot}%{prefix}/CASA/doc
install -m 644 include/micasa_mgmd.h %{buildroot}%{prefix}/CASA/include
install -m 644 include/* %{buildroot}%{prefix}/CASA/include
#cp -f include/micasa.h %{buildroot}%{prefix}/CASA/include/
#cp -f include/micasa_mgmd.h %{buildroot}%{prefix}/CASA/include/
#cp -f doc/CASA_Reference_Guide.pdf %{buildroot}%{prefix}/CASA/doc/
#cp -f doc/Readme.txt %{buildroot}%{prefix}/CASA/doc/
#cp -f doc/License.txt %{buildroot}%{prefix}/CASA/doc/
ln -s ../CASA/bin/micasad.exe %{buildroot}%{prefix}/bin/micasad.exe
ln -s ../CASA/bin/micasad.sh %{buildroot}%{prefix}/bin/micasad.sh
ln -s ../CASA/bin/micasad %{buildroot}%{prefix}/bin/micasad
ln -s ../CASA/bin/CASAManager.exe %{buildroot}%{prefix}/bin/CASAManager.exe
ln -s ../CASA/bin/CASAManager.sh %{buildroot}%{prefix}/bin/CASAManager.sh
ln -s libmicasa.so.%{version} %{buildroot}%{prefix}/CASA/%{_lib}/libmicasa.so
ln -s libmicasa.so.%{version} %{buildroot}%{prefix}/CASA/%{_lib}/libmicasa.so.1
@ -162,10 +172,10 @@ ln -s ../CASA/include/micasa_mgmd.h %{buildroot}%{prefix}/include/micasa_mgmd.h
# autologin
#mkdir -p %{buildroot}/etc/profile.d
#cp %{buildroot}%{prefix}/CASA/%{binsource}/novell-ncl-autologin.sh %{buildroot}/etc/profile.d
#cp %{buildroot}%{prefix}/CASA/bin/novell-ncl-autologin.sh %{buildroot}/etc/profile.d
mkdir -p %{buildroot}/etc/init.d
cp %{buildroot}%{prefix}/CASA/%{binsource}/micasad %{buildroot}/etc/init.d
cp %{buildroot}%{prefix}/CASA/bin/micasad %{buildroot}/etc/init.d
%post
@ -173,121 +183,54 @@ if [ $1 -eq 1 ]
then
insserv /etc/init.d/micasad
%ifarch x86_64
echo "/opt/novell/CASA/lib64/" >> /etc/ld.so.conf
echo "/opt/novell/CASA/lib64/" >> /etc/ld.so.conf.d/CASA.conf
/sbin/ldconfig
%else
echo "/opt/novell/CASA/lib/" >> /etc/ld.so.conf
echo "/opt/novell/CASA/lib/" >> /etc/ld.so.conf.d/CASA.conf
/sbin/ldconfig
%endif
perl -e '
my @fileList = ("/etc/pam.d/xdm", "/etc/pam.d/gdm", "/etc/pam.d/kdm", "/etc/pam.d/login", "/etc/pam.d/sshd");
for (my $j = 0; $j <= $#fileList; $j++)
{
my $filename = $fileList [$j];
if (-e $filename)
{
print "Adding PAM module to $filename\n";
my $auth_line_to_be_inserted = "auth required pam_micasa.so";
my $session_line_to_be_inserted = "session required pam_micasa.so";
open (FILE, "<$filename") || die ("Cannot open file reading");
my @data = <FILE>;
for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
# for file in "/etc/security/pam_unix2.conf"
do
close (FILE);
if [ -f $name ]
then
awk '
/auth/ { authSeen++; }
/account/ {
if (!acctSeen && authSeen)
{
print "auth\trequired\tpam_micasa.so\n";}
acctSeen++;
}
/session/ { sesSeen++; }
// {print $0; }
END { if (sesSeen)
print "session\trequired\tpam_micasa.so\n"; }
' $file > $file.sav
mv $file.sav $file
fi
done
my $auth_index = 0;
my $session_index = 0;
for (my $i = 0; $i <= $#data; $i++)
{
my $line = $data [$i];
if ($line =~ /^auth.*/)
{
$auth_index = $i;
}
if ($line =~ /^session.*/)
{
$session_index = $i;
}
}
open (FILE, ">$filename") || die ("Cannot open file for writing");
for (my $i = 0; $i <= $#data; $i++)
{
print FILE $data [$i];
if ($i == $auth_index)
{
print FILE $auth_line_to_be_inserted."\n";
}
if ($i == $session_index)
{
print FILE $session_line_to_be_inserted."\n";
}
}
}
}
'
fi
%preun
if [ $1 -eq 0 ]
then
for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
# for file in "/etc/security/pam_unix2.conf"
do
if [ -f $name ]
then
sed '/pam_micasa/d' $file > $file.sav
mv $file.sav $file
fi
done
sed '/CASA/d' "/etc/ld.so.conf" > "/etc/ld.so.conf.sav"
mv /etc/ld.so.conf.sav /etc/ld.so.conf
perl -e '
my @fileList = ("/etc/pam.d/xdm", "/etc/pam.d/gdm", "/etc/pam.d/kdm", "/etc/pam.d/login", "/etc/pam.d/sshd" );
for (my $j = 0; $j <= $#fileList; $j++)
{
my $filename = $fileList [$j];
if (-e $filename)
{
print "Removing PAM module from $filename\n";
open (FILE, "<$filename") || die ("Cannot open file reading");
my @data = <FILE>;
close (FILE);
open (FILE, ">$filename") || die ("Cannot open file for writing");
for (my $i = 0; $i <= $#data; $i++)
{
my $line = $data [$i];
if ($line =~ /pam_micasa.so/)
{
}
else
{
print FILE $data [$i];
}
}
close (FILE);
}
}
'
perl -e '
my $filename = "/etc/ld.so.conf";
if (-e $filename)
{
open (FILE, "<$filename") || die ("Cannot open file reading");
my @data = <FILE>;
close (FILE);
open (FILE, ">$filename") || die ("Cannot open file for writing");
for (my $i = 0; $i <= $#data; $i++)
{
my $line = $data [$i];
if ($line =~ /CASA/)
{
}
else
{
print FILE $data [$i];
}
}
close (FILE);
}
'
/sbin/ldconfig
insserv -r /etc/init.d/micasad
fi
@ -300,9 +243,8 @@ rm -rf $RPM_BUILD_ROOT
%dir %{prefix}
%dir %{prefix}/CASA
%dir %{prefix}/%{_lib}
#%dir %{prefix}/%{_lib}/*
%dir %{prefix}/CASA/%{_lib}
#%dir %{prefix}/CASA/%{_lib}/*
%dir %{prefix}/CASA/doc
%dir %{prefix}/CASA/%{_lib}/libmicasa.so.%version
%dir %{prefix}/CASA/%{_lib}/libmicasa.so
%dir %{prefix}/CASA/%{_lib}/libmicasa.so.1
@ -320,17 +262,21 @@ rm -rf $RPM_BUILD_ROOT
%dir %{prefix}/%{_lib}/Novell.CASA.miCASAWrapper.dll
%dir %{prefix}/%{_lib}/Novell.CASA.Common.dll
%dir %{prefix}/%{binsource}
%dir %{prefix}/CASA/%{binsource}
%{prefix}/CASA/%{binsource}/micasad
%{prefix}/CASA/%{binsource}/micasad.sh
%{prefix}/CASA/%{binsource}/micasad.exe
%dir %{prefix}/bin
%dir %{prefix}/CASA/bin
%{prefix}/CASA/bin/micasad
%{prefix}/CASA/bin/micasad.sh
%{prefix}/CASA/bin/micasad.exe
%{prefix}/%{binsource}/micasad
%{prefix}/%{binsource}/micasad.sh
%{prefix}/%{binsource}/micasad.exe
%{prefix}/CASA/doc/CASA_Reference_Guide.pdf
%{prefix}/CASA/doc/License.txt
%{prefix}/CASA/doc/Readme.txt
%dir %{prefix}/CASA/doc
%{prefix}/bin/micasad
%{prefix}/bin/micasad.sh
%{prefix}/bin/micasad.exe
#%dir %{prefix}/CASA/doc
/etc/init.d/micasad
/%{_lib}/security/pam_micasa.so
@ -340,14 +286,20 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/include
%{prefix}/CASA/include
%{prefix}/CASA/%{_lib}/*.so
#%{prefix}/CASA/doc/miCASA_API_Guide.pdf
%{prefix}/CASA/doc/CASA_Reference_Guide.pdf
%{prefix}/CASA/doc/License.txt
%{prefix}/CASA/doc/Readme.txt
%files gui
%defattr(-,root,root)
%dir %{prefix}/CASA/%{binsource}/
%{prefix}/CASA/%{binsource}/CASAManager.sh
%{prefix}/CASA/%{binsource}/CASAManager.exe
%dir %{prefix}/CASA/bin/
%{prefix}/CASA/bin/CASAManager.sh
%{prefix}/CASA/bin/CASAManager.exe
%{prefix}/CASA/CASAManager.desktop
%{prefix}/CASA/doc/License.txt
%{prefix}/CASA/doc/Readme.txt
%dir %{prefix}/CASA/%{_lib}/