-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmynstall
executable file
·130 lines (108 loc) · 3.04 KB
/
mynstall
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/sh
#------------------------------------------------------------------------------
#
# MyRPM - Rpm Utilities
# Copyright (c) Jean-Marie RENOUARD 2014 - LightPath
# Contact : Jean-Marie Renouard <jmrenouard at gmail.com>
#
# This program is open source, licensed under the Artistic Licence v2.0.
#
# Artistic Licence 2.0
# Everyone is permitted to copy and distribute verbatim copies of
# this license document, but changing it is not allowed.
#
#------------------------------------------------------------------------------
NAME="MYRPM INSTALLER"
VERSION="1.0"
BASEDIR=`dirname $0`
if [[ -z $BASEDIR || "$BASEDIR" = "" || "$BASEDIR" = "." ]]
then
BASEDIR=`pwd`;
fi
printInfo() {
zenity --info \
--window-icon=/dev/null \
--text="$1"
}
STDOUT=`mktemp`
zenity --title "$NAME - v$VERSION" \
--window-icon=/dev/null\
--list \
--checklist \
--column " " \
--column "Item" \
--column "Description" \
TRUE SUDOERS "Install Sudo configuration for you user" \
TRUE PMD "Perl modules dependencies, Perl modules needed by Myrpm to work" \
TRUE CMBS "Full script installation" \
TRUE RDE "Home RPM developement Environment installation" \
TRUE SRF "Sample RPM factory installation in \$HOME/integration" \
> $STDOUT
if grep "PMD" $STDOUT > /dev/null ; then
printInfo "Perl modules dependencies will be installed."
ARCHIVE_DIR="$BASEDIR/../dependencies"
MODULE_LIST="Getopt-Long-2.36
IO-Zlib-1.05
Archive-Tar-1.30
Text-Template-1.44"
cd $ARCHIVE_DIR
for ar in $MODULE_LIST
do
echo "INSTALLING PERL MODULE : $ar"
tar xzvf "$ar.tar.gz"
cd $ar
#install perl module
perl ./Makefile.PL
make
make test
if [ `whoami` == "root" ]; then
make install
else
printInfo "Root password required to install module $ar"
su -c 'make install'
fi
#cleaning the build module dir
cd ..
/bin/rm -Rf $ar
done
printInfo "Perl Module dependencies installed."
fi
cd $BASEDIR
createLocalBinPath() {
# script installation
[ -d $HOME/bin ] || (
mkdir $HOME/bin; \
echo "export PATH=\"$PATH:$HOME/bin\"" >> $HOME/.bashrc \
)
}
chexecLocalBinPath() {
#rights
chmod +x $HOME/bin/*
}
if grep "CMBS" $STDOUT > /dev/null ; then
printInfo "Full script installation."
createLocalBinPath
cp $BASEDIR/../shells/* $HOME/bin
chexecLocalBinPath
printInfo "Cluster suite installation finished."
fi
if grep "RDE" $STDOUT > /dev/null ; then
printInfo "Rpm environment installation."
# installation .rpmmacros
#cp conf/.rpmmacros $HOME
sh $BASEDIR/shells/rpmMacroConfig
# folder hierarchy
mkdir -p $HOME/redhat/{RPMS,SRPMS,SOURCES,SPECS,BUILD}
printInfo "Rpm environment installation finished"
fi
if grep "SRF" $STDOUT > /dev/null ; then
printInfo "Rpm factory sample installation."
# integration folder
mkdir -p $HOME/integration/sample_root
cp $BASEDIR/shells/sample_build.sh $HOME/integration/sample_root/build.sh
chmod +x $HOME/integration/sample_root/*
echo "#!/bin/sh" > $HOME/integration/sample_root/pre.sh
echo "#!/bin/sh" > $HOME/integration/sample_root/post.sh
printInfo "Rpm factory sample installation finished"
fi
exit 0