Browse code

Add python3 sub package to libselinux.

Change-Id: I75d67d8928318873b7d0d694a99324ae40bafbe0
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2833
Reviewed-by: Harish Udaiya Kumar <harishspqr@gmail.com>
Tested-by: gerrit-photon <photon-checkins@vmware.com>

xiaolin-vmware authored on 2017/06/01 08:38:01
Showing 1 changed files
... ...
@@ -1,18 +1,21 @@
1
-Summary:	SELinux library and simple utilities
2
-Name:		libselinux
3
-Version:	2.6
4
-Release:	2%{?dist}
5
-License:	Public Domain
6
-Group:		System Environment/Libraries
7
-Source0:	https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160107/%{name}-%{version}.tar.gz
8
-%define sha1 libselinux=38213c5f3298c980a399ea73e47498e7a393e4f7
9
-Url:		https://github.com/SELinuxProject/selinux/wiki
10
-Vendor:		VMware, Inc.
11
-Distribution:	Photon
12
-BuildRequires:	libsepol-devel
13
-BuildRequires:	pcre-devel, swig
14
-Requires:	pcre-libs
15
-Requires:	libsepol
1
+%{!?python2_sitelib: %global python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
3
+Summary:        SELinux library and simple utilities
4
+Name:           libselinux
5
+Version:        2.6
6
+Release:        3%{?dist}
7
+License:        Public Domain
8
+Group:          System Environment/Libraries
9
+Source0:        https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160107/%{name}-%{version}.tar.gz
10
+%define sha1    libselinux=38213c5f3298c980a399ea73e47498e7a393e4f7
11
+Url:            https://github.com/SELinuxProject/selinux/wiki
12
+Vendor:         VMware, Inc.
13
+Distribution:   Photon
14
+BuildRequires:  libsepol-devel
15
+BuildRequires:  pcre-devel, swig
16
+BuildRequires:  python3-devel
17
+Requires:       pcre-libs
18
+Requires:       libsepol
16 19
 
17 20
 %description
18 21
 Security-enhanced Linux is a feature of the Linux® kernel and a number
... ...
@@ -29,35 +32,46 @@ libselinux provides an API for SELinux applications to get and set
29 29
 process and file security contexts and to obtain security policy
30 30
 decisions.  Required for any applications that use the SELinux API.
31 31
 
32
-%package	utils
33
-Summary:	SELinux libselinux utilies
34
-Group:		Development/Libraries
35
-Requires:	libselinux = %{version}-%{release} 
32
+%package        utils
33
+Summary:        SELinux libselinux utilies
34
+Group:          Development/Libraries
35
+Requires:       libselinux = %{version}-%{release} 
36 36
 
37
-%description	utils
37
+%description    utils
38 38
 The libselinux-utils package contains the utilities
39 39
 
40
-%package	devel
41
-Summary:	Header files and libraries used to build SELinux
42
-Group:		Development/Libraries
43
-Requires:	libselinux = %{version}-%{release}
44
-Requires:	pcre-devel
45
-Requires:	libsepol-devel 
46
-Provides:	pkgconfig(libselinux)
40
+%package        devel
41
+Summary:        Header files and libraries used to build SELinux
42
+Group:          Development/Libraries
43
+Requires:       libselinux = %{version}-%{release}
44
+Requires:       pcre-devel
45
+Requires:       libsepol-devel
46
+Provides:       pkgconfig(libselinux)
47 47
 
48
-%description	devel
48
+%description    devel
49 49
 The libselinux-devel package contains the libraries and header files
50 50
 needed for developing SELinux applications. 
51 51
 
52 52
 %package        python
53
-Summary:        SELinux python bindings for libselinux
53
+Summary:        SELinux python2 bindings for libselinux
54 54
 Group:          Development/Libraries
55 55
 Requires:       libselinux = %{version}-%{release}
56 56
 Requires:       python2
57 57
 Requires:       python2-libs
58 58
 
59 59
 %description    python
60
-The libselinux-python package contains the python bindings for developing
60
+The libselinux-python package contains the python2 bindings for developing
61
+SELinux applications.
62
+
63
+%package        python3
64
+Summary:        SELinux python3 bindings for libselinux
65
+Group:          Development/Libraries
66
+Requires:       libselinux = %{version}-%{release}
67
+Requires:       python3
68
+Requires:       python3-libs
69
+
70
+%description    python3
71
+The libselinux-python package contains the python3 bindings for developing
61 72
 SELinux applications.
62 73
 
63 74
 %prep
... ...
@@ -66,10 +80,13 @@ SELinux applications.
66 66
 %build
67 67
 make clean
68 68
 make %{?_smp_mflags} swigify
69
-make LIBDIR="%{_libdir}" %{?_smp_mflags} pywrap
69
+make LIBDIR="%{_libdir}" %{?_smp_mflags} PYTHON=/usr/bin/python2 pywrap
70
+make LIBDIR="%{_libdir}" %{?_smp_mflags} PYTHON=/usr/bin/python3 pywrap
70 71
 
71 72
 %install
72
-make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_bindir}" SBINDIR="%{buildroot}%{_sbindir}" install install-pywrap
73
+make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_bindir}" SBINDIR="%{buildroot}%{_sbindir}" PYTHON=/usr/bin/python2 install install-pywrap
74
+
75
+make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_bindir}" SBINDIR="%{buildroot}%{_sbindir}" PYTHON=/usr/bin/python3 install install-pywrap
73 76
 
74 77
 mkdir -p %{buildroot}/%{_prefix}/lib/tmpfiles.d
75 78
 mkdir -p %{buildroot}/var/run/setrans
... ...
@@ -85,10 +102,8 @@ rm -rf %{buildroot}
85 85
 %files
86 86
 %defattr(-,root,root,-)
87 87
 %ghost /var/run/setrans
88
-%{_libdir}/*
88
+%{_libdir}/libselinux.so.1
89 89
 %{_prefix}/lib/tmpfiles.d/libselinux.conf
90
-%exclude %{_libdir}/pkgconfig
91
-%exclude /usr/lib/debug
92 90
 
93 91
 %files utils
94 92
 %defattr(-,root,root,-)
... ...
@@ -107,19 +122,24 @@ rm -rf %{buildroot}
107 107
 
108 108
 %files python
109 109
 %defattr(-,root,root,-)
110
-%dir %{python_sitearch}/selinux
111
-%{python_sitearch}/selinux/*
110
+%{python2_sitelib}/*
111
+
112
+%files python3
113
+%defattr(-,root,root,-)
114
+%{python3_sitelib}/*
112 115
 
113 116
 %changelog
114
-*	Wed May 22 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 2.6-2
115
--	Include python subpackage.
116
-*	Wed May 03 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 2.6-1
117
--	Upgraded to version 2.6
118
-*	Tue May 02 2017 Anish Swaminathan <anishs@vmware.com> 2.5-3
119
--	Remove pcre requires and add requires on pcre-libs
120
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.5-2
121
--	GA - Bump release of all rpms
122
-*	Fri Jan 22 2016 Xiaolin Li <xiaolinl@vmware.com> 2.5-1
123
--	Updated to version 2.5
124
-*	Wed Feb 25 2015 Divya Thaluru <dthaluru@vmware.com> 2.4-1
125
--	Initial build.	First version
117
+*   Wed May 31 2017 Xiaolin Li <xiaolinl@vmware.com> 2.6-3
118
+-   Include pytho3 packages.
119
+*   Wed May 22 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 2.6-2
120
+-   Include python subpackage.
121
+*   Wed May 03 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 2.6-1
122
+-   Upgraded to version 2.6
123
+*   Tue May 02 2017 Anish Swaminathan <anishs@vmware.com> 2.5-3
124
+-   Remove pcre requires and add requires on pcre-libs
125
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.5-2
126
+-   GA - Bump release of all rpms
127
+*   Fri Jan 22 2016 Xiaolin Li <xiaolinl@vmware.com> 2.5-1
128
+-   Updated to version 2.5
129
+*   Wed Feb 25 2015 Divya Thaluru <dthaluru@vmware.com> 2.4-1
130
+-   Initial build.  First version