Skip to content
Permalink
Browse files
Install OBS clang_build Source Service
  • Loading branch information
athos-ribeiro committed Jul 25, 2018
1 parent eb8905b commit 6ac659e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
@@ -0,0 +1,23 @@
#!/bin/bash
set -x
echo "Entering customization script..."
CLANG_VERSION="6.0"

echo "Replace gcc, g++ & cpp by clang"
VERSIONS="4.6 4.7 4.8 4.9 5 6 7 8"
cd /usr/bin
for VERSION in $VERSIONS; do
rm -f g++-$VERSION gcc-$VERSION cpp-$VERSION gcc
ln -s clang++-$CLANG_VERSION g++-$VERSION
ln -s clang-$CLANG_VERSION gcc-$VERSION
ln -s clang-$CLANG_VERSION cpp-$VERSION
ln -s clang-$CLANG_VERSION gcc
echo "gcc-$VERSION hold"|dpkg --set-selections
echo "g++-$VERSION hold"|dpkg --set-selections
done
cd -

echo "Check if gcc, g++ & cpp are actually clang"
gcc --version|grep clang > /dev/null || exit 1
cpp --version|grep clang > /dev/null || exit 1
g++ --version|grep clang > /dev/null || exit 1
@@ -0,0 +1,6 @@
<service name="clang_build">
<summary>Build packages against Clang</summary>
<description>
This service substitutes CC and CXX for clang before builds
</description>
</service>
@@ -76,6 +76,11 @@ restart_apache:
- setup_obs_api
{% endif %}

start_obsservice:
service.running:
- name: obsservice
- enable: True

/root/.oscrc:
file.managed:
- source: salt://files/oscrc
@@ -174,6 +179,22 @@ restart_apache:
- group: root
- mode: 644

/usr/lib/obs/service/clang_build.service:
file.managed:
- source: salt://files/clang_build.service
- user: root
- group: root
- mode: 644
- makedirs: True

/usr/lib/obs/service/clang_build:
file.managed:
- source: salt://files/clang_build
- user: root
- group: root
- mode: 755
- makedirs: True

set_obs_instance_configurations:
cmd.run:
- name: osc -A https://localhost:443 api /configuration -T /tmp/obs_instance_configuration.xml

0 comments on commit 6ac659e

Please sign in to comment.