update macro
[scm/bb/tizen.git] / yocto-Tizen-Generic-Manager / checkout_tizen_generic
1 #!/bin/bash
2 #
3 # Copyright 2013, Intel Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU Library General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 # native
18
19 #author: Ronan Le Martret ronan@fridu.net
20 export CHECKOUTTIZEN=1
21
22 source ./yocto-Tizen-Generic-Manager_conf
23 PROTODIR=${YOCTOTIZEN_DIR}/proto-meta-Tizen_generic
24 CUR_PWD=$(pwd)
25 echo
26 checkout_project ${YOCTOTIZEN_DIR} ${YOCTOTIZEN_GIT} ${YOCTOTIZEN_BRANCH} ${YOCTOTIZEN_SHA}
27
28 echo
29 echo update base project
30 echo
31 cd ${CUR_PWD}
32 ./checkout_core-project
33
34 echo _________________________________________________________________________
35 echo
36 echo config Tizen Generic on Yocto project.
37 echo
38 echo ____________ create spec2yocto link
39 sudo rm -fr /usr/bin/spec2yocto
40 sudo ln -fs ${YOCTOTIZEN_DIR}/tools/spec2yocto.py /usr/bin/spec2yocto
41
42
43 echo ____________ create macro link
44 sudo mkdir -p /usr/share/spec2yocto
45 sudo rm -fr /usr/share/spec2yocto/macro
46 sudo ln -fs ${PROTODIR}/rpm_tizen_macro /usr/share/spec2yocto/macro
47
48 echo ____________ create .spec2yoctorc link
49 rm -f ${HOME}/.spec2yoctorc
50 ln -fs ${PROTODIR}/.spec2yoctorc ${HOME}/.spec2yoctorc
51
52 echo _________________________________________________________________________
53
54 if grep -q "\${HOME}\/yoctoTizen" "${PROTODIR}/.spec2yoctorc"; then
55                 sed -i -e "s@\${HOME}\/yoctoTizen@${TOPDIR}\/yoctoTizen@g" ${PROTODIR}/.spec2yoctorc
56                 sed -e "s@\working_dir=.*@working_dir=${PROTODIR}@g" -i ${PROTODIR}/.spec2yoctorc
57                 echo good path applied \: ${TOPDIR}\/yoctoTizen
58 else
59                 echo good path already applied to .spec2yoctorc
60 fi
61
62 add_meta_to_bblayers ${YOCTOTIZEN_DIR}/meta-tizen-generic  "${BUILDPATH}/conf/bblayers.conf"
63
64 print_end_update tizen-generic-core-image