diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2013-01-07 08:14:48 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-02-05 18:54:16 +0100 |
commit | dba04d972c3aa6cafe7d7fcfc00f1002c3e88578 (patch) | |
tree | 3caee14c1c9edd05b9a5efb2548323f45054f808 | |
parent | 6ef6c88d8327d1813d147e8317731ea469ce096f (diff) | |
download | ptxdist-dba04d972c3aa6cafe7d7fcfc00f1002c3e88578.tar.gz ptxdist-dba04d972c3aa6cafe7d7fcfc00f1002c3e88578.tar.xz |
libselinux: add package
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
8 files changed, 292 insertions, 0 deletions
diff --git a/patches/libselinux-2.1.12/0001-makefile-don-t-use-TLSFLAGS.patch b/patches/libselinux-2.1.12/0001-makefile-don-t-use-TLSFLAGS.patch new file mode 100644 index 000000000..9e3d7ed47 --- /dev/null +++ b/patches/libselinux-2.1.12/0001-makefile-don-t-use-TLSFLAGS.patch @@ -0,0 +1,30 @@ +From: Marc Kleine-Budde <mkl@pengutronix.de> +Date: Mon, 14 Jan 2013 19:22:25 +0100 +Subject: [PATCH] makefile: don't use TLSFLAGS + +They are generated by uname, which is not cross compile safe. + +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + src/Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index ac019df..b63e032 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -84,10 +84,10 @@ SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno + + RANLIB=ranlib + +-ARCH := $(patsubst i%86,i386,$(shell uname -m)) +-ifneq (,$(filter i386,$(ARCH))) +-TLSFLAGS += -mno-tls-direct-seg-refs +-endif ++#ARCH := $(patsubst i%86,i386,$(shell uname -m)) ++#ifneq (,$(filter i386,$(ARCH))) ++#TLSFLAGS += -mno-tls-direct-seg-refs ++#endif + + SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ + diff --git a/patches/libselinux-2.1.12/0002-makefile-remove-host-path-from-list-of-header-search.patch b/patches/libselinux-2.1.12/0002-makefile-remove-host-path-from-list-of-header-search.patch new file mode 100644 index 000000000..710415e40 --- /dev/null +++ b/patches/libselinux-2.1.12/0002-makefile-remove-host-path-from-list-of-header-search.patch @@ -0,0 +1,22 @@ +From: Marc Kleine-Budde <mkl@pengutronix.de> +Date: Mon, 14 Jan 2013 19:53:14 +0100 +Subject: [PATCH] makefile: remove host path from list of header search dirs + +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index b63e032..ef6910c 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -77,7 +77,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi + -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \ + -Werror -Wno-aggregate-return -Wno-redundant-decls + +-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS) ++override CFLAGS += -I../include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS) + + SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \ + -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations diff --git a/patches/libselinux-2.1.12/0003-makefile-remove-host-path-from-list-of-linker-search.patch b/patches/libselinux-2.1.12/0003-makefile-remove-host-path-from-list-of-linker-search.patch new file mode 100644 index 000000000..8418f14db --- /dev/null +++ b/patches/libselinux-2.1.12/0003-makefile-remove-host-path-from-list-of-linker-search.patch @@ -0,0 +1,57 @@ +From: Marc Kleine-Budde <mkl@pengutronix.de> +Date: Mon, 14 Jan 2013 19:53:14 +0100 +Subject: [PATCH] makefile: remove host path from list of linker search dirs + +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + src/Makefile | 8 ++++---- + utils/Makefile | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index ef6910c..68eb950 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -106,17 +106,17 @@ $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT) + $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $< + + $(SWIGSO): $(SWIGLOBJ) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux -L$(LIBDIR) ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux + + $(SWIGRUBYSO): $(SWIGRUBYLOBJ) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux -L$(LIBDIR) ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux + + $(LIBA): $(OBJS) + $(AR) rcs $@ $^ + $(RANLIB) $@ + + $(LIBSO): $(LOBJS) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl -Wl,-soname,$(LIBSO),-z,defs,-z,relro + ln -sf $@ $(TARGET) + + $(LIBPC): $(LIBPC).in ../VERSION +@@ -129,7 +129,7 @@ $(AUDIT2WHYLOBJ): audit2why.c + $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $< + + $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR) ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a + + %.o: %.c policy.h + $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $< +diff --git a/utils/Makefile b/utils/Makefile +index 5f3e047..2cbec29 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -24,7 +24,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi + -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \ + -Werror -Wno-aggregate-return -Wno-redundant-decls + override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS) +-LDLIBS += -L../src -lselinux -L$(LIBDIR) ++LDLIBS += -L../src -lselinux + + TARGETS=$(patsubst %.c,%,$(wildcard *.c)) + diff --git a/patches/libselinux-2.1.12/0004-makefile-fix-linking-to-shlib-if-prefix.patch b/patches/libselinux-2.1.12/0004-makefile-fix-linking-to-shlib-if-prefix.patch new file mode 100644 index 000000000..62d595a0a --- /dev/null +++ b/patches/libselinux-2.1.12/0004-makefile-fix-linking-to-shlib-if-prefix.patch @@ -0,0 +1,25 @@ +From: Marc Kleine-Budde <mkl@pengutronix.de> +Date: Fri, 25 Jan 2013 19:39:03 +0100 +Subject: [PATCH] makefile: fix linking to shlib if prefix=/ + +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + src/Makefile | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/Makefile b/src/Makefile +index 68eb950..0d221bf 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -153,7 +153,11 @@ install: all + install -m 755 $(LIBSO) $(SHLIBDIR) + test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig + install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig ++ifeq ($(SHLIBDIR),$(LIBDIR)) ++ cd $(LIBDIR) && ln -sf $(LIBSO) $(TARGET) ++else + cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET) ++endif + + install-pywrap: pywrap + test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux diff --git a/patches/libselinux-2.1.12/0005-makefile-move-lpcre-from-beginning-of-gcc-linker-cal.patch b/patches/libselinux-2.1.12/0005-makefile-move-lpcre-from-beginning-of-gcc-linker-cal.patch new file mode 100644 index 000000000..695cd1da7 --- /dev/null +++ b/patches/libselinux-2.1.12/0005-makefile-move-lpcre-from-beginning-of-gcc-linker-cal.patch @@ -0,0 +1,56 @@ +From: Marc Kleine-Budde <mkl@pengutronix.de> +Date: Tue, 5 Feb 2013 18:19:22 +0100 +Subject: [PATCH] makefile: move -lpcre from beginning of gcc-linker call to + end + +...otherwise it won't link of --as-needed is enabled. + +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + src/Makefile | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 0d221bf..109d372 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -20,7 +20,8 @@ RUBYINC ?= $(shell pkg-config --cflags ruby-$(RUBYLIBVER)) + RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM) + LIBBASE=$(shell basename $(LIBDIR)) + +-LDFLAGS ?= -lpcre ++LDFLAGS ?= ++LDLIBS = -lpcre + + VERSION = $(shell cat ../VERSION) + LIBVERSION = 1 +@@ -106,17 +107,17 @@ $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT) + $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $< + + $(SWIGSO): $(SWIGLOBJ) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux $(LDLIBS) + + $(SWIGRUBYSO): $(SWIGRUBYLOBJ) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LDLIBS) + + $(LIBA): $(OBJS) + $(AR) rcs $@ $^ + $(RANLIB) $@ + + $(LIBSO): $(LOBJS) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl -Wl,-soname,$(LIBSO),-z,defs,-z,relro ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl -Wl,-soname,$(LIBSO),-z,defs,-z,relro $(LDLIBS) + ln -sf $@ $(TARGET) + + $(LIBPC): $(LIBPC).in ../VERSION +@@ -129,7 +130,7 @@ $(AUDIT2WHYLOBJ): audit2why.c + $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $< + + $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a $(LDLIBS) + + %.o: %.c policy.h + $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $< diff --git a/patches/libselinux-2.1.12/series b/patches/libselinux-2.1.12/series new file mode 100644 index 000000000..2fa79069a --- /dev/null +++ b/patches/libselinux-2.1.12/series @@ -0,0 +1,8 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-makefile-don-t-use-TLSFLAGS.patch +0002-makefile-remove-host-path-from-list-of-header-search.patch +0003-makefile-remove-host-path-from-list-of-linker-search.patch +0004-makefile-fix-linking-to-shlib-if-prefix.patch +0005-makefile-move-lpcre-from-beginning-of-gcc-linker-cal.patch +# c9b08d5ea990e48e11ad41489377128a - git-ptx-patches magic diff --git a/rules/libselinux.in b/rules/libselinux.in new file mode 100644 index 000000000..5260706bc --- /dev/null +++ b/rules/libselinux.in @@ -0,0 +1,12 @@ +## SECTION=selinux + +config LIBSELINUX + tristate + prompt "libselinux" + select LIBPCRE + select LIBSEPOL + help + libselinux provides an API for SELinux applications to get and set + process and file security contexts and to obtain security policy + decisions. Required for any applications that use the SELinux + API. diff --git a/rules/libselinux.make b/rules/libselinux.make new file mode 100644 index 000000000..78a4347d1 --- /dev/null +++ b/rules/libselinux.make @@ -0,0 +1,82 @@ +# -*-makefile-*- +# +# Copyright (C) 2012 by Wolfram Sang <w.sang@pengutronix.de> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_LIBSELINUX) += libselinux + +# +# Paths and names +# +LIBSELINUX_VERSION := 2.1.12 +LIBSELINUX_MD5 := 73270f384a032fad34b5fe075fa05ce2 +LIBSELINUX := libselinux-$(LIBSELINUX_VERSION) +LIBSELINUX_SUFFIX := tar.gz +LIBSELINUX_URL := http://userspace.selinuxproject.org/releases/20120924/$(LIBSELINUX).$(LIBSELINUX_SUFFIX) +LIBSELINUX_SOURCE := $(SRCDIR)/$(LIBSELINUX).$(LIBSELINUX_SUFFIX) +LIBSELINUX_DIR := $(BUILDDIR)/$(LIBSELINUX) +LIBSELINUX_LICENSE := public_domain + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +LIBSELINUX_CONF_TOOL := NO +LIBSELINUX_MAKE_ENV := \ + $(CROSS_ENV) \ + CFLAGS="-O2 -Wall" + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +LIBSELINUX_PROGS := \ + avcstat \ + compute_av \ + compute_create \ + compute_member \ + compute_relabel \ + compute_user \ + getconlist \ + getdefaultcon \ + getenforce \ + getfilecon \ + getpidcon \ + getsebool \ + getseuser \ + matchpathcon \ + policyvers \ + selinux_check_securetty_context \ + selinuxenabled \ + selinuxexeccon \ + setenforce \ + setfilecon \ + togglesebool + +$(STATEDIR)/libselinux.targetinstall: + @$(call targetinfo) + + @$(call install_init, libselinux) + @$(call install_fixup, libselinux,PRIORITY,optional) + @$(call install_fixup, libselinux,SECTION,base) + @$(call install_fixup, libselinux,AUTHOR,"Wolfram Sang <w.sang@pengutronix.de>") + @$(call install_fixup, libselinux,DESCRIPTION,missing) + + @$(call install_lib, libselinux, 0, 0, 0644, libselinux) + + @$(foreach prog, $(LIBSELINUX_PROGS), \ + $(call install_copy, libselinux, 0, 0, 0755, -, /usr/sbin/$(prog));) + + @$(call install_finish, libselinux) + + @$(call touch) + +# vim: syntax=make |