Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 2333
Collapse All | Expand All

(-)libcap-1.10/libcap/include/sys/capability.h (+16 lines)
Lines 15-27 Link Here
15
extern "C" {
15
extern "C" {
16
#endif
16
#endif
17
17
18
#ifdef SWIG
19
%module libcap
20
#endif
21
18
/*
22
/*
19
 * This file complements the kernel file by providing prototype
23
 * This file complements the kernel file by providing prototype
20
 * information for the user library.
24
 * information for the user library.
21
 */
25
 */
22
26
27
#ifdef SWIG
28
%{
29
#include <sys/types.h>
30
#include <linux/capability.h>
31
#include "libcap.h"
32
%}
33
#else
23
#include <sys/types.h>
34
#include <sys/types.h>
24
#include <linux/capability.h>
35
#include <linux/capability.h>
36
#endif
25
37
26
/*
38
/*
27
 * POSIX capability types
39
 * POSIX capability types
Lines 73-82 Link Here
73
int     cap_clear(cap_t);
85
int     cap_clear(cap_t);
74
86
75
/* libcap/cap_file.c */
87
/* libcap/cap_file.c */
88
#ifndef SWIG
76
cap_t   cap_get_fd(int);
89
cap_t   cap_get_fd(int);
77
cap_t   cap_get_file(const char *);
90
cap_t   cap_get_file(const char *);
78
int     cap_set_fd(int, cap_t);
91
int     cap_set_fd(int, cap_t);
79
int     cap_set_file(const char *, cap_t);
92
int     cap_set_file(const char *, cap_t);
93
#endif
80
94
81
/* libcap/cap_proc.c */
95
/* libcap/cap_proc.c */
82
cap_t   cap_get_proc(void);
96
cap_t   cap_get_proc(void);
Lines 96-101 Link Here
96
 * if the following _POSIX_SOURCE is _undefined_
110
 * if the following _POSIX_SOURCE is _undefined_
97
 */
111
 */
98
112
113
#ifndef SWIG
99
#if !defined(_POSIX_SOURCE)
114
#if !defined(_POSIX_SOURCE)
100
115
101
extern int capset(cap_user_header_t header, cap_user_data_t data);
116
extern int capset(cap_user_header_t header, cap_user_data_t data);
Lines 105-110 Link Here
105
extern char const *_cap_names[];
120
extern char const *_cap_names[];
106
121
107
#endif /* !defined(_POSIX_SOURCE) */
122
#endif /* !defined(_POSIX_SOURCE) */
123
#endif
108
124
109
#ifdef __cplusplus
125
#ifdef __cplusplus
110
}
126
}
(-)libcap-1.10/libcap/Makefile (-1 / +16 lines)
Lines 30-35 Link Here
30
# Library version
30
# Library version
31
#
31
#
32
LIBNAME=libcap.so
32
LIBNAME=libcap.so
33
PYTHONMODNAME=libcapmodule.so
33
#
34
#
34
35
35
FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
36
FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
Lines 42-48 Link Here
42
MAJLIBNAME=$(LIBNAME).$(VERSION)
43
MAJLIBNAME=$(LIBNAME).$(VERSION)
43
MINLIBNAME=$(MAJLIBNAME).$(MINOR)
44
MINLIBNAME=$(MAJLIBNAME).$(MINOR)
44
45
46
ifdef PYTHON
47
all: $(MINLIBNAME) $(PYTHONMODNAME)
48
else
45
all: $(MINLIBNAME)
49
all: $(MINLIBNAME)
50
endif
46
51
47
_makenames: _makenames.c cap_names.sed
52
_makenames: _makenames.c cap_names.sed
48
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
53
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
Lines 60-65 Link Here
60
	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
65
	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
61
	ln -sf $(MAJLIBNAME) $(LIBNAME)
66
	ln -sf $(MAJLIBNAME) $(LIBNAME)
62
67
68
libcap_wrap.c: include/sys/capability.h
69
	swig -python -o libcap_wrap.c include/sys/capability.h
70
71
$(PYTHONMODNAME): $(OBJS) libcap_wrap.o
72
	$(LD) -x -shared -o $@ libcap_wrap.o $(OBJS)
73
63
%.o: %.c $(INCLS)
74
%.o: %.c $(INCLS)
64
	$(CC) $(CFLAGS) -c $< -o $@
75
	$(CC) $(CFLAGS) -c $< -o $@
65
76
Lines 71-80 Link Here
71
	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
82
	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
72
	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
83
	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
73
	-/sbin/ldconfig
84
	-/sbin/ldconfig
85
ifdef PYTHON
86
	mkdir -p $(PYTHONMODDIR)
87
	install -m 0644 $(PYTHONMODNAME) $(PYTHONMODDIR)/$(PYTHONMODNAME)
88
endif
74
89
75
clean:
90
clean:
76
	$(LOCALCLEAN)
91
	$(LOCALCLEAN)
77
	rm -f $(OBJS) $(LIBNAME)*
92
	rm -f $(OBJS) $(LIBNAME)*
78
	rm -f cap_names.h cap_names.sed _makenames
93
	rm -f cap_names.h cap_names.sed _makenames libcap_wrap.c
79
	cd include/sys && $(LOCALCLEAN)
94
	cd include/sys && $(LOCALCLEAN)
80
95
(-)libcap-1.10/Make.Rules (+1 lines)
Lines 33-38 Link Here
33
SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin
33
SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin
34
INCDIR=$(FAKEROOT)$(inc_prefix)/include
34
INCDIR=$(FAKEROOT)$(inc_prefix)/include
35
LIBDIR=$(FAKEROOT)$(lib_prefix)/lib
35
LIBDIR=$(FAKEROOT)$(lib_prefix)/lib
36
PYTHONMODDIR=$(FAKEROOT)$(prefix)/lib/python/site-packages
36
37
37
# common defines for libcap (suitable for 2.2.1+ Linux kernels)
38
# common defines for libcap (suitable for 2.2.1+ Linux kernels)
38
VERSION=1
39
VERSION=1

Return to bug 2333