Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 64199 | Differences between
and this patch

Collapse All | Expand All

(-)libcap-1.10-14.static/libcap/include/sys/capability.h (+17 lines)
Lines 15-26 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 "libcap.h"
31
%}
32
#else
23
#include <sys/types.h>
33
#include <sys/types.h>
34
#endif
24
/*
35
/*
25
 * This is <linux/capability.h>
36
 * This is <linux/capability.h>
26
 *
37
 *
Lines 52-57 Link Here
52
 
63
 
53
#define _LINUX_CAPABILITY_VERSION  0x19980330
64
#define _LINUX_CAPABILITY_VERSION  0x19980330
54
65
66
#ifndef SWIG
55
typedef struct __user_cap_header_struct {
67
typedef struct __user_cap_header_struct {
56
	__u32 version;
68
	__u32 version;
57
	int pid;
69
	int pid;
Lines 62-67 Link Here
62
        __u32 permitted;
74
        __u32 permitted;
63
        __u32 inheritable;
75
        __u32 inheritable;
64
} *cap_user_data_t;
76
} *cap_user_data_t;
77
#endif
65
  
78
  
66
#ifdef __KERNEL__
79
#ifdef __KERNEL__
67
80
Lines 354-363 Link Here
354
int     cap_clear(cap_t);
367
int     cap_clear(cap_t);
355
368
356
/* libcap/cap_file.c */
369
/* libcap/cap_file.c */
370
#ifndef SWIG
357
cap_t   cap_get_fd(int);
371
cap_t   cap_get_fd(int);
358
cap_t   cap_get_file(const char *);
372
cap_t   cap_get_file(const char *);
359
int     cap_set_fd(int, cap_t);
373
int     cap_set_fd(int, cap_t);
360
int     cap_set_file(const char *, cap_t);
374
int     cap_set_file(const char *, cap_t);
375
#endif
361
376
362
/* libcap/cap_proc.c */
377
/* libcap/cap_proc.c */
363
cap_t   cap_get_proc(void);
378
cap_t   cap_get_proc(void);
Lines 377-382 Link Here
377
 * if the following _POSIX_SOURCE is _undefined_
392
 * if the following _POSIX_SOURCE is _undefined_
378
 */
393
 */
379
394
395
#ifndef SWIG
380
#if !defined(_POSIX_SOURCE)
396
#if !defined(_POSIX_SOURCE)
381
397
382
extern int capset(cap_user_header_t header, cap_user_data_t data);
398
extern int capset(cap_user_header_t header, cap_user_data_t data);
Lines 386-391 Link Here
386
extern char const *_cap_names[];
402
extern char const *_cap_names[];
387
403
388
#endif /* !defined(_POSIX_SOURCE) */
404
#endif /* !defined(_POSIX_SOURCE) */
405
#endif
389
406
390
#ifdef __cplusplus
407
#ifdef __cplusplus
391
}
408
}
(-)libcap-1.10-14.static/libcap/Makefile (-1 / +24 lines)
Lines 34-39 Link Here
34
#
34
#
35
LIBNAME=libcap
35
LIBNAME=libcap
36
STATLIBNAME=$(LIBNAME).a
36
STATLIBNAME=$(LIBNAME).a
37
PYTHONMODNAME=_$(LIBNAME).so
38
PYTHONPYNAME=$(LIBNAME).py
37
#
39
#
38
40
39
FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
41
FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
Lines 47-53 Link Here
47
MAJLIBNAME=$(LIBNAME).so.$(VERSION)
49
MAJLIBNAME=$(LIBNAME).so.$(VERSION)
48
MINLIBNAME=$(MAJLIBNAME).$(MINOR)
50
MINLIBNAME=$(MAJLIBNAME).$(MINOR)
49
51
52
ifdef PYTHON
53
all: $(MINLIBNAME) $(STATLIBNAME) $(PYTHONMODNAME)
54
else
50
all: $(MINLIBNAME) $(STATLIBNAME)
55
all: $(MINLIBNAME) $(STATLIBNAME)
56
endif
51
57
52
_makenames: _makenames.c cap_names.sed
58
_makenames: _makenames.c cap_names.sed
53
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
59
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
Lines 67-72 Link Here
67
	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
73
	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
68
	ln -sf $(MAJLIBNAME) $(LIBNAME).so
74
	ln -sf $(MAJLIBNAME) $(LIBNAME).so
69
75
76
libcap_wrap.c: include/sys/capability.h
77
	swig -python -o libcap_wrap.c include/sys/capability.h
78
79
$(PYTHONMODNAME): $(OBJS) libcap_wrap.o
80
	$(LD) -x -shared -o $@ libcap_wrap.o $(OBJS)
81
82
libcap_wrap.c: include/sys/capability.h
83
	swig -python -o libcap_wrap.c include/sys/capability.h
84
85
$(PYTHONMODNAME): $(OBJS) libcap_wrap.o
86
	$(LD) -x -shared -o $@ libcap_wrap.o $(OBJS)
87
70
%.o: %.c $(INCLS)
88
%.o: %.c $(INCLS)
71
	$(CC) $(CFLAGS) -c $< -o $@
89
	$(CC) $(CFLAGS) -c $< -o $@
72
90
Lines 83-92 Link Here
83
	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
101
	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
84
	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME).so
102
	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME).so
85
	-/sbin/ldconfig
103
	-/sbin/ldconfig
104
ifdef PYTHON
105
	mkdir -p $(PYTHONMODDIR)
106
	install -m 0644 $(PYTHONMODNAME) $(PYTHONMODDIR)/$(PYTHONMODNAME)
107
	install -m 0644 $(PYTHONPYNAME) $(PYTHONMODDIR)/$(PYTHONPYNAME)
108
endif
86
109
87
clean:
110
clean:
88
	$(LOCALCLEAN)
111
	$(LOCALCLEAN)
89
	rm -f $(OBJS) $(LOBJS) $(STATLIBNAME) $(LIBNAME).so*
112
	rm -f $(OBJS) $(LOBJS) $(STATLIBNAME) $(LIBNAME).so*
90
	rm -f cap_names.h cap_names.sed _makenames
113
	rm -f cap_names.h cap_names.sed _makenames libcap_wrap.c
91
	cd include/sys && $(LOCALCLEAN)
114
	cd include/sys && $(LOCALCLEAN)
92
115

Return to bug 64199