OSDN Git Service

Add logic to display stacks in notebook tree
[neighbornote/NeighborNote.git] / package_scripts / tar / build.sh
1 #!/bin/sh
2
3 version="0.92.1"
4 arch="i386"
5 qtversion="4.5.2_01" 
6
7
8 package_dir=$(cd `dirname $0` && pwd)
9
10 destination="$package_dir/nevernote/usr/share/nevernote"
11 source_dir="../.."
12 qtlibs="../../../bitrock/lib"
13 qtarch="32"
14
15 if [ "$(id -u)" != "0" ]; then
16    echo "This script must be run as root" 1>&2
17    exit 1
18 fi
19
20 #Do any parameter overrides
21 while [ -n "$*" ]
22 do
23    eval $1
24    shift
25 done
26
27 if [ "$arch" = "amd64" ]; then
28   qtarch="64"
29 fi
30
31
32 # Cleanup any old stuff
33
34 if [ -e "$package_dir/nevernote-${version}_${arch}.tar.gz" ] 
35 then
36    rm $package_dir/nevernote-${version}_${arch}.tar.gz
37 fi
38
39 ############################
40 # Copy the things we need  #
41 ############################
42
43 # Create directories
44 mkdir $package_dir/nevernote
45 mkdir $package_dir/nevernote/usr/
46 mkdir $package_dir/nevernote/usr/share
47 mkdir $package_dir/nevernote/usr/share/applications
48 mkdir $package_dir/nevernote/usr/share/nevernote
49
50 # Copy startup script & images
51 cp $source_dir/install.sh $package_dir/nevernote/
52 cp $source_dir/*.sh $package_dir/nevernote/usr/share/nevernote/
53 cp $source_dir/*.txt $package_dir/nevernote/usr/share/nevernote/
54 cp $source_dir/*.html $package_dir/nevernote/usr/share/nevernote/
55 cp $source_dir/*.png $package_dir/nevernote/usr/share/nevernote/
56 cp $source_dir/nevernote.desktop $package_dir/nevernote/usr/share/applications
57
58 # Copy subdirectories
59 cp -r $source_dir/images $package_dir/nevernote/usr/share/nevernote/
60 cp -r $source_dir/lib $package_dir/nevernote/usr/share/nevernote/
61 cp -r $source_dir/qss $package_dir/nevernote/usr/share/nevernote/
62 cp -r $source_dir/spell $package_dir/nevernote/usr/share/nevernote/
63 cp -r $source_dir/translations $package_dir/nevernote/usr/share/nevernote/
64 cp -r $source_dir/xml $package_dir/nevernote/usr/share/nevernote/
65
66
67 # Copy QT libraries.
68 cp $qtlibs/qtjambi-linux$qtarch-$qtversion.jar $package_dir/nevernote/usr/share/nevernote/lib/
69 cp $qtlibs/qtjambi-linux$qtarch-gcc-$qtversion.jar $package_dir/nevernote/usr/share/nevernote/lib/
70
71 # Copy NeverNote itself
72 cp $qtlibs/../nevernote.jar $package_dir/nevernote/usr/share/nevernote/
73
74 # Reset user permissions
75 chown -R root:root $package_dir/nevernote/
76
77 cd $package_dir
78 tar -czf $package_dir/nevernote-${version}_${arch}.tar.gz ./nevernote
79 cd -
80
81 # Cleanup
82 rm -rf $package_dir/nevernote
83