Subversion Repositories se3

Rev

Rev 4320 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
27 wawa 1
#!/bin/bash
2
 
3
# Patchage des numeros de versions
4
 
5
VERSION=$1
468 wawa 6
DISTRIB=$2
2891 keyser 7
BRANCHE=$3
8
 
4322 keyser 9
if ([ -z "$VERSION" ] || [ -z "$DISTRIB" ] || [ -z "$BRANCHE" ]); then
4320 keyser 10
echo "$0 version, distrib, branche (stable ou xp)"
11
echo "ex : $0 1.20 lenny xp"
4322 keyser 12
exit 1
4320 keyser 13
fi
2891 keyser 14
 
4320 keyser 15
 
16
[ "$BRANCHE" == "" -o "$BRANCHE" != "stable" ] && OPT="XP"
17
 
468 wawa 18
if [ -z "$DISTRIB" ]; then
2888 keyser 19
        DISTRIB="etch"
2954 keyser 20
        echo "etch choisi par dťfaut, OK ?"
2888 keyser 21
        read dummy
22
 
468 wawa 23
fi
27 wawa 24
 
25
if [ -d build ]; then
26
        rm -r build
27
fi
28
mkdir build
28 wawa 29
cp -r se3master/* build
27 wawa 30
cd build
31
../svnrmadm
32
MAJNB=48
33
while true; do
34
        if [ ! -e var/cache/se3_install/maj/maj$MAJNB.sh ]; then
35
                break
36
        fi
37
        let MAJNB+=1
38
done
39
 
468 wawa 40
mv DEBIAN/control.$DISTRIB ctrl
41
rm DEBIAN/control.*
4320 keyser 42
# mv DEBIAN/postinst.$DISTRIB DEBIAN/pst
43
# rm DEBIAN/postinst.*
44
# mv DEBIAN/pst DEBIAN/postinst
2888 keyser 45
 
27 wawa 46
cat ctrl | sed -e "s/#VERSION#/$VERSION/g"> DEBIAN/control
47
mv var/cache/se3_install/se3db.sql se3db.sql
48
cat se3db.sql | sed -e "s/#VERSION#/$VERSION/g" | sed -e "s/#MAJNBR#/$MAJNB/g" > var/cache/se3_install/se3db.sql
49
rm  ctrl se3db.sql
50
 
51
echo "Version $VERSION du "`date` > var/cache/se3_install/version
52
 
53
# Remise en place des droits sur les fichiers
54
 
896 wawa 55
chmod -R 755 DEBIAN
56
chmod -R 750 var/cache/se3_install
71 wawa 57
chmod 644 var/cache/se3_install/conf/*
79 wawa 58
chmod 644 var/cache/se3_install/reg/*
71 wawa 59
chmod 755 var/cache/se3_install/conf/apachese
60
chmod 600 var/cache/se3_install/conf/config.inc.php.in
61
chmod 600 var/cache/se3_install/conf/SeConfig.ph.in
62
chmod 600 var/cache/se3_install/conf/slapd_*.in
63
chmod 640 var/cache/se3_install/conf/mrtg.cfg
51 wawa 64
chmod 440 var/cache/se3_install/conf/sudoers
27 wawa 65
 
900 wawa 66
# Changement des fins de lignes dos
67
 
906 wawa 68
dos2unix var/cache/se3_install/scripts/*.sh
69
dos2unix var/cache/se3_install/scripts/*.pl
70
dos2unix var/cache/se3_install/sudoscripts/*.sh
71
dos2unix var/cache/se3_install/sudoscripts/*.pl
900 wawa 72
 
2890 keyser 73
# tratement utf8 pour etch 
4322 keyser 74
#if [ "$DISTRIB" == "etch" ]; then
75
#       rm var/cache/se3_install/install_se3_lenny.sh
2890 keyser 76
 
4322 keyser 77
#else
78
#       rm var/cache/se3_install/install_se3_etch.sh
2890 keyser 79
 
4322 keyser 80
#fi
27 wawa 81
 
4320 keyser 82
echo "Modif vers utf8 pour etch / Lenny"
83
recode latin9..utf8 var/cache/se3_install/scripts/*.sh
84
recode latin9..utf8 var/cache/se3_install/sudoscripts/*.sh
85
recode latin9..utf8 var/cache/se3_install/*.sh
86
 
87
 
88
 
2898 keyser 89
# tratement utf8 pour etch 
27 wawa 90
cd var/cache/se3_install/wwwse3
2954 keyser 91
# if [ "$DISTRIB" == "etch" ]; then
92
# A=`find ./ -iname "*.inc" -o -iname "*.php" -o -iname "*.html" -type f`
93
#               for FICH in $A
94
#               do
95
#                       recode latin9..utf8 $FICH
96
#                       echo "$FICH-->ok"
97
#               done
98
# fi
2898 keyser 99
 
100
# Refabrication de l'archive wwwse3.tgz
27 wawa 101
tar -czf ../wwwse3.tgz se3
102
cd ..
103
rm -r wwwse3
104
cd ../../../..
105
 
2890 keyser 106
 
107
 
27 wawa 108
# Fabrication du paquet se3
468 wawa 109
dpkg-deb -b build se3_$VERSION$DISTRIB\_i386.deb
27 wawa 110
 
2891 keyser 111
if [ "$DISTRIB" == "etch" ]; then
112
        scp -P 2222 se3_${VERSION}etch_i386.deb root@wawadeb:/var/ftp/debian/dists/etch/se3$OPT/binary-i386/net/
113
else
4320 keyser 114
         scp -P 2222 se3_${VERSION}lenny_i386.deb root@wawadeb:/var/ftp/debian/dists/stable/se3$OPT/binary-i386/net/
4322 keyser 115
fi