-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpmFactory
executable file
·77 lines (65 loc) · 2.55 KB
/
rpmFactory
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
#!/bin/bash
#------------------------------------------------------------------------------
#
# 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.
#
#------------------------------------------------------------------------------
printUsage() {
echo "rpmFactory works with config file calledbuild.sh."
echo "rpmFactory builds RPM, pushes RPM on YUM repositories if asked"
exit 0
}
if [[ "$VERBOSE" && "$VERBOSE" -eq "1" ]]; then
VERBOSE="-v"
else
VERBOSE=""
fi
if [[ "$NODOC" && "$NODOC" -eq "1" ]]; then
NODOC="-n"
else
NODOC=""
fi
if [[ "$NOCONFIG" && "$NOCONFIG" -eq "1" ]]; then
NOCONFIG="-c"
else
NOCONFIG=""
fi
if [[ "$NOSTRIP" && "$NOSTRIP" -eq "1" ]]; then
NOSTRIP="-i"
else
NOSTRIP=""
fi
[ -n "$ARCHI" ] || ARCHI=`arch`
#[ -n "$ARCHI" ] || ARCHI=noarch
[ -n "$LTOPDIR" ] || LTOPDIR=/usr/src/redhat
[ -n "$SDIR" ] || SDIR=SRPMS
[ -n "$BDIR" ] || BDIR=RPMS/$ARCHI
[ -n "$SPECDIR" ] || SPECDIR=SPECS
[ -n "$X64DIR" ] || X64DIR=RPMS/x86_64
[ -n "$MYRPM" ] || MYRPM="sudo perl $HOME/myrpm/myrpm/myrpm"
#Overloading EXCLUDE FILE
if [[ "$OVERLOADING_EXCLUDE" -eq "0" ]]; then
EXCLUDE="etc\/httpd$,etc\/httpd\/conf\.d$,var$,var/www$,var/www/html$,log_convertPropsFiles.txt$,packaging.log$,opt$,opt/ciweb2g$,opt/ciweb2g/applis$,opt/ciweb2g/products$,opt/ciweb2g/applis/webapps$,opt/ciweb2g/applis/current/webapps$,opt/ciweb2g/applis/current$,etc$,etc/init.d$,etc/rc.d$,etc/rc.d/init.d$,usr$,usr/local$,build.sh$,pre.sh$,post.sh$,\.rpm$,\.tar\.gz$,$EXCLUDE"
else
echo "EXCLUDE: $EXCLUDE"
fi
[ -n "$REQUIRES" ] && REQUIRES="--requires $REQUIRES"
[ -n "$PROVIDES" ] && PROVIDES="--provides $PROVIDES"
#echo "REQUIRES : $REQUIRES"
$MYRPM -A $ARCHI -N $APPLI -V $VERSION -R $RELEASE -S "$SUMMARY" -D "$DESCRIPTION" $VERBOSE $NOCONFIG $NOSTRIP $NODOC -b -d . -r . -x "$EXCLUDE" -C "$CHANGELOG" $REQUIRES $PROVIDES --pre-script="pre.sh" --post-script="post.sh" --preun-script="preun.sh" --postun-script="postun.sh"
cp $LTOPDIR/$SDIR/$APPLI*-$VERSION-$RELEASE.src.rpm .
cp $LTOPDIR/$BDIR/$APPLI*-$VERSION-$RELEASE.$ARCHI.rpm .
if [ "$1" == "--push" ]; then
. pushRpm $APPLI-$VERSION-$RELEASE.src.rpm $APPLI-$VERSION-$RELEASE.$ARCHI.rpm
fi
if [ "$1" == "--pushProd" ]; then
. pushRpmProd $APPLI-$VERSION-$RELEASE.src.rpm $APPLI-$VERSION-$RELEASE.$ARCHI.rpm
fi