gerar.sh 1.19 KB
Newer Older
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
#!/bin/bash
# gerar.sh
# Copyright (c) 2006 by Bruno Ribas <ribas@ufpr.br>

DIRTMP=$(mktemp -d)
VERSAO=$(cat VERSAO)

#arrumar versao
#$1 tipo de incremento
MAJOR=$(echo $VERSAO| cut -d'.' -f1)
MINOR=$(echo $VERSAO| cut -d'.' -f2)
REVISION=$(echo $VERSAO| cut -d'.' -f3)

case $1 in
	Minor)
		((MINOR++))
		REVISION=0
		;;
	Major)
		((MAJOR++))
		MINOR=0
		REVISION=0
		;;
	help)
		echo "Uso: $0 Major|Minor|Revision"
		echo '     Major - Altera versao Major'
		echo '     Minor - Altera versao Minor'
		exit
		;;
	*)
		((REVISION++))
		;;
esac

35

36

37 38 39 40 41 42 43 44 45 46 47
VERSAO="${MAJOR}.${MINOR}.${REVISION}"
echo "$VERSAO" > VERSAO
		

#Compila a documentacao do pacote no diretorio doc/
#cd doc/
#hevea -text *.tex 
#hevea -text *.tex 
#cd ../

cp -r pacote $DIRTMP
48 49
cp le-proinfodata-deb.sh $DIRTMP
cp -r ../le-proinfodata $DIRTMP
50 51 52 53 54

#Copia a documentacao compilada para dentro do pacote.
#cp doc/*.txt $DIRTMP/pacote/usr/share/doc/prd-* 

cd $DIRTMP
55 56 57 58

# Gera o le-proinfodata.deb
./le-proinfodata-deb.sh

59 60 61 62 63 64 65 66 67 68 69
find . -name ".svn" -exec rm -rf {} \; &>/dev/null
sed -i -e "s/Version:/Version: $VERSAO/" pacote/DEBIAN/control

fakeroot dpkg -b pacote .

cd -

cp $DIRTMP/*deb .
rm -rf $DIRTMP

# vim:tabstop=4:shiftwidth=4:encoding=iso-8859-1