forked from mirror/x264
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ksh
More file actions
executable file
·112 lines (105 loc) · 3.1 KB
/
Copy pathinstall.ksh
File metadata and controls
executable file
·112 lines (105 loc) · 3.1 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
#Nom du paquetage
PROJET=x264
VERSION=0.8.0
#Repertoire temporaire utiliser pour preparer les packages
TEMPDIR=/tmp
function svn_export
{
svn export http://svn.ives.fr/svn-libs-dev/asterisk/libsmedia/${PROJET}
}
#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 "%_prefix" "/usr" >> ~/.rpmmacros
echo "%_version" $VERSION >> ~/.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
#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/i686
mkdir -p rpmbuild/RPMS/i586
#Recuperation de la description du package
cd ./rpmbuild/SPECS/
cp ../../${PROJET}.spec ${PROJET}.spec
cd ../../
# we remove the tag locally
# git tag -d $VERSION
# we recover latest tags
git reset --hard
#git checkout -b $VERSION $VERSION
#git status | grep nothing
echo "Ok"
if [ $? == 0 ]
then
#Cree le package
if [[ -z $1 || $1 -ne nosign ]]
then
rpmbuild -bb --sign $PWD/rpmbuild/SPECS/${PROJET}.spec
else
rpmbuild -bb $PWD/rpmbuild/SPECS/${PROJET}.spec
fi
if [[ $? -eq 0 ]]
then
echo "************************* fin du rpmbuild ****************************"
#Recuperation du rpm
mv -f $PWD/rpmbuild/RPMS/i386/*.rpm $PWD/.
mv -f $PWD/rpmbuild/RPMS/i586/*.rpm $PWD/.
mv -f $PWD/rpmbuild/RPMS/i686/*.rpm $PWD/.
mv -f $PWD/rpmbuild/RPMS/x86_64/*.rpm $PWD/.
clean
else
echo "** build failed **"
clean
exit 20
fi
else
clean
echo "*** error during build - some source files are not commited ***"
exit 20
fi
}
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 ${PROJET}.rpm ${TEMPDIR}/${PROJET}
#we clean the repo git
# git checkout master
# git pull
#we delete the branch no longer used
#git branch -D $VERSION
}
case $1 in
"clean")
echo "Nettoyage des liens et du package crees par la cible dev"
clean ;;
"rpm")
echo "Creation du rpm"
create_rpm $2;;
*)
echo "usage: install.ksh [options]"
echo "options :"
echo " rpm Generation d'un package rpm"
echo " clean Nettoie tous les fichiers cree par le present script, liens, tar.gz et rpm";;
esac