kivitendo/DEBIAN/mk_erp_deb.sh @ 38aac441
ba11416b | Holger Lindemann | #!/bin/bash
|
||
30c4906a | Sven Schöling | |||
ba11416b | Holger Lindemann | #Jedes neue Paket der gleichen Version bekommt eine eigene Nummer
|
||
NR="0"
|
||||
#hier wurde das Git-Paket entpakt:
|
||||
9e2386ab | Sven Schöling | SRC=/tmp/deb_test/unstable
|
||
30c4906a | Sven Schöling | |||
ba11416b | Holger Lindemann | #hier wird das Debian-Paket gebaut:
|
||
9e2386ab | Sven Schöling | DST=/tmp/deb_test/package
|
||
30c4906a | Sven Schöling | |||
################################################
|
||||
# ab hier keine Konfiguration mehr
|
||||
################################################
|
||||
9e2386ab | Sven Schöling | VER=`cat VERSION`
|
||
30c4906a | Sven Schöling | DEST=$DST/lx-office-erp_$VER-$NR-all
|
||
FILES='
|
||||
usr/lib/lx-office-erp/
|
||||
usr/share/lx-office-erp/
|
||||
usr/share/doc/lx-office-erp/
|
||||
var/lib/lx-office-erp/spool/
|
||||
var/lib/lx-office-erp/users/
|
||||
var/lib/lx-office-erp/css/
|
||||
var/lib/lx-office-erp/xslt/
|
||||
var/lib/lx-office-erp/templates/
|
||||
var/lib/lx-office-erp/webdav/lieferantenbestellungen/
|
||||
var/lib/lx-office-erp/webdav/anfragen/
|
||||
var/lib/lx-office-erp/webdav/gutschriften/
|
||||
var/lib/lx-office-erp/webdav/einkaufsrechnungen/
|
||||
var/lib/lx-office-erp/webdav/rechnungen/
|
||||
var/lib/lx-office-erp/webdav/bestellungen/
|
||||
var/lib/lx-office-erp/webdav/angebote/
|
||||
usr/lib/lx-office-erp/
|
||||
usr/share/lx-office-erp/
|
||||
usr/share/doc/lx-office-erp/
|
||||
usr/share/man/man1/:lx-office-erp.1.gz
|
||||
etc/lx-office-erp/:lx-office-erp.cherokee.handler
|
||||
etc/lx-office-erp/:lx-office-erp.apache2.conf
|
||||
etc/lx-office-erp/:lx-office-erp.cherokee
|
||||
usr/bin/:lx-office-erp
|
||||
'
|
||||
for filespec in $FILES; do
|
||||
set - `echo $filespec | sed -e 's/:/ /g'`
|
||||
dir=$1
|
||||
file=$2
|
||||
9e2386ab | Sven Schöling | mkdir -p $SRC/DEBIAN/$dir
|
||
if [ -f $SRC/DEBIAN/files/$file ]; then
|
||||
cp $SRC/DEBIAN/files/$file $SRC/DEBIAN/$dir/$file
|
||||
30c4906a | Sven Schöling | else
|
||
9e2386ab | Sven Schöling | echo '1' > $SRC/DEBIAN/$dir/.dummy
|
||
30c4906a | Sven Schöling | fi
|
||
done
|
||||
SYMLINKS='
|
||||
css:/var/lib/lx-office-erp/css
|
||||
doc:/usr/share/doc/lx-office-erp/
|
||||
image:/usr/share/lx-office-erp
|
||||
spool:/var/lib/lx-office-erp/spool
|
||||
templates:/var/lib/lx-office-erp/templates
|
||||
users:/var/lib/lx-office-erp/users/
|
||||
webdav:/var/lib/lx-office-erp/webdav
|
||||
xslt:/var/lib/lx-office-erp/xslt
|
||||
'
|
||||
for symspec in $SYMLINKS; do
|
||||
set - `echo $symspec | sed -e 's/:/ /g'`
|
||||
src=$1
|
||||
tar=$2
|
||||
9e2386ab | Sven Schöling | ln -s $tar $SRC/DEBIAN/usr/lib/lx-office-erp/$src
|
||
30c4906a | Sven Schöling | done
|
||
#fertig
|
||||
ba11416b | Holger Lindemann | |||
mkdir -p $DEST
|
||||
cd $DEST
|
||||
#Struktur anlegen:
|
||||
cp -a $SRC/DEBIAN/* .
|
||||
rm ./mk*.sh
|
||||
#Dateien kopieren:
|
||||
5cb95a53 | Holger Lindemann | #aber keine fertigen Konfigurationen, nur *.default
|
||
ba11416b | Holger Lindemann | cp -a $SRC/SL usr/lib/lx-office-erp
|
||
cp -a $SRC/bin usr/lib/lx-office-erp
|
||||
cp -a $SRC/js usr/lib/lx-office-erp
|
||||
cp -a $SRC/locale usr/lib/lx-office-erp
|
||||
cp -a $SRC/lxo-import usr/lib/lx-office-erp
|
||||
cp -a $SRC/modules usr/lib/lx-office-erp
|
||||
cp -a $SRC/scripts usr/lib/lx-office-erp
|
||||
cp -a $SRC/sql usr/lib/lx-office-erp
|
||||
cp -a $SRC/t usr/lib/lx-office-erp
|
||||
cp -a $SRC/*.pl usr/lib/lx-office-erp
|
||||
cp $SRC/VERSION usr/lib/lx-office-erp
|
||||
cp $SRC/index.html usr/lib/lx-office-erp
|
||||
5cb95a53 | Holger Lindemann | cp $SRC/config/lx-erp.conf etc/lx-office-erp/lx-erp.conf.default
|
||
cp $SRC/config/authentication.pl.default etc/lx-office-erp/
|
||||
cp $SRC/menu.ini usr/lib/lx-office-erp/menu.default
|
||||
ba11416b | Holger Lindemann | cp -a $SRC/css var/lib/lx-office-erp
|
||
cp -a $SRC/templates var/lib/lx-office-erp
|
||||
cp -a $SRC/users var/lib/lx-office-erp
|
||||
cp -a $SRC/xslt var/lib/lx-office-erp
|
||||
5cb95a53 | Holger Lindemann | cp -a $SRC/doc/* usr/share/doc/lx-office-erp/
|
||
cp -a $SRC/image/* usr/share/lx-office-erp/
|
||||
ba11416b | Holger Lindemann | |||
5cb95a53 | Holger Lindemann | #Git- und dummy-files löschen
|
||
37fe8e05 | Holger Lindemann | find . -name ".git*" -exec rm -rf {} \;
|
||
f0e64d77 | Holger Lindemann | find . -name ".dummy" -exec rm -rf {} \;
|
||
37fe8e05 | Holger Lindemann | |||
ba11416b | Holger Lindemann | #Rechte setzen
|
||
chown -R www-data: usr/lib/lx-office-erp
|
||||
chown -R www-data: var/lib/lx-office-erp
|
||||
5cb95a53 | Holger Lindemann | chown -R www-data: etc/lx-office-erp
|
||
ba11416b | Holger Lindemann | |||
#MD5 Summe bilden:
|
||||
find usr/ -name "*" -type f -exec md5sum {} \; > DEBIAN/md5sum
|
||||
find var/ -name "*" -type f -exec md5sum {} \; >> DEBIAN/md5sum
|
||||
find etc/ -name "*" -type f -exec md5sum {} \; >> DEBIAN/md5sum
|
||||
#Größe feststellen:
|
||||
SIZE=`du -scb . | grep insgesamt | cut -f1`
|
||||
#Controlfile updaten:
|
||||
cat DEBIAN/control | sed --expression "s/Installed-Size: 0/Installed-Size: $SIZE/g" > DEBIAN/1.tmp
|
||||
mv DEBIAN/1.tmp DEBIAN/control
|
||||
cat DEBIAN/control | sed --expression "s/Version: 0/Version: $VER-$NR/g" > DEBIAN/1.tmp
|
||||
mv DEBIAN/1.tmp DEBIAN/control
|
||||
5cb95a53 | Holger Lindemann | #Revisionsnummer evtl. von Hand eintragen
|
||
ba11416b | Holger Lindemann | |||
#Paket bauen:
|
||||
cd ..
|
||||
dpkg-deb --build lx-office-erp_$VER-$NR-all
|
||||
echo "Done"
|