newer swig support #64199
authorMike Frysinger <vapier@gentoo.org>
Fri, 15 Oct 2004 01:21:26 +0000 (01:21 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 15 Oct 2004 01:21:26 +0000 (01:21 +0000)
sys-libs/libcap/ChangeLog
sys-libs/libcap/Manifest
sys-libs/libcap/files/digest-libcap-1.10-r5 [new file with mode: 0644]
sys-libs/libcap/files/libcap-1.10-python-2.patch [new file with mode: 0644]
sys-libs/libcap/files/libcap-1.10-r5-staticfix.patch [new file with mode: 0644]
sys-libs/libcap/libcap-1.10-r5.ebuild [new file with mode: 0644]

index 825b651abccb5a4a933a63fbc96e6290e2cf9614..5ea0089ef20e73604f09a41b9eebe1a998cf6f16 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for sys-libs/libcap
 # Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap/ChangeLog,v 1.29 2004/10/01 14:35:52 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap/ChangeLog,v 1.30 2004/10/15 01:21:26 vapier Exp $
+
+*libcap-1.10-r5 (14 Oct 2004)
+
+  14 Oct 2004; Mike Frysinger <vapier@gentoo.org>
+  +files/libcap-1.10-python-2.patch, +files/libcap-1.10-r5-staticfix.patch,
+  +libcap-1.10-r5.ebuild:
+  Version bump with newer python support #64199 by Sascha Silbe.
 
   01 Oct 2004; Simon Stelling <blubb@gentoo.org> libcap-1.10-r3.ebuild,
   libcap-1.10-r4.ebuild:
index 7d15dab2b2d9e3acff013ea540ac13e9a57a1c22..fb2c9b3a8ae2aa725e295de366bc7012eeb4b5dc 100644 (file)
@@ -1,20 +1,24 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 b576e50f2afbd202ff10611be807df10 ChangeLog 3868
+MD5 ed2ac9009788bee0e11013cc9cb31795 ChangeLog 4118
 MD5 14924fc4971ef24010766490ba8f5880 libcap-1.10-r3.ebuild 1897
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
 MD5 6c47ce2ff9c2039a282e30bc0d569646 libcap-1.10-r4.ebuild 2065
+MD5 980a3b11edf8dd42faff2477d336549f libcap-1.10-r5.ebuild 2097
 MD5 9000d6c99fa8e618980893207442fb78 files/1.10-python.patch 2751
 MD5 1a4b48f5a76c206e51c3b2321abd87e1 files/digest-libcap-1.10-r3 129
 MD5 8f279ebf325d1b8efb6ad3c3a0d8cb5d files/libcap-1.10-python.patch 3353
 MD5 3aa7335821ba75c0994083995b0331f2 files/libcap-1.10-syscall.patch 1051
 MD5 2f1adcade85a501a8b4d47ddeb66ec9b files/digest-libcap-1.10-r4 129
 MD5 1f60409beeba2a799bfbc44a8b826f11 files/libcap-1.10-r4-staticfix.diff 2113
+MD5 2f1adcade85a501a8b4d47ddeb66ec9b files/digest-libcap-1.10-r5 129
+MD5 225f8c45bc6ff1df2eb5bee87f4a940f files/libcap-1.10-python-2.patch 3349
+MD5 e87b83134dc43c45f3eab0b182496974 files/libcap-1.10-r5-staticfix.patch 1980
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.9.10 (GNU/Linux)
 
-iD8DBQFBbyP1HTu7gpaalycRAtcXAKCiO7SKKtIoDb8ycpXsAibl4XsU0gCeJUU7
-OyyZ6sEEwqos3TIQbbIWVbs=
-=BLWM
+iD8DBQFBbyYdHTu7gpaalycRAn2ZAKCFRUMuisdWNmWgFSBpulg3QKAzOgCg78ya
+RF2DDMLWNVuZP1qhnP7eSTI=
+=0fXw
 -----END PGP SIGNATURE-----
diff --git a/sys-libs/libcap/files/digest-libcap-1.10-r5 b/sys-libs/libcap/files/digest-libcap-1.10-r5
new file mode 100644 (file)
index 0000000..ec126de
--- /dev/null
@@ -0,0 +1,2 @@
+MD5 4426a413128142cab89eb2e6f13d8571 libcap-1.10.tar.bz2 26686
+MD5 b867a0c1db9e8ff568415bbcd1fa65dc libcap_1.10-14.diff.gz 12928
diff --git a/sys-libs/libcap/files/libcap-1.10-python-2.patch b/sys-libs/libcap/files/libcap-1.10-python-2.patch
new file mode 100644 (file)
index 0000000..2560ae0
--- /dev/null
@@ -0,0 +1,132 @@
+diff -Nur libcap-1.10-14.static/libcap/include/sys/capability.h libcap-1.10-14.static.python/libcap/include/sys/capability.h
+--- libcap-1.10-14.static/libcap/include/sys/capability.h      2004-09-16 02:45:13.000000000 +0200
++++ libcap-1.10-14.static.python/libcap/include/sys/capability.h       2004-09-16 02:52:58.000000000 +0200
+@@ -15,12 +15,23 @@
+ extern "C" {
+ #endif
+ 
++#ifdef SWIG
++%module libcap
++#endif
++
+ /*
+  * This file complements the kernel file by providing prototype
+  * information for the user library.
+  */
+ 
++#ifdef SWIG
++%{
++#include <sys/types.h>
++#include "libcap.h"
++%}
++#else
+ #include <sys/types.h>
++#endif
+ /*
+  * This is <linux/capability.h>
+  *
+@@ -52,6 +63,7 @@
+  
+ #define _LINUX_CAPABILITY_VERSION  0x19980330
+ 
++#ifndef SWIG
+ typedef struct __user_cap_header_struct {
+       __u32 version;
+       int pid;
+@@ -62,6 +74,7 @@
+         __u32 permitted;
+         __u32 inheritable;
+ } *cap_user_data_t;
++#endif
+   
+ #ifdef __KERNEL__
+ 
+@@ -354,10 +367,12 @@
+ int     cap_clear(cap_t);
+ 
+ /* libcap/cap_file.c */
++#ifndef SWIG
+ cap_t   cap_get_fd(int);
+ cap_t   cap_get_file(const char *);
+ int     cap_set_fd(int, cap_t);
+ int     cap_set_file(const char *, cap_t);
++#endif
+ 
+ /* libcap/cap_proc.c */
+ cap_t   cap_get_proc(void);
+@@ -377,6 +392,7 @@
+  * if the following _POSIX_SOURCE is _undefined_
+  */
+ 
++#ifndef SWIG
+ #if !defined(_POSIX_SOURCE)
+ 
+ extern int capset(cap_user_header_t header, cap_user_data_t data);
+@@ -386,6 +402,7 @@
+ extern char const *_cap_names[];
+ 
+ #endif /* !defined(_POSIX_SOURCE) */
++#endif
+ 
+ #ifdef __cplusplus
+ }
+diff -Nur libcap-1.10-14.static/libcap/Makefile libcap-1.10-14.static.python/libcap/Makefile
+--- libcap-1.10-14.static/libcap/Makefile      2004-09-16 02:48:30.000000000 +0200
++++ libcap-1.10-14.static.python/libcap/Makefile       2004-09-16 03:01:06.000000000 +0200
+@@ -34,6 +34,8 @@
+ #
+ LIBNAME=libcap
+ STATLIBNAME=$(LIBNAME).a
++PYTHONMODNAME=_$(LIBNAME).so
++PYTHONPYNAME=$(LIBNAME).py
+ #
+ 
+ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
+@@ -47,7 +49,11 @@
+ MAJLIBNAME=$(LIBNAME).so.$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ 
++ifdef PYTHON
++all: $(MINLIBNAME) $(STATLIBNAME) $(PYTHONMODNAME)
++else
+ all: $(MINLIBNAME) $(STATLIBNAME)
++endif
+ 
+ _makenames: _makenames.c cap_names.sed
+       $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+@@ -67,6 +73,18 @@
+       ln -sf $(MINLIBNAME) $(MAJLIBNAME)
+       ln -sf $(MAJLIBNAME) $(LIBNAME).so
+ 
++libcap_wrap.c: include/sys/capability.h
++      swig -python -o libcap_wrap.c include/sys/capability.h
++
++$(PYTHONMODNAME): $(OBJS) libcap_wrap.o
++      $(LD) -x -shared -o $@ libcap_wrap.o $(OBJS)
++
++libcap_wrap.c: include/sys/capability.h
++      swig -python -o libcap_wrap.c include/sys/capability.h
++
++$(PYTHONMODNAME): $(OBJS) libcap_wrap.o
++      $(LD) -x -shared -o $@ libcap_wrap.o $(OBJS)
++
+ %.o: %.c $(INCLS)
+       $(CC) $(CFLAGS) -c $< -o $@
+ 
+@@ -83,10 +101,15 @@
+       ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
+       ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME).so
+       -/sbin/ldconfig
++ifdef PYTHON
++      mkdir -p $(PYTHONMODDIR)
++      install -m 0644 $(PYTHONMODNAME) $(PYTHONMODDIR)/$(PYTHONMODNAME)
++      install -m 0644 $(PYTHONPYNAME) $(PYTHONMODDIR)/$(PYTHONPYNAME)
++endif
+ 
+ clean:
+       $(LOCALCLEAN)
+       rm -f $(OBJS) $(LOBJS) $(STATLIBNAME) $(LIBNAME).so*
+-      rm -f cap_names.h cap_names.sed _makenames
++      rm -f cap_names.h cap_names.sed _makenames libcap_wrap.c
+       cd include/sys && $(LOCALCLEAN)
+ 
diff --git a/sys-libs/libcap/files/libcap-1.10-r5-staticfix.patch b/sys-libs/libcap/files/libcap-1.10-r5-staticfix.patch
new file mode 100644 (file)
index 0000000..ce3445a
--- /dev/null
@@ -0,0 +1,49 @@
+diff -Nur libcap-1.10-14/libcap/Makefile libcap-1.10-14.static/libcap/Makefile
+--- libcap-1.10-14/libcap/Makefile     2004-09-16 02:45:13.000000000 +0200
++++ libcap-1.10-14.static/libcap/Makefile      2004-09-16 02:48:30.000000000 +0200
+@@ -33,6 +33,7 @@
+ # Library version
+ #
+ LIBNAME=libcap
++STATLIBNAME=$(LIBNAME).a
+ #
+ 
+ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
+@@ -46,7 +47,7 @@
+ MAJLIBNAME=$(LIBNAME).so.$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ 
+-all: $(MINLIBNAME) $(LIBNAME).a
++all: $(MINLIBNAME) $(STATLIBNAME)
+ 
+ _makenames: _makenames.c cap_names.sed
+       $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+@@ -58,8 +59,8 @@
+       @echo "=> making cap_names.c from <sys/capability.h>"
+       @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < include/sys/capability.h | fgrep -v 0x > cap_names.sed #   @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed
+ 
+-$(LIBNAME).a: $(OBJS)
+-      ar cruv $(LIBNAME).a $(OBJS)
++$(STATLIBNAME): $(OBJS)
++      ar csruv $(STATLIBNAME) $(OBJS)
+ 
+ $(MINLIBNAME): $(LOBJS)
+       $(CC) -shared -fPIC -Wl,-soname,$(MAJLIBNAME) -o $@ $(LOBJS)
+@@ -77,7 +78,7 @@
+       mkdir -p -m 0755 $(INCDIR)/sys
+       install -m 0644 include/sys/capability.h $(INCDIR)/sys
+       mkdir -p -m 0755 $(LIBDIR)
+-      install -m 0644 $(LIBNAME).a $(LIBDIR)
++      install -m 0644 $(STATLIBNAME) $(LIBDIR)
+       install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
+       ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
+       ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME).so
+@@ -85,7 +86,7 @@
+ 
+ clean:
+       $(LOCALCLEAN)
+-      rm -f $(OBJS) $(LOBJS) $(LIBNAME).a $(LIBNAME).so*
++      rm -f $(OBJS) $(LOBJS) $(STATLIBNAME) $(LIBNAME).so*
+       rm -f cap_names.h cap_names.sed _makenames
+       cd include/sys && $(LOCALCLEAN)
+ 
diff --git a/sys-libs/libcap/libcap-1.10-r5.ebuild b/sys-libs/libcap/libcap-1.10-r5.ebuild
new file mode 100644 (file)
index 0000000..114f982
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap/libcap-1.10-r5.ebuild,v 1.1 2004/10/15 01:21:26 vapier Exp $
+
+inherit flag-o-matic eutils
+
+DEB_PVER=14
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/libs/security/linux-privs/"
+SRC_URI="http://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.4/${P}.tar.bz2
+       http://ftp.debian.org/debian/pool/main/libc/libcap/libcap_${PV}-${DEB_PVER}.diff.gz"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="python pic static"
+
+#patch is in recent 2.2 kernels so it works there
+DEPEND="virtual/libc
+       virtual/os-headers
+       python? ( >=virtual/python-2.2.1 >=dev-lang/swig-1.3.10 )"
+RDEPEND="python? ( >=virtual/python-2.2.1 )
+       virtual/libc"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       epatch ${WORKDIR}/libcap_${PV}-${DEB_PVER}.diff
+       epatch ${FILESDIR}/${PF}-staticfix.patch
+       epatch ${FILESDIR}/${P}-python-2.patch
+       sed -i 's|WARNINGS=-ansi|WARNINGS=|' Make.Rules
+}
+
+src_compile() {
+       local PYTHONVER="`python -V 2>&1 | sed 's/^Python //'|sed 's/\([0-9]*\.[0-9]*\).*/\1/'`"
+       local myflags=""
+       use static && CFLAGS="${CFLAGS} -static" && LDFLAGS="${LDFLAGS} -static"
+       if use python ; then
+               myflags="${myflags} PYTHON=1 PYTHONMODDIR=/usr/$(get_libdir)/python${PYTHONVER}/site-packages"
+               append-flags -I/usr/include/python${PYTHONVER}
+       fi
+
+       emake COPTFLAG="${CFLAGS}" LDFLAGS="${LDFLAGS}" DEBUG="" ${myflags} || die
+}
+
+src_install() {
+       local PYTHONVER="`python -V 2>&1 | sed 's/^Python //'|sed 's/\([0-9]*\.[0-9]*\).*/\1/'`"
+       local myflags=""
+       if use python ; then
+               myflags="${myflags} PYTHON=1 PYTHONMODDIR=${D}/usr/$(get_libdir)/python${PYTHONVER}/site-packages"
+       fi
+       make install FAKEROOT="${D}" man_prefix=/usr/share LIBDIR="${D}/$(get_libdir)" ${myflags} || die
+       dodir /usr/$(get_libdir)
+       mv ${D}/$(get_libdir)/libcap.a ${D}/usr/$(get_libdir)
+       gen_usr_ldscript libcap.so
+       dodoc CHANGELOG README pgp.keys.asc doc/capability.notes capfaq-0.2.txt
+}