-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinstall.ksh
More file actions
executable file
·82 lines (76 loc) · 2.35 KB
/
Copy pathinstall.ksh
File metadata and controls
executable file
·82 lines (76 loc) · 2.35 KB
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
#!/bin/bash
#Nom du paquetage
PROJET=libbfcp
#Creation de l'environnement de packaging rpm
function create_rpm
{
#Cree l'environnement de creation de package
#Creation des macros rpmbuild
rm ~/.rpmmacros
touch ~/.rpmmacros
echo "%_topdir" $PWD"/rpmbuild" >> ~/.rpmmacros
echo "%_tmppath %{_topdir}/TMP" >> ~/.rpmmacros
echo "%_signature gpg" >> ~/.rpmmacros
echo "%_gpg_name IVeSkey" >> ~/.rpmmacros
echo "%_gpg_path" $PWD"/gnupg" >> ~/.rpmmacros
echo "%vendor IVeS" >> ~/.rpmmacros
make clean
#Import de la clef gpg IVeS
if [[ -z $1 || $1 -ne nosign ]]
then
svn export https://svn.ives.fr/svn-libs-dev/gnupg
fi
mkdir -p rpmbuild
mkdir -p rpmbuild/SOURCES
mkdir -p rpmbuild/SPECS
mkdir -p rpmbuild/BUILD
mkdir -p rpmbuild/SRPMS
mkdir -p rpmbuild/TMP
mkdir -p rpmbuild/RPMS
mkdir -p rpmbuild/RPMS/noarch
mkdir -p rpmbuild/RPMS/i386
mkdir -p rpmbuild/RPMS/x86_64
#Recuperation de la description du package
cd ./rpmbuild/SPECS/
cp ../../libbfcp-centos.spec .
cd ../../
#Cree le package
if [[ -z $1 || $1 -ne nosign ]]
then
rpmbuild -bb --sign $PWD/rpmbuild/SPECS/libbfcp-centos.spec
else
rpmbuild -bb $PWD/rpmbuild/SPECS/libbfcp-centos.spec
fi
if [ $? == 0 ]
then
echo "************************* fin du rpmbuild ****************************"
#Recuperation du rpm (i386 absent sur almalinux 9 / rhel 9)
mv -f $PWD/rpmbuild/RPMS/i386/*.rpm $PWD/. 2>/dev/null
mv -f $PWD/rpmbuild/RPMS/x86_64/*.rpm $PWD/. 2>/dev/null
fi
clean
}
function clean
{
# On efface les liens ainsi que le package precedemment cr��
echo Effacement des fichiers et liens gnupg rpmbuild ${PROJET}.rpm ${TEMPDIR}/${PROJET}
rm -rf gnupg rpmbuild ${TEMPDIR}/${PROJET}
make clean
}
case $1 in
"clean")
echo "Nettoyage des liens et du package crees par la cible dev"
clean ;;
"rpmInstall")
#rpmInstall est appele automatiquement par le script de creation de rpm
echo "Copie des fichiers du rpm dans la localisation temporaire"
copy_rpmInstall $2;;
"rpm")
echo "Creation du rpm"
create_rpm $2 ;;
*)
echo "usage: install.ksh [options]"
echo "options :"
echo " rpm Create RPM package"
echo " clean Remove temporary compilation files as well as generated libraries";;
esac