OSDN Git Service

68a1e3a6aaea1350e9809ad69a3e712ca8b58889
[neighbornote/NeighborNote.git] / package_scripts / tar / build.sh
1 #!/bin/sh
2
3 version="1.1"
4 arch="i386"
5 qtversion="4.5.2_01" 
6
7
8 package_dir=$(cd `dirname $0` && pwd)
9
10 destination="$package_dir/nixnote/usr/share/nixnote"
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/nixnote-${version}_${arch}.tar.gz" ] 
35 then
36    rm $package_dir/nixnote-${version}_${arch}.tar.gz
37 fi
38
39 ############################
40 # Copy the things we need  #
41 ############################
42
43 # Create directories
44 mkdir $package_dir/nixnote
45 mkdir $package_dir/nixnote/usr/
46 mkdir $package_dir/nixnote/usr/share
47 mkdir $package_dir/nixnote/usr/share/applications
48 mkdir $package_dir/nixnote/usr/share/nixnote
49 mkdir $package_dir/nixnote/usr/share/man
50 mkdir $package_dir/nixnote/usr/bin/
51
52
53 # Copy startup script & images
54 cp $source_dir/install.sh $package_dir/nixnote/
55 cp $source_dir/*.sh $package_dir/nixnote/usr/share/nixnote/
56 cp $source_dir/*.txt $package_dir/nixnote/usr/share/nixnote/
57 cp $source_dir/*.html $package_dir/nixnote/usr/share/nixnote/
58 cp $source_dir/*.png $package_dir/nixnote/usr/share/nixnote/
59 cp $source_dir/nixnote.desktop $package_dir/nixnote/usr/share/applications
60 cp $source_dir/nixnote_path.sh $package_dir/nixnote/usr/bin/nixnote.sh
61
62 # Copy subdirectories
63 cp -r $source_dir/images $package_dir/nixnote/usr/share/nixnote/
64 cp -r $source_dir/lib $package_dir/nixnote/usr/share/nixnote/
65 cp -r $source_dir/qss $package_dir/nixnote/usr/share/nixnote/
66 cp -r $source_dir/spell $package_dir/nixnote/usr/share/nixnote/
67 cp -r $source_dir/translations $package_dir/nixnote/usr/share/nixnote/
68 cp -r $source_dir/xml $package_dir/nixnote/usr/share/nixnote/
69
70
71 # Copy QT libraries.
72 cp $qtlibs/qtjambi-linux$qtarch-$qtversion.jar $package_dir/nixnote/usr/share/nixnote/lib/
73 cp $qtlibs/qtjambi-linux$qtarch-gcc-$qtversion.jar $package_dir/nixnote/usr/share/nixnote/lib/
74
75 # Copy NixNote itself
76 cp $qtlibs/../nixnote.jar $package_dir/nixnote/usr/share/nixnote/
77
78 # Reset user permissions
79 chown -R root:root $package_dir/nixnote/
80
81 cd $package_dir
82 tar -czf $package_dir/nixnote-${version}_${arch}.tar.gz ./nixnote
83 cd -
84
85 # Cleanup
86 rm -rf $package_dir/nixnote
87