root/extensions/jiwigo/trunk/install/create_executables.sh @ 7006

Revision 7006, 3.0 KB (checked in by mlg, 3 years ago)

adds a script to generate the executables under a GNU/Linux environnement.
It generates .exe file and deb and copies the exe, deb, jar, src.tar.gz in a separate folder. The mvn jar command must be run before launching this script, and
the file  http://www.le-guevel.com/jiwigo/downloads/travail.tar.gz must be downloaded and extracted.
Then two variables of the script should be changed :
travail_path and project_path
The script does not take parameters.

Line 
1#!/bin/bash
2## this script generates executables for jiwigo
3## to use it, you have to download the "travail" directory
4## here : http://www.le-guevel.com/jiwigo/downloads/travail.tar.gz
5## you just have to change travail_path to indicate the path to "travail"
6## and "project_path" to the path of the project.
7## you have to run the mvn jar command before launching this script
8## the mvn command is written in the install file of the project : install.txt
9## all the generated files will be moved to the "generation" directory.
10travail_path='/home/mael/Documents/Jiwigo/travail'
11project_path='/home/mael/workspace/jiwigo'
12target_path=$project_path/target
13
14###############################################################################################
15#####################           Construction du deb              ##############################
16###############################################################################################
17
18#calcul de la taille et de la version, pour compléter le fichier control de debian
19taille=`du -cs jiwigo`
20taille=`echo $taille | cut -d ' ' -f 1`
21version=`find $target_path -type f -name \*with-dependencies.jar | xargs -I file echo file | cut -d '-' -f 2`
22cp $travail_path/control $travail_path/temp
23echo Version: $version >> $travail_path/temp
24echo Installed-Size: $taille >> $travail_path/temp
25rm $travail_path/jiwigo/DEBIAN/control
26mv temp $travail_path/jiwigo/DEBIAN/control
27
28#copie des sources
29rm -rf $travail_path/jiwigo/usr/share/jiwigo/src/src-jiwigo/*
30cp -r $project_path/src/* $travail_path/jiwigo/usr/share/jiwigo/src/src-jiwigo/
31
32#copie du jar
33rm $travail_path/jiwigo/usr/share/jiwigo/jiwigo.jar
34find $target_path -type f -name \*with-dependencies.jar -exec cp {} $travail_path/jiwigo/usr/share/jiwigo/jiwigo.jar \;
35
36#suppression des fichiers temporaires
37find "$travail_path" | egrep "~$" | perl -n -e 'system("rm $_");'
38
39#changement du répertoire
40cd "$travail_path"
41
42#construction du deb
43dpkg-deb --build jiwigo
44
45rm "$travail_path/depot/jiwigo.deb"
46rm "$travail_path/depot/Packages.gz"
47#déplacement du deb
48mv -f "$travail_path/jiwigo.deb" "$travail_path/depot/jiwigo.deb"
49
50#construction de Packages.gz
51cd "$travail_path/depot"
52dpkg-scanpackages . /dev/null | gzip - > Packages.gz
53
54
55###############################################################################################
56#####################           Construction du exe              ##############################
57###############################################################################################
58
59$travail_path/launch4j/launch4j $travail_path/launch4j.xml
60
61###############################################################################################
62#####################           du dossier de generation         ##############################
63###############################################################################################
64
65rm $travail_path/generation/*
66cp $travail_path/jiwigo.exe $travail_path/generation/
67cp $travail_path/depot/jiwigo.deb $travail_path/generation/
68cp $travail_path/jiwigo/usr/share/jiwigo/jiwigo.jar $travail_path/generation/
69tar -zcf $travail_path/generation/jiwigo-src.tar.gz $project_path/src/*
Note: See TracBrowser for help on using the browser.