Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
athos-ribeiro committed Aug 13, 2018
0 parents commit 028ba5f
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
@@ -0,0 +1,10 @@
DESTDIR ?=
PREFIX = /usr
mylibdir = $(PREFIX)/lib/obs/service

.PHONY: install

install:
mkdir -p $(DESTDIR)$(mylibdir)
install -m 0644 clang_build.service $(DESTDIR)$(mylibdir)/clang_build.service
install -m 0755 clang_build $(DESTDIR)$(mylibdir)/clang_build
23 changes: 23 additions & 0 deletions clang_build
@@ -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
6 changes: 6 additions & 0 deletions clang_build.service
@@ -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>
5 changes: 5 additions & 0 deletions debian/changelog
@@ -0,0 +1,5 @@
obs-service-clang-build (0.1-1) unstable; urgency=medium

* Initial release

-- Athos Ribeiro <athoscribeiro@gmai.com> Wed, 25 Jul 2018 18:58:36 +0000
1 change: 1 addition & 0 deletions debian/compat
@@ -0,0 +1 @@
11
16 changes: 16 additions & 0 deletions debian/control
@@ -0,0 +1,16 @@
Source: obs-service-clang-build
Section: devel
Priority: extra
Maintainer: Athos Ribeiro <athoscribeiro@gmail.com>
Build-Depends: debhelper (>= 11)
Standards-Version: 4.1.3
Homepage: https://athoscr.me
#Vcs-Browser: https://salsa.debian.org/debian/obs-service-clang-build
#Vcs-Git: https://salsa.debian.org/debian/obs-service-clang-build.git

Package: obs-service-clang-build
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: OBS Source Service: substitute gcc binaries for clang.
WARNING - This is a destructive package that removes GCC binaries. Use at your
own risk.
41 changes: 41 additions & 0 deletions debian/copyright
@@ -0,0 +1,41 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: obs-service-clang-build
Source: https://athoscr.me

Files: *
Copyright: 2018 Athos Ribeiro <athoscribeiro@gmail.com>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

Files: debian/*
Copyright: 2018 Athos Ribeiro <athoscribeiro@gmail.com>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
15 changes: 15 additions & 0 deletions debian/rules
@@ -0,0 +1,15 @@
#!/usr/bin/make -f
# -*- makefile -*-
#
export DH_VERBOSE=1
DESTDIR=debian/obs-service-clang-build

%:
dh $@

override_dh_auto_build: ;

override_dh_auto_test: ;

override_dh_auto_install:
$(MAKE) DESTDIR=`pwd`/$(DESTDIR) PREFIX=/usr install
1 change: 1 addition & 0 deletions debian/source/format
@@ -0,0 +1 @@
3.0 (quilt)

0 comments on commit 028ba5f

Please sign in to comment.