# TIZEN GIT BUILD SYSTEM (GBS) This file contains the spec files used to create a Tizen RPM through gbs (Git Build System). If you are looking to build a regular RPM for debian use, please check out the 'rpm' target of the top-level Makefile # PREPARATION Since the erlang build tool 'rebar' will download dependencies using git-https the GBS build environment will fail on two items: ## Setting up GBS The GBS build system can be setup as described [here](https://source.tizen.org/documentation/reference/git-build-system). ## Setting up repositories The RVI build generated by GBS has a self-contained erlang runtime system. This means that erlang does **not** have to be installed on the target machine. However, during the build process an erlang RPM needs to be installed in the build environment. A tizen-targeted Erlang is available on github: https://github.com/PDXostc/erlang_otp Pre-built RPMs are available under rvi_core/packaging/repo. This directory also contains all erlang RPM's necessary for the RVI build to complete. In order to have this repo pulled, the ```.gbs.conf``` in your home directory needs to be updated. Add the following repo at the bottom of the ````.gbs.conf file```: [repo.erlang] # We still haven't determined the right repo to # store the RPM file in. Use alternative repo setup # for now. #url = http://XXXXXXXXXXXXXXXXXXXXXXXXX Update the ```repos``` line in ```.gbs.conf``` from repos = repo.tizen_2.0 to repos = repo.tizen_2.0,repo.erlang *Please note that your initial value of ```repos``` entry may differ.* ## Alternative set up of repositories A suitable erlang RPM file is packaged as a part of RVI. This can be used instead of pulling the RPM from a repo, as describe above. To use the RVI-packagederlang RPM file, add the following lines ```.gbs.conf```: [repo.erlang] url = /home/some_user/work/rvi/packaging/repo *Replace the ```/home/some_user/work/rvi``` with the path to the RVI root directory you are building in* # BUILDING Go to the top directory of RVI and execute: gbs build -A i586 An RPM file will be generated at the end of the build which can be installed on a Tizen box. The RPM can be found at: ~/GBS-ROOT/local/repos/tizen/i586/RPMS/rvi-0.5.0-1.i686.rpm # UPDATING REBAR DEPENDENCIES All erlang dependencies, residing in ```deps```, are checked in with rvi_core in order to avoid having GBS and OBS to access the network to resolve them. If a new or updated module is to be included in deps, the following procedure can be used: 1. Update rebar.config
Edit rebar.config to include the correct version of the modules you need. 2. Clear deps
Delete the old deps with: ```rm -rf deps/*``` 3. Retrieve new deps
Use rebar to retrieve all modules listed in rebar.config. ```rebar get-deps``` 3. Clean out git info from deps
The checked out modules in deps are all their own repos. Clear the repo information. ```rm -rf deps/*/.git find deps -name .gitignore | xargs rm``` 4. Add all new files in deps to the rvi_core repo
If any new files are added to deps by ```rebar get-deps``` above, they need to be added to the repo: ```git add deps/*``` 5. Commit rvi_core
Commit the updated deps directory to the repo: ```git commit -a -m "Updated deps/gsm to version x"```