source: extensions/jiwigo/trunk/install/create_executables.sh @ 7007

Last change on this file since 7007 was 7007, checked in by mlg, 14 years ago

changes the generation script :
variable names and comments in english.

File size: 2.9 KB
Line 
1#!/bin/bash
2## this script generates executables for jiwigo
3## to use it, you have to download the "work" directory
4## here : http://www.le-guevel.com/jiwigo/downloads/work.tar.gz
5## you just have to change work_path to indicate the path to "work"
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 writter in the install file of the project : install/install.txt
9## all the generated files will be moved to the "generation" directory.
10work_path='/home/mael/Documents/Jiwigo/travail'
11project_path='/home/mael/workspace/jiwigo'
12target_path=$project_path/target
13
14###############################################################################################
15#####################           building deb                     ##############################
16###############################################################################################
17
18#Calculate size and version to complete debian's control file
19size=`du -cs jiwigo`
20size=`echo $size | cut -d ' ' -f 1`
21version=`find $target_path -type f -name \*with-dependencies.jar | xargs -I file echo file | cut -d '-' -f 2`
22cp $work_path/control $work_path/temp
23echo Version: $version >> $work_path/temp
24echo Installed-Size: $size >> $work_path/temp
25rm $work_path/jiwigo/DEBIAN/control
26mv temp $work_path/jiwigo/DEBIAN/control
27
28#copies sources
29rm -rf $work_path/jiwigo/usr/share/jiwigo/src/src-jiwigo/*
30cp -r $project_path/src/* $work_path/jiwigo/usr/share/jiwigo/src/src-jiwigo/
31
32#copies the jar
33rm $work_path/jiwigo/usr/share/jiwigo/jiwigo.jar
34find $target_path -type f -name \*with-dependencies.jar -exec cp {} $work_path/jiwigo/usr/share/jiwigo/jiwigo.jar \;
35
36#delete temporary files
37find "$work_path" | egrep "~$" | perl -n -e 'system("rm $_");'
38
39#changes current directory
40cd "$work_path"
41
42#makes deb
43dpkg-deb --build jiwigo
44
45rm "$work_path/depot/jiwigo.deb"
46rm "$work_path/depot/Packages.gz"
47#moves deb
48mv -f "$work_path/jiwigo.deb" "$work_path/depot/jiwigo.deb"
49
50#makes Packages.gz
51cd "$work_path/depot"
52dpkg-scanpackages . /dev/null | gzip - > Packages.gz
53
54
55###############################################################################################
56#####################           Building    exe                  ##############################
57###############################################################################################
58
59$work_path/launch4j/launch4j $work_path/launch4j.xml
60
61###############################################################################################
62#####################           completes generation folder      ##############################
63###############################################################################################
64
65rm $work_path/generation/*
66cp $work_path/jiwigo.exe $work_path/generation/
67cp $work_path/depot/jiwigo.deb $work_path/generation/
68cp $work_path/jiwigo/usr/share/jiwigo/jiwigo.jar $work_path/generation/
69tar -zcf $work_path/generation/jiwigo-src.tar.gz $project_path/src/*
Note: See TracBrowser for help on using the repository browser.