Added internal-lirc-backend and stuff.
[irreco.git] / script / irtrans.sh
bloba633d9a5f9b0a3e60f938018521a32fc102b960b
1 #!/bin/bash
2 cd `dirname "$0"`
3 source variables.sh
4 scratchbox_need
5 find_irtrans_dir
7 irtrans_main()
9 COMMAND="$1"
11 if [[ "$COMMAND" == "" ]]; then
12 echo "Error: You did not give me a command to run!"
13 irtrans_usage
14 exit 1
17 cd "$IRTRANS_DIR"
18 check_exit_code "$?"
20 ARGS=("$@")
21 case "$COMMAND" in
22 --install|makeinst|inst) irtrans_install "${ARGS[@]:1}";;
23 # --makeinst|makeinst) irtrans_makeinst "${ARGS[@]:1}";;
24 # --make|make) irtrans_make "${ARGS[@]:1}";;
25 # --install|install|inst) irtrans_install "${ARGS[@]:1}";;
26 --clean|clean) irtrans_clean "${ARGS[@]:1}";;
27 # --test|test) irtrans_test "${ARGS[@]:1}";;
28 *) echo "Error: Unknown command \"$COMMAND\"";
29 irtrans_usage;
30 exit 1;;
31 esac
34 irtrans_usage()
36 echo "Usage: $SCRIPT_NAME COMMAND"
37 echo ""
38 echo "Commands:"
39 echo " --makeinst | makeinst"
40 echo " Installs irtrans to irreco tmp install directory"
41 echo " You still need to run \"backend.sh irtrans inst\" to install irtrans backend"
42 # echo ""
43 # echo " --install | install | inst"
44 # echo " Run make for irtrans if needed"
45 # echo " copy libIRTrans.so to $INSTALL_DIR/lib"
46 # echo " copy irserver to $INSTALL_DIR/bin"
47 # echo " Run autogen.sh for irreco-backend-irtrans if needed"
48 # echo " Run configure.sh for irreco-backend-irtrans if needed"
49 # echo " Run make for irreco-backend-irtrans"
50 # echo " Run make install for irreco-backend-irtrans"
51 # echo ""
52 echo " --clean|clean"
53 echo " Run \"make clean\" for irserver and shlib"
54 echo " And removes .debs and .changes from irtrans dir"
55 echo ""
58 irtrans_install()
60 irtrans_print_title "Add to PKG_CONFIG_PATH ../../install/lib/pkgconfig/"
61 export PKG_CONFIG_PATH=../../install/lib/pkgconfig/:$PKG_CONFIG_PATH
63 irtrans_print_title "Make install irserver"
64 cd "$IRTRANS_IRSERVER_DIR/src"
65 check_exit_code "$?"
67 make irservern800_noccf
68 make install2
70 irtrans_print_title "Create modified irtrans_shlib.pc"
71 cd "$IRTRANS_SHLIB_DIR/pkg"
72 check_exit_code "$?"
74 mkdir ../../../install
75 mkdir ../../../install/lib
76 mkdir ../../../install/lib/pkgconfig/
77 mkdir ../../../install/include
78 mkdir ../../../install/include/irtrans
79 mkdir ../../../install/include/irtrans/shlib
81 echo "prefix=$INSTALL_DIR" > ../../../install/lib/pkgconfig/irtrans_shlib.pc
82 cat template.pc >> ../../../install/lib/pkgconfig/irtrans_shlib.pc
84 irtrans_print_title "make libIRTrans.so and copy headers"
85 cd "$IRTRANS_SHLIB_DIR/src"
86 check_exit_code "$?"
88 make libIRTrans.so
89 cp -v libIRTrans.so ../../../install/lib/libIRTrans.so
90 cp -v *.h ../../../install/include/irtrans/shlib/
95 #irtrans_make()
97 # match_sb_target "$SCRIPT_TMP_DIR/irtrans_sb_target"
98 # if [[ "$?" != "0" ]]; then
99 # irtrans_print_title "MAKE"
101 # cd "$IRTRANS_DIR"
102 # check_exit_code "$?"
104 # make clean
105 # check_exit_code "$?"
107 # #make $@
108 # make irtrans_noccf
109 # check_exit_code "$?"
111 # make install_sdk
112 # check_exit_code "$?"
114 # cd "$OLDPWD"
115 # check_exit_code "$?"
116 # fi
119 #irtrans_makeinst()
121 # irtrans_print_title "irserver debbing"
122 # cd "$IRTRANS_SHLIB_DIR"
123 # check_exit_code "$?"
124 # dpkg-buildpackage -rfakeroot -b
125 # check_exit_code "$?"
127 # irtrans_print_title "shlib debbing"
128 # cd "$IRTRANS_IRSERVER_DIR"
129 # check_exit_code "$?"
130 # dpkg-buildpackage -rfakeroot -b
131 # check_exit_code "$?"
133 # irtrans_print_title "dpkg'ing debs"
134 # cd "$IRTRANS_DIR"
135 # dpkg -i irtrans-irserver_*.deb
136 # check_exit_code "$?"
137 # dpkg -i irtrans-shlib_*.deb
138 # check_exit_code "$?"
139 # dpkg -i irtrans-shlib-dev_*.deb
140 # check_exit_code "$?"
142 # echo ""
143 # echo "Irserver and libIRTrans (aka. shlib) on place"
144 # echo "Now just remember to install backend"
145 # echo ""
147 # exit 1
150 #irtrans_backend_conf()
152 # create_install_dir
154 # if [ -e './autogen.sh' ]; then
155 # irtrans_print_title "BACKEND AUTOGEN"
156 # ./autogen.sh
157 # check_exit_code "$?"
158 # fi
160 # irtrans_print_title "BACKEND CONFIGURE"
162 # PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$INSTALL_DIR/lib/pkgconfig ./configure \
163 # --with-irtrans=$IRTRANS_DIR/irtransdll --prefix=$INSTALL_DIR --enable-debug=yes "$@"
164 # check_exit_code "$?"
167 # irtrans_install()
169 # if [ ! -e "$IRTRANS_SHLIB_DIR/libIRTrans.so" ] || \
170 # [ ! -e "$IRTRANS_IRSERVER_DIR/irserver" ]; then
171 # irtrans_make
172 # fi
173 # cp -v "$IRTRANS_SHLIB_DIR/libIRTrans.so" "$INSTALL_DIR/lib"
174 # cp -v "$IRTRANS_IRSERVER_DIR/irserver" "$INSTALL_DIR/bin"
176 # cd "$BACKEND_DIR/irtrans"
177 # check_exit_code "$?"
179 # if [ ! -e "Makefile" ]; then
180 # irtrans_backend_conf
181 # fi
183 # irtrans_print_title "BACKEND MAKE"
184 # generic_make
185 # irtrans_print_title "BACKEND MAKE INSTALL"
186 # make install
187 # cd "$OLDPWD"
190 irtrans_clean()
192 irtrans_print_title "MAKE CLEAN"
193 cd "$IRTRANS_SHLIB_DIR/src"
194 make clean
195 cd "$IRTRANS_IRSERVER_DIR/src"
196 make clean
198 # irtrans_print_title "rm debs"
199 # cd "$IRTRANS_DIR"
200 # rm -rf irtrans-irserver_*.*
201 # rm -rf irtrans-shlib*.*
203 # echo ""
204 # echo "Irserver and shlib removed"
205 # echo "You may uninstall irtrans things with this:"
206 # echo "dpkg --remove irtrans-shlib-dev irtrans-shlib irtrans-irserver"
208 # rm "$SCRIPT_TMP_DIR/irtrans_sb_target"
209 # cd "$IRTRANS_DIR"
210 # make clean
211 # cd "$OLDPWD"
212 # irtrans_print_title "BACKEND CLEAN"
213 # cd "$BACKEND_DIR/irtrans"
214 # make clean
215 # ./autoclean.sh
216 # cd "$OLDPWD"
219 irtrans_print_title()
221 print_title "IRTRANS $1"
224 irtrans_main "$@"