summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-03-16 07:49:12 +0000
committerMike Frysinger <vapier@gentoo.org>2008-03-16 07:49:12 +0000
commiteb9533b342bc789f763bf1b80ad5506979ee3d8d (patch)
treee4b7fa4947bd2a2a558dc45a962281d54d9484ca /sys-libs/libcap
parentarm/s390/sh stable (diff)
downloadgentoo-2-eb9533b342bc789f763bf1b80ad5506979ee3d8d.tar.gz
gentoo-2-eb9533b342bc789f763bf1b80ad5506979ee3d8d.tar.bz2
gentoo-2-eb9533b342bc789f763bf1b80ad5506979ee3d8d.zip
Version bump #211362 by Arfrever Frehtes Taifersar Arahesis.
(Portage version: 2.2_pre2)
Diffstat (limited to 'sys-libs/libcap')
-rw-r--r--sys-libs/libcap/ChangeLog8
-rw-r--r--sys-libs/libcap/files/2.08/0006-cleanup-build-system.patch199
-rw-r--r--sys-libs/libcap/libcap-2.08.ebuild48
3 files changed, 254 insertions, 1 deletions
diff --git a/sys-libs/libcap/ChangeLog b/sys-libs/libcap/ChangeLog
index 0174171adc87..1d35650745c6 100644
--- a/sys-libs/libcap/ChangeLog
+++ b/sys-libs/libcap/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-libs/libcap
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap/ChangeLog,v 1.62 2008/02/18 14:42:57 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap/ChangeLog,v 1.63 2008/03/16 07:49:11 vapier Exp $
+
+*libcap-2.08 (16 Mar 2008)
+
+ 16 Mar 2008; Mike Frysinger <vapier@gentoo.org>
+ +files/2.08/0006-cleanup-build-system.patch, +libcap-2.08.ebuild:
+ Version bump #211362 by Arfrever Frehtes Taifersar Arahesis.
*libcap-2.06-r1 (18 Feb 2008)
diff --git a/sys-libs/libcap/files/2.08/0006-cleanup-build-system.patch b/sys-libs/libcap/files/2.08/0006-cleanup-build-system.patch
new file mode 100644
index 000000000000..8b13a3b0d9b9
--- /dev/null
+++ b/sys-libs/libcap/files/2.08/0006-cleanup-build-system.patch
@@ -0,0 +1,199 @@
+From 5ec19bea0899c6e305337331ad4f8f8669492f28 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 16 Feb 2008 16:51:53 -0500
+Subject: [PATCH] cleanup build system
+
+This refactors the homebrewed build system to work much better "out of the
+box" for people. It moves tools/flags into appropriate env-overridable
+variables as well as simplifies the subdirectory handling and flag passing.
+A few bug fixes are also mixed in such as proper link order, parallel build
+failure due to local header generation, and splitting up of logic between
+binaries compiled and run on the build system and binaries compiled to run
+on the target system.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Make.Rules | 27 +++++++++++----------------
+ Makefile | 8 ++++----
+ libcap/Makefile | 18 ++++++++++--------
+ pam_cap/Makefile | 9 ++++++---
+ progs/Makefile | 7 +++++--
+ 5 files changed, 36 insertions(+), 33 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 3f38e72..17e71c1 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -43,33 +43,28 @@ MINOR=06
+ # Compilation specifics
+
+ CC ?= gcc
++BUILD_CC ?= $(CC)
+ AR ?= ar
+ RANLIB ?= ranlib
+-COPTFLAGS=-O2
+-DEBUG=-O2 -g #-DDEBUG
+-WARNINGS=-fPIC -Wall -Wwrite-strings \
++CFLAGS ?= -O2
++BUILD_CFLAGS ?= $(CFLAGS)
++WARNINGS=-Wall -Wwrite-strings \
+ -Wpointer-arith -Wcast-qual -Wcast-align \
+ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS=#-g
++LDFLAGS ?= #-g
+
+ KERNEL_HEADERS = $(topdir)/libcap/include
+-SYSTEM_HEADERS = /usr/include
+-IPATH += -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
++LIBCAP_CPPFLAGS = -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+-LIBS=-L$(topdir)/libcap -lcap
+-CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH)
++LDFLAGS += -L$(topdir)/libcap
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS)
+ PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ # Global cleanup stuff
+
+ LOCALCLEAN=rm -f *~ core
+ DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f
+-
+-# Flags to pass down recursive makes
+-
+-MAKE_DEFS = CC='$(CC)' CFLAGS='$(CFLAGS)' \
+- LD='$(LD)' LIBS='$(LIBS)' LDFLAGS='$(LDFLAGS)' \
+- VERSION='$(VERSION)' MINOR='$(MINOR)' \
+- LIBDIR='$(LIBDIR)' INCDIR='$(INCDIR)' \
+- SBINDIR='$(SBINDIR)' MANDIR='$(MANDIR)'
+diff --git a/Makefile b/Makefile
+index 52f7b42..9076724 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,12 +9,12 @@ include Make.Rules
+ #
+
+ all install clean: %: %-here
+- $(MAKE) -C libcap $(MAKE_DEFS) $@
++ $(MAKE) -C libcap $@
+ ifneq ($(PAM_CAP),no)
+- $(MAKE) -C pam_cap $(MAKE_DEFS) $@
++ $(MAKE) -C pam_cap $@
+ endif
+- $(MAKE) -C progs $(MAKE_DEFS) $@
+- $(MAKE) -C doc $(MAKE_DEFS) $@
++ $(MAKE) -C progs $@
++ $(MAKE) -C doc $@
+
+ all-here:
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 09a12d2..4bcc279 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -17,7 +17,9 @@ OBJS=$(addsuffix .o, $(FILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
+-LDFLAGS+=-lattr
++LDLIBS += -lattr
++CFLAGS += -fPIC
++INCLS += cap_names.h
+
+ all: $(MINLIBNAME) $(STALIBNAME)
+
+@@ -27,7 +29,7 @@ INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT)
+ endif
+
+ _makenames: _makenames.c cap_names.sed
+- $(CC) $(CFLAGS) $< -o $@
++ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
+@@ -40,19 +42,19 @@ cap_names.sed: Makefile $(KERNEL_HEADERS)/linux/capability.h
+ @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/\{\"\1\",\2\},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < $(KERNEL_HEADERS)/linux/capability.h | fgrep -v 0x > $@
+
+ $(STALIBNAME): $(OBJS)
+- $(AR) rcs $(STALIBNAME) $(OBJS)
+- $(RANLIB) $(STALIBNAME)
++ $(AR) rcs $@ $^
++ $(RANLIB) $@
+
+ $(MINLIBNAME): $(OBJS)
+- $(LD) $(LDFLAGS) $(COPTFLAG) -Wl,-soname,$(MAJLIBNAME) -o $@ $(OBJS)
++ $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^ $(LDLIBS)
+ ln -sf $(MINLIBNAME) $(MAJLIBNAME)
+ ln -sf $(MAJLIBNAME) $(LIBNAME)
+
+ %.o: %.c $(INCLS)
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+-cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+- $(CC) $(CFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+
+ install: all
+ mkdir -p -m 0755 $(INCDIR)/sys
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 3b3d266..e20d059 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,9 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+
++LDLIBS += -lcap -lpam
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ $(MAKE) testcompile
+
+@@ -14,13 +17,13 @@ install:
+ @echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+
+ pam_cap.so: pam_cap.o
+- $(LD) -o pam_cap.so $< $(LIBS)
++ $(LD) $(CFLAGS) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
+
+ pam_cap.o: pam_cap.c
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ testcompile: test.c pam_cap.o
+- $(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
+
+ clean:
+ rm -f *.o *.so testcompile *~
+diff --git a/progs/Makefile b/progs/Makefile
+index d711656..9b6b11c 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -6,13 +6,16 @@ include $(topdir)/Make.Rules
+ #
+ PROGS=getpcaps getcap setcap capsh
+
++LDFLAGS += --static
++LDLIBS += -lcap
++
+ all: $(PROGS)
+
+ $(PROGS): %: %.o
+- $(CC) --static $(COPTFLAG) $(LDFLAGS) -o $@ $< $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
+
+ %.o: %.c $(INCS)
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ install: all
+ mkdir -p -m 0755 $(SBINDIR)
+--
+1.5.4
+
diff --git a/sys-libs/libcap/libcap-2.08.ebuild b/sys-libs/libcap/libcap-2.08.ebuild
new file mode 100644
index 000000000000..9734c2e7c257
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.08.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap/libcap-2.08.ebuild,v 1.1 2008/03/16 07:49:11 vapier Exp $
+
+inherit eutils multilib toolchain-funcs pam
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
+SRC_URI="http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap${PV:0:1}/${P}.tar.bz2"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="pam"
+
+RDEPEND="sys-apps/attr"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+
+src_unpack() {
+ unpack ${P}.tar.bz2
+ cd "${S}"
+ epatch "${FILESDIR}"/${PV}/*.patch
+ sed -i 's:gperf:false:' libcap/Makefile #210424
+
+ sed -i -e '/cap_setfcap.*morgan/s:^:#:' pam_cap/capability.conf
+}
+
+src_compile() {
+ tc-export BUILD_CC CC AR RANLIB
+ export PAM_CAP=$(use pam && echo yes || echo no)
+ emake || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" lib=$(get_libdir) || die
+
+ dolib.a libcap/libcap.a || die
+ gen_usr_ldscript libcap.so
+
+ dopammod pam_cap/pam_cap.so
+ dopamsecurity '' pam_cap/capability.conf
+
+ dodoc CHANGELOG README doc/capability.notes
+
+ # let man-pages handle these, especially since theirs are better
+ rm "${D}"/usr/share/man/man2/cap{g,s}et.2 || die
+}