Added internal-lirc-backend and stuff.
[irreco.git] / script / irreco.sh
bloba5ac62757068e5e5fc931b05bf09f600992dcd3d
1 #!/bin/bash
2 cd `dirname "$0"`
3 source variables.sh
4 scratchbox_need
6 irreco_main()
8 COMMAND="$1"
10 if [[ "$COMMAND" == "" ]]; then
11 echo "Error: You did not give me a command to run!"
12 irreco_usage
13 exit 1
16 cd "$IRRECO_DIR"
17 check_exit_code "$?"
19 ARGS=("$@")
20 case "$COMMAND" in
21 --config|config|conf) irreco_conf "${ARGS[@]:1}";;
22 --make|make) irreco_make "${ARGS[@]:1}";;
23 --install|install|inst) irreco_install "${ARGS[@]:1}";;
24 --clean|clean) irreco_clean "${ARGS[@]:1}";;
25 --src|src) irreco_src "${ARGS[@]:1}";;
26 *) echo "Error: Unknown command \"$COMMAND\"";
27 irreco_usage;
28 exit 1;;
29 esac
32 irreco_usage()
34 echo "Usage: $SCRIPT_NAME COMMAND [ options ]"
37 irreco_conf()
39 create_install_dir
41 irreco_print_title "AUTOGEN"
42 ./autogen.sh
43 check_exit_code "$?"
45 irreco_print_title "CONFIGURE"
46 ./configure --prefix="$INSTALL_DIR" --enable-debug=yes "$@" \
47 --enable-dev=yes --with-database="http://localhost/irreco/webdb/"
48 check_exit_code "$?"
50 "$SCRIPT_DIR"/fix-pkg-config.sh --path "$INSTALL_DIR"/lib
53 irreco_make()
55 if [ ! -e "Makefile" ]; then
56 irreco_conf
58 generic_make irreco_print_title "$@"
61 irreco_install()
63 irreco_make
64 irreco_print_title "INSTALL"
65 make install
66 check_exit_code "$?"
69 irreco_clean()
71 generic_clean irreco_print_title
75 # Prints a list of irreco sources and headers.
77 irreco_src()
79 irreco_print_title "CORE SOURCES"
80 echo -n "irreco_SOURCES = "
81 ls "$IRRECO_DIR"/src/core \
82 | egrep '\.[ch]$' | grep 'irreco.*' | scripts_src_pad
84 irreco_print_title "UTIL SOURCES"
85 echo -n "lib_irreco_util_la_SOURCES = "
86 ls "$IRRECO_DIR"/src/util \
87 | egrep '\.[ch]$' | grep 'irreco.*' | scripts_src_pad
88 echo -n "irreco_util_header_DATA = "
89 ls "$IRRECO_DIR"/src/util \
90 | egrep '\.[ch]$' | grep 'irreco.*\.h' | scripts_src_pad
92 irreco_print_title "WEBDB SOURCES"
93 echo -n "lib_irreco_webdb_la_SOURCES = "
94 ls "$IRRECO_DIR"/src/webdb \
95 | egrep '\.[ch]$' | grep 'irreco.*' | scripts_src_pad
98 irreco_print_title()
100 print_title "IRRECO $1"
103 irreco_main "$@"