From f28dcb3751391dc8e5e3a18c2b35b47cc6fb0984 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 28 Aug 2017 10:39:18 -0400 Subject: [PATCH] Auto-set build tags for ostree and selinux Try to use pkg-config to check for 'ostree-1' and 'libselinux'. If ostree-1 is not found, use the containers_image_ostree_stub build tag to not require it, at the cost of not being able to use or write images to the 'ostree' transport. If libselinux is found, build with the 'selinux' tag, Signed-off-by: Nalin Dahyabhai Closes: #252 Approved by: rhatdan --- .travis.yml | 2 +- Makefile | 2 +- ostree_tag.sh | 4 ++++ selinux_tag.sh | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 ostree_tag.sh create mode 100755 selinux_tag.sh diff --git a/.travis.yml b/.travis.yml index f9f2fe524..1f6159e55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,5 +13,5 @@ before_install: - sudo apt-get -qq install bats btrfs-tools git libapparmor-dev libdevmapper-dev libglib2.0-dev libgpgme11-dev libselinux1-dev - sudo apt-get -qq remove libseccomp2 script: - - make install.tools install.libseccomp.sudo all runc validate TAGS="containers_image_ostree_stub apparmor seccomp" + - make install.tools install.libseccomp.sudo all runc validate TAGS="apparmor seccomp" - cd tests; sudo PATH="$PATH" ./test_runner.sh diff --git a/Makefile b/Makefile index 1c403471d..1992fb238 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -AUTOTAGS := $(shell ./btrfs_tag.sh) $(shell ./libdm_tag.sh) +AUTOTAGS := $(shell ./btrfs_tag.sh) $(shell ./libdm_tag.sh) $(shell ./ostree_tag.sh) $(shell ./selinux_tag.sh) TAGS := seccomp PREFIX := /usr/local BINDIR := $(PREFIX)/bin diff --git a/ostree_tag.sh b/ostree_tag.sh new file mode 100755 index 000000000..89499c5e8 --- /dev/null +++ b/ostree_tag.sh @@ -0,0 +1,4 @@ +#!/bin/bash +if ! pkg-config ostree-1 2> /dev/null ; then + echo containers_image_ostree_stub +fi diff --git a/selinux_tag.sh b/selinux_tag.sh new file mode 100755 index 000000000..ff80fda04 --- /dev/null +++ b/selinux_tag.sh @@ -0,0 +1,4 @@ +#!/bin/bash +if pkg-config libselinux 2> /dev/null ; then + echo selinux +fi