Added SYLPH_APP_NAME for application name detection
[libs.git] / developers.sh
blob0f6d60d41cc268a1e521d46f0b0b339aea05e1c8
1 #!/bin/bash
2 #
3 # File: developers.sh
4 # Author: SeySayux
7 log() {
8 echo $@ >&2
11 do-git() {
12 #prepare for GIT
13 cat > README-GIT << EOT
14 You have checked out the current master branch from Git. Code from Git does
15 not always compile or can be incomplete.
16 EOT
17 if [ "$1" == "compile" ]; then
18 cat >> README-GIT << EOT
19 However, current code seems to compile. Be warned that it may still have many
20 bugs, or can be simply incomplete. If you want to have working code, please
21 check out the latest relase from the 'unstable' branch.
22 EOT
23 else
24 cat >> README-GIT << EOT
25 GIT is currently known to be broken. Please check out the latest release from
26 the 'unstable' branch.
27 EOT
29 cat >> README-GIT << EOT
31 For instructions on building and installing, please see the README file in this
32 directory. You might need to recreate the src/SourcesList.txt files. In order to
33 do so, please run:
35 ./developers.sh cmake
37 This will create the required files for the build.
38 EOT
42 do-cmake() {
43 log Creating/updating SourcesList.txt...
44 pushd src
45 echo '# This file is automatically generated by developers.sh in' \
46 >> SourcesList.txt
47 echo '# the main source directory. DO NOT EDIT MANUALLY!' >> SourcesList.txt
48 echo >> SourcesList.txt
49 echo 'SET ( SYLPH_ALL_SRC ' >> SourcesList.txt
51 for x in `find * | grep '\.cpp$'`; do
52 echo -n "$x " >> SourcesList.txt
53 done
55 echo ' )' >> SourcesList.txt
56 popd
58 pushd test
59 echo '# This file is automatically generated by developers.sh in' \
60 >> SourcesList.txt
61 echo '# the main source directory. DO NOT EDIT MANUALLY!' >> SourcesList.txt
62 echo >> SourcesList.txt
63 echo 'SET ( STEST_ALL_SRC ' >> SourcesList.txt
65 for x in `find * | grep '\.cpp$'`; do
66 echo -n "$x " >> SourcesList.txt
67 done
69 echo ' )' >> SourcesList.txt
70 popd
71 log 'Done!'
74 do-release() {
75 if [ -z "$1" ]; then error; fi
76 log Preparing for release "$1" of LibSylph...
77 log Cleaning SVN stuff...
78 rm -f README-SVN
79 find . -name '.svn' -exec rm -rf '{}' \;
80 log Creating CMake stuff
81 do-cmake
82 log Cleaning build...
83 make clean
84 log Removing old builds
85 for x in `ls | grep "^libsylph-.*-src.tar.bz2$"`; do
86 rm -v $x;
87 done;
88 log Creating tarball in parent directory...
89 pushd ..
90 cp sylph libsylph-"$1"-src
91 tar cjf libsylph-"$1"-src libsylph-"$1"-src.tar.bz2
92 rm -rf libsylph-"$1"-src
93 popd
94 log Removing this script '('don\'t worry, it\'s up in SVN')'...
95 rm -f developers.sh
96 log 'Done!'
99 error() {
100 echo "Syntax error."
101 exit 1
104 case "$1" in
105 git)
106 case "$2" in
107 compile|nocompile)
108 do-git "$2"
111 error
113 esac
115 cmake)
116 do-cmake
118 release)
119 do-release "$1"
122 echo 'This script contains several useful functions for the libsylph devs.'
124 esac