CASA/shsrc/lshsrc/mk-casa-rpmpkg

132 lines
3.6 KiB
Plaintext
Raw Normal View History

2005-11-30 01:05:36 +01:00
#!/bin/bash
set -x
cd ../..
PR=`pwd`
cd $PR/make
MAJ_SSS_NO=`cat majver.txt`
MIN_SSS_NO=`cat minver.txt`
REV_SSS_NO=`cat revver.txt`
export BLD_NO=$MAJ_SSS_NO.$MIN_SSS_NO.$REV_SSS_NO
export PROD_NUM=$MAJ_SSS_NO
cd $PR/lib/lux/
BR=`pwd`
mkdir -p $BR/pkg
mkdir -p $BR/pkg/BUILD/
mkdir -p $BR/pkg/RPMS/
mkdir -p $BR/pkg/RPMS/i386/
mkdir -p $BR/pkg/casa_devel_area/
# save the original .rpmmacros
if [ -f ~/.rpmmacros ]
then
mv ~/.rpmmacros ~/.rpmmacros.orig
fi
# append these to the .rpmmacros
echo "%_topdir $BR/pkg/" >> ~/.rpmmacros
echo "%version $BLD_NO" >> ~/.rpmmacros
echo "%release $MAJ_SSS_NO" >> ~/.rpmmacros
cp -f $PR/include/micasa.h $BR/pkg/BUILD
cp -f $PR/include/micasa_mgmd.h $BR/pkg/BUILD
# create the direcories and set the rights on them
cd $BR/pkg/casa_devel_area
install -m 755 -d opt/novell/CASA_devel
install -m 755 -d opt/novell/CASA_devel/include
install -m 755 -d opt/novell/CASA_devel/doc
install -m 755 -d opt/novell/CASA_devel/sample
install -m 755 -d opt/novell/CASA_devel/sample_bin
# copy the files to the restpected directories and set the rights on them
cd $BR/pkg/BUILD
install -m 755 micasa.h $BR/pkg/casa_devel_area/opt/novell/CASA_devel/include/micasa.h
#install -m 755 micasa_mgmd.h $BR/pkg/casa_devel_area/opt/novell/CASA_devel/include/micasa_mgmd_idk.h
install -m 755 micasa_mgmd.h $BR/pkg/casa_devel_area/opt/novell/CASA_devel/include/micasa_mgmd.h
# -bb and --buildroot are rpmbuild (rpmb) options that should be included
# in /etc/popt, for rpm to work check "man rpm" and "man rpmbuild" search for -bb for
# instructions. --buildroot should be added separately.
#Create the rpm spec file on the fly
cat << E/O/F > $BR/pkg/novell-CASA-devel.spec
Summary : Novell Client Authentication Service Adapter (CASA)
Name : novell-CASA-devel
Version : %version
Release : %release
Group : System/Cryptography
Copyright: 1998-2005 Novell, Inc. All Rights Reserved
Distribution : Novell
URL : http://www.novell.com/
Packager : Novell Inc.
AutoReqProv: no
Vendor : Novell Inc.
BuildArchitectures: i386 x86_64
%description
NOVELL Client Authentication Service Adapter Development Kit (CASA).
%prep
%build
%install
install -m 755 -d $BR/pkg/casa_devel_area/opt/novell/CASA_devel/doc
install -m 755 -d $BR/pkg/casa_devel_area/opt/novell/CASA_devel/lib
install -m 755 -d $BR/pkg/casa_devel_area/opt/novell/CASA_devel/include
install -m 755 -d $BR/pkg/casa_devel_area/opt/novell/CASA_devel/sample
install -m 755 -d $BR/pkg/casa_devel_area/opt/novell/CASA_devel/sample_bin
install -m 755 micasa.h $BR/pkg/casa_devel_area/opt/novell/CASA_devel/include/micasa.h
install -m 755 micasa_mgmd.h $BR/pkg/casa_devel_area/opt/novell/CASA_devel/include/micasa_mgmd.h
%files
#%attr(666,root,root)/opt/novell/CASA_devel/include/micasa_idk.h
%attr(666,root,root)/opt/novell/CASA_devel/include/micasa.h
%attr(666,root,root)/opt/novell/CASA_devel/include/micasa_mgmd.h
%preun
rm -rf /opt/novell/CASA_devel
E/O/F
(cd $BR/pkg/casa_devel_area; pwd; rpmbuild -bb --buildroot $BR/pkg/casa_devel_area ../novell-CASA-devel.spec)
#restore the .rpmmacros file
if [ -f ~/.rpmmacros.orig ]
then
mv ~/.rpmmacros.orig ~/.rpmmacros
fi
if [ -r $BR/pkg/RPMS/i386/novell-CASA-*.rpm ]
then
echo Linux CASA-devel Package Done
cp -f $BR/pkg/RPMS/i386/novell-CASA-*.rpm $PR/products/install/lux
cd $BR/pkg
rm -rf *
exit 0
fi
if [ -r $BR/pkg/RPMS/x86_64/novell-CASA-*.rpm ]
then
echo Linux CASA-devel Package Done
cp -f $BR/pkg/RPMS/x86_64/novell-CASA-*.rpm $PR/products/install/lux
cd $BR/pkg
rm -rf *
exit 0
fi
echo Building Linux CASA-devel Package Failed
cd $BR/pkg
rm -rf *
exit 1