This commit is contained in:
Michal Rostecki 2017-01-05 09:36:10 +00:00 committed by GitHub
commit 0690e568e9
7 changed files with 113 additions and 28 deletions

18
.gitignore vendored
View file

@ -11,3 +11,21 @@ vendor/src/github.com/kubernetes-incubator/cri-o
ocid.conf
*.orig
*.rej
# Autotools
Makefile
Makefile.in
/autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.h.in
/config.log
/config.status
/configure
/configure.scan
/depcomp
/install-sh
/missing
/stamp-h1

View file

@ -10,6 +10,8 @@ services:
- docker
install:
- ./autogen.sh
- ./configure --with-travis
- make install.tools
before_script:

View file

@ -1,13 +1,13 @@
GO ?= go
EPOCH_TEST_COMMIT ?= 78aae688e2932f0cfc2a23e28ad30b58c6b8577f
PROJECT := github.com/kubernetes-incubator/cri-o
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
OCID_IMAGE := ocid_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
OCID_LINK := ${CURDIR}/vendor/src/github.com/kubernetes-incubator/cri-o
OCID_LINK_DIR := ${CURDIR}/vendor/src/github.com/kubernetes-incubator
OCID_INSTANCE := ocid_dev
SYSTEM_GOPATH := ${GOPATH}
PROJECT = github.com/kubernetes-incubator/cri-o
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GIT_BRANCH_CLEAN = $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
OCID_IMAGE = ocid_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
OCID_LINK = ${CURDIR}/vendor/src/github.com/kubernetes-incubator/cri-o
OCID_LINK_DIR = ${CURDIR}/vendor/src/github.com/kubernetes-incubator
OCID_INSTANCE = ocid_dev
SYSTEM_GOPATH = ${GOPATH}
PREFIX ?= ${DESTDIR}/usr
BINDIR ?= ${PREFIX}/bin
LIBEXECDIR ?= ${PREFIX}/libexec
@ -15,10 +15,22 @@ MANDIR ?= ${PREFIX}/share/man
ETCDIR ?= ${DESTDIR}/etc
ETCDIR_OCID ?= ${ETCDIR}/ocid
GO_MD2MAN ?= $(shell which go-md2man)
export GOPATH := ${CURDIR}/vendor
BUILDTAGS := selinux seccomp $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh)
export GOPATH = ${CURDIR}/vendor
BUILDTAGS = $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh)
BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions
if USE_SELINUX
BUILDTAGS += selinux
endif
if USE_SECCOMP
BUILDTAGS += seccomp
endif
if USE_APPARMOR
BUILDTAGS += apparmor
endif
all: binaries ocid.conf docs
default: help
@ -63,7 +75,7 @@ kpod: $(GO_SRC) | ${OCID_LINK}
ocid.conf: ocid
./ocid --config="" config --default > ocid.conf
clean:
clean-local:
rm -f ocid.conf
rm -f ocic ocid
rm -f kpod
@ -88,8 +100,8 @@ localintegration: binaries
binaries: ocid ocic kpod conmon pause
MANPAGES_MD := $(wildcard docs/*.md)
MANPAGES := $(MANPAGES_MD:%.md=%)
MANPAGES_MD = $(wildcard docs/*.md)
MANPAGES = $(MANPAGES_MD:%.md=%)
docs/%.1: docs/%.1.md
@which go-md2man > /dev/null 2>/dev/null || (echo "ERROR: go-md2man not found. Consider 'make install.tools' target" && false)
@ -105,7 +117,7 @@ docs/%.8: docs/%.8.md
docs: $(MANPAGES)
install:
install-exec-local:
install -D -m 755 kpod $(BINDIR)/kpod
install -D -m 755 ocid $(BINDIR)/ocid
install -D -m 755 ocic $(BINDIR)/ocic
@ -125,7 +137,7 @@ install.completions:
install.systemd:
install -D -m 644 contrib/systemd/ocid.service $(PREFIX)/lib/systemd/system/ocid.service
uninstall:
uninstall-local:
rm -f $(BINDIR)/{ocid,ocic}
rm -f $(LIBEXECDIR)/ocid/{conmon,pause}
for i in $(filter %.1,$(MANPAGES)); do \
@ -142,7 +154,7 @@ uninstall:
# When this is running in travis, it will only check the travis commit range
.gitvalidation:
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
ifeq ($(TRAVIS),true)
if TRAVIS
git-validation -q -run DCO,short-subject
else
git-validation -v -run DCO,short-subject -range $(EPOCH_TEST_COMMIT)..HEAD

3
autogen.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
autoreconf --install --warnings=all --force

53
configure.ac Normal file
View file

@ -0,0 +1,53 @@
AC_INIT([cri-o], [0.1])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
AC_PROG_CC
AC_CHECK_PROG([GO], [go], [go])
AC_ARG_WITH([travis],
[AS_HELP_STRING([--with-travis],
[support for Travis CI])],
[],
[with_travis=no])
AM_CONDITIONAL([TRAVIS], [test "x$with_travis" != xno])
PKG_CHECK_MODULES([glib], [glib-2.0])
PKG_CHECK_MODULES([devmapper], [devmapper])
AC_CHECK_HEADERS([btrfs/ioctl.h], [], [])
AC_ARG_WITH([selinux],
[AS_HELP_STRING([--with-selinux],
[enable SELinux support])],
[],
[with_selinux=yes])
AM_CONDITIONAL([USE_SELINUX], [test "x$with_selinux" != xno])
AC_ARG_WITH([seccomp],
[AS_HELP_STRING([--with-seccomp],
[enable seccomp support])],
[],
[with_seccomp=yes])
AS_CASE(["$with_seccomp"],
[yes], [PKG_CHECK_MODULES([libseccomp], [libseccomp])],
[no], []
[PKG_CHECK_MODULES([libseccomp], [libseccomp], [have_seccomp=yes], [have_seccomp=no])])
AM_CONDITIONAL([USE_SECCOMP], [test "x$with_seccomp" != xno -a "x$have_seccomp" != xno])
AC_ARG_WITH([apparmor],
[AS_HELP_STRING([--with-apparmor],
[enable apparmor support])],
[],
[with_apparmor=no])
AS_CASE(["$with_apparmor"],
[yes], [PKG_CHECK_MODULES([libapparmor], [libapparmor])],
[no], []
[PKG_CHECK_MODULES([libapparmor], [libapparmor], [have_apparmor=yes], [have_apparmor=no])])
AM_CONDITIONAL([USE_APPARMOR], [test "x$with_apparmor" != xno -a "x$have_apparmor" != xno])
CFLAGS="$CFLAGS -Wall -Wextra $glib_CFLAGS"
LDFLAGS="$LDFLAGS"
LIBS="$LIBS $glib_LIBS"
AC_CONFIG_FILES([Makefile conmon/Makefile])
AC_OUTPUT

View file

@ -1,12 +0,0 @@
src = $(wildcard *.c)
obj = $(src:.c=.o)
override LIBS += $(shell pkg-config --libs glib-2.0)
override CFLAGS += -Wall -Wextra $(shell pkg-config --cflags glib-2.0)
conmon: $(obj)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -f $(obj) conmon

9
conmon/Makefile.am Normal file
View file

@ -0,0 +1,9 @@
src = $(wildcard *.c)
obj = $(src:.c=.o)
conmon: $(obj)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean-local:
rm -f $(obj) conmon