23e5b222b280b96928b453af401078a11bf0e732
[platform/core/uifw/libtdm.git] / android / how_to_deploy.txt
1 This guide for the development under the Android.
2
3 > - host promt
4 @ - chroot system promt
5 $ - target promt
6
7 - All commans are executed on the host unless otherwise specified.
8 - Some files you may find on ownCloud -- Public/ToA .
9
10 1. Create bootstrap:  https://debian.pro/440 (Russian)
11     > cd <directory you wanna use as your new system root directory.>
12     > sudo debootstrap trusty . http://mirror.yandex.ru/ubuntu
13
14 2. Make some preparations to your new system:
15     - mount host's proc fs to your new system /proc
16     (you may make this mount permanently by adding an entry to /etc/fstab on the host)
17
18 3. Login in created system:
19    > sudo chroot <directory you've placed bootstrap in>
20    - http://la2ha.ru/dev-seo-diy/unix/setting_locale_failed (Russian)
21
22 4. Create an user you will use under the devopment (on your new system).
23 5. Fix the problem with sudoers file (on your new system) -- http://unixforum.org/index.php?showtopic=135020 . (Russian)
24 6. Install make, autoconf, libtool, texinfo and pkg-config packages (on your new system).
25 7. Install android-tools-adb packages(amd64) (on your new system) -- http://packages.ubuntu.com/ru/trusty/devel/android-tools-adb .
26 8. Download Android ndk -- https://developer.android.com/ndk/downloads/index.html .
27
28 9. Extract a standalone android toolchain: -- https://developer.android.com/ndk/guides/standalone_toolchain.html
29    > cd <directory you've unpacked Android ndk into>
30    > build/tools/make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-4.9 --platform=android-22 --install-dir=<directory on your chroot system, this how_to considers you've chosen ~/bin/android_toolchain>
31
32 10. Add a path to the android toolchain to your system PATH env variable (on your new system):
33   @ echo "PATH=${HOME}/bin/android_toolchain/bin:${PATH}" >> ~/.bashrc
34
35 11. Add a path to the ~/bin to your system PATH env variable (on your new system):
36   @ echo "PATH=${HOME}/bin/:${PATH}" >> ~/.bashrc
37
38 12. Prepare rpm (on your new system):
39   @ sudo apt-get install rpm
40   @ mkdir -p ~/redhat/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
41   @ echo "%_topdir /home/$USER/redhat" >> ~/.rpmmacros
42
43 Now you have the prepared environment to build for the Android.
44
45 What to do next is your choise...
46
47 Suggested steps are:
48  - download a sources for a project you want to build for the Android.
49  - create .spec file:
50    - set a prefix variable to /usr/local, if your project use an autotools,
51      to avoid a cluttering your chroot's root [by default prefix is /usr/local].
52  - run rpmbuild --target armv7l -bb <.spec file> .
53    - if you want to install the build results to a target add an option '--noclean' (you will be able
54      to copy the results to a target easy).
55  - install rpm packages to your chroot system: sudo rpm -ivh --nodeps --ignorearch <.rpm to install> .
56    - a next build will be able to use a resulst of the current build.
57  - copy the build results to a target: adb push ~/redhat/BUILDROOT/<name of project.arm> <wherever you want> .
58    - do not forget to remove an unnecessary files: *.la, *.h, *.pc and so on.