From bd5afa1cf6e2f670d92c7cff86f9148987768d3b Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 26 Sep 2014 10:53:19 -0700 Subject: Added GBS build Signed-off-by: Magnus --- packaging/README.md | 110 +++++++++++++++++++++ packaging/repo/erlang-R16B03_1-1.i686.rpm | Bin 0 -> 37665537 bytes .../repo/erlang-debuginfo-R16B03_1-1.i686.rpm | Bin 0 -> 4122820 bytes .../repo/erlang-debugsource-R16B03_1-1.i686.rpm | Bin 0 -> 1540951 bytes packaging/rvi.manifest | 5 + packaging/rvi.spec | 62 ++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 packaging/README.md create mode 100644 packaging/repo/erlang-R16B03_1-1.i686.rpm create mode 100644 packaging/repo/erlang-debuginfo-R16B03_1-1.i686.rpm create mode 100644 packaging/repo/erlang-debugsource-R16B03_1-1.i686.rpm create mode 100644 packaging/rvi.manifest create mode 100755 packaging/rvi.spec (limited to 'packaging') diff --git a/packaging/README.md b/packaging/README.md new file mode 100644 index 0000000..5bd1244 --- /dev/null +++ b/packaging/README.md @@ -0,0 +1,110 @@ +# 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. Erlang is available at AGL's gerrit: + + https://gerrit.automotivelinux.org/gerrit/#/admin/projects/RVI/erlang + +This repo also contains the pre-built 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* + + +## Create ~/BUILD-ROOT +If your GBS build root, ```~/GBS-ROOT```, does not exist, +you can greate it by running GBS until it fails by executing the BUILDING +step below. + +Once that build has errored out, you will have a ```~/GBS-ROOT``` +directory that you can update with the DNS and certificate fixes +described below. + + +## DNS Server fix +The chrooted build environment does not have its /etc/resolv.conf +setup, and all DNS lookups will fail. This is fixed by copying your local +resolv.conf file into the /etc directory of buildroot: + + sudo cp /etc/resolv.conf ~/GBS-ROOT/local/BUILD-ROOTS/scratch.i586.0/etc + +*Please note that your path to the build root may differ.* + +## Certificates fix +Since the chrooted build environment does not have a /etc/ssl/certs +directory, the git SSL session will fail when it cannot authenticate +any certificates delivered by git's https sessions. + +This is fixed by copying the certificate repo from your local machine +to the /etc directory of buildroot: + + sudo cp -rL /etc/ssl/ ~/GBS-ROOT/local/BUILD-ROOTS/scratch.i586.0/etc + +*Please note that your path to the build root may differ.* + +# BUILDING +Go to the top directory of RVI and execute: + + sudo 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.2.0-1.i686.rpm + + + + + diff --git a/packaging/repo/erlang-R16B03_1-1.i686.rpm b/packaging/repo/erlang-R16B03_1-1.i686.rpm new file mode 100644 index 0000000..c963c89 Binary files /dev/null and b/packaging/repo/erlang-R16B03_1-1.i686.rpm differ diff --git a/packaging/repo/erlang-debuginfo-R16B03_1-1.i686.rpm b/packaging/repo/erlang-debuginfo-R16B03_1-1.i686.rpm new file mode 100644 index 0000000..88cd5b2 Binary files /dev/null and b/packaging/repo/erlang-debuginfo-R16B03_1-1.i686.rpm differ diff --git a/packaging/repo/erlang-debugsource-R16B03_1-1.i686.rpm b/packaging/repo/erlang-debugsource-R16B03_1-1.i686.rpm new file mode 100644 index 0000000..97bd838 Binary files /dev/null and b/packaging/repo/erlang-debugsource-R16B03_1-1.i686.rpm differ diff --git a/packaging/rvi.manifest b/packaging/rvi.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/packaging/rvi.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/rvi.spec b/packaging/rvi.spec new file mode 100755 index 0000000..39eb02a --- /dev/null +++ b/packaging/rvi.spec @@ -0,0 +1,62 @@ +Summary: Remote Vehicle Interaction Node, running on top of Erlang, +Name: rvi +Version: 0.2.0 +Release: 1 +Group: Applications/System +License: Mozilla Public License v2 +Source: http://content.linuxfoundation.org/auto/downloads/rvi/rvi-0.2.0.tgz + +BuildRequires: make +BuildRequires: glib2-devel +BuildRequires: rpm +BuildRequires: git +BuildRequires: erlang + +%description +RVI Node running on Tizen. Needs erlang + +%package devel +Summary: RVI development headers +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +RVI development headers + +%prep +%setup -c rvi-$RPM_PACKAGE_VERSION + +%build +make deps +make compile +# Create a tizen node if that is what we have. +./scripts/setup_rvi_node.sh -n rvi-$RPM_PACKAGE_VERSION -c tizen.config +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/opt/rvi-$RPM_PACKAGE_VERSION +cp -ar rel/rvi-$RPM_PACKAGE_VERSION $RPM_BUILD_ROOT/opt/ +mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system/ +mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/multi-user.target.wants/ +install ./scripts/rvi.service $RPM_BUILD_ROOT/usr/lib/systemd/system/rvi.service +ln -fsr $RPM_BUILD_ROOT/usr/lib/systemd/system/rvi.service \ + $RPM_BUILD_ROOT/etc/systemd/system/multi-user.target.wants/rvi.service + +ln -fsr $RPM_BUILD_ROOT/opt/rvi-$RPM_PACKAGE_VERSION/releases/1/sys.config \ + $RPM_BUILD_ROOT/opt/rvi-$RPM_PACKAGE_VERSION/sys.config + + +%post +/usr/bin/systemctl daemon-reload + +%postun + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%manifest packaging/rvi.manifest +%defattr(-,root,root) +/usr/lib/systemd/system/rvi.service +/etc/systemd/system/multi-user.target.wants/rvi.service +/opt/rvi-0.2.0 + -- cgit v1.2.1