Browse code

Move python2 requires to python subpackage and added python3 for packages audit, cracklib and deltarpm. (bug 1878219).

Change-Id: I6b436e6fb78b6c225b702899d75998fe18a245d5
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2749
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Divya Thaluru <dthaluru@vmware.com>

xiaolin-vmware authored on 2017/05/26 06:59:00
Showing 3 changed files
... ...
@@ -1,7 +1,10 @@
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
+
1 4
 Summary:        Kernel Audit Tool
2 5
 Name:           audit
3 6
 Version:        2.7.5
4
-Release:        1%{?dist}
7
+Release:        2%{?dist}
5 8
 Source0:        http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
6 9
 %define sha1    audit=7aaae7ea80f2280b25f243916e8d18b7338b5f53
7 10
 License:        GPLv2+
... ...
@@ -9,8 +12,6 @@ Group:          System Environment/Security
9 9
 URL:            http://people.redhat.com/sgrubb/audit/
10 10
 Vendor:         VMware, Inc.
11 11
 Distribution:   Photon
12
-BuildRequires:  python2-devel
13
-BuildRequires:  python2-libs
14 12
 BuildRequires:  krb5-devel
15 13
 BuildRequires:  openldap
16 14
 BuildRequires:  go
... ...
@@ -22,7 +23,6 @@ BuildRequires:  systemd
22 22
 Requires:       systemd
23 23
 Requires:       krb5
24 24
 Requires:       openldap
25
-Requires:       python2
26 25
 Requires:       tcp_wrappers
27 26
 Requires:       libcap-ng
28 27
 Requires:       gawk
... ...
@@ -32,13 +32,37 @@ The audit package contains the user space utilities for
32 32
 storing and searching the audit records generate by
33 33
 the audit subsystem in the Linux 2.6 kernel.
34 34
 
35
-%package devel
36
-Summary:    The libraries and header files needed for audit development.
37
-Requires:   %{name} = %{version}-%{release}
35
+%package        devel
36
+Summary:        The libraries and header files needed for audit development.
37
+Requires:       %{name} = %{version}-%{release}
38 38
 
39
-%description devel
39
+%description    devel
40 40
 The libraries and header files needed for audit development.
41 41
 
42
+%package        python
43
+Summary:        Python bindings for libaudit
44
+License:        LGPLv2+
45
+BuildRequires:  python2-devel
46
+BuildRequires:  python2-libs
47
+Requires:       %{name} = %{version}-%{release}
48
+Requires:       python2
49
+
50
+%description python
51
+The audit-python package contains the python2 bindings for libaudit
52
+and libauparse.
53
+
54
+%package  -n    python3-audit
55
+Summary:        Python3 bindings for libaudit
56
+License:        LGPLv2+
57
+BuildRequires:  python3-devel
58
+BuildRequires:  python3-libs
59
+Requires:       %{name} = %{version}-%{release}
60
+Requires:       python3
61
+
62
+%description -n python3-audit
63
+The python3-audit package contains the python2 bindings for libaudit
64
+and libauparse.
65
+
42 66
 %prep
43 67
 %setup -q
44 68
 
... ...
@@ -50,12 +74,12 @@ The libraries and header files needed for audit development.
50 50
     --libdir=%{_libdir} \
51 51
     --sysconfdir=%{_sysconfdir} \
52 52
     --with-python=yes \
53
-    --without-python3 \
54
-        --with-libwrap \
53
+    --with-python3=yes \
54
+    --with-libwrap \
55 55
     --enable-gssapi-krb5=yes \
56
-        --with-libcap-ng=yes \
56
+    --with-libcap-ng=yes \
57 57
     --with-aarch64 \
58
-        --enable-zos-remote \
58
+    --enable-zos-remote \
59 59
     --with-golang \
60 60
     --enable-systemd \
61 61
     --disable-static
... ...
@@ -87,7 +111,6 @@ make %{?_smp_mflags} check
87 87
 %{_bindir}/*
88 88
 %{_sbindir}/*
89 89
 %{_libdir}/*.so.*
90
-%{_libdir}/python*/*
91 90
 %{_libdir}/systemd/system/auditd.service
92 91
 %{_libexecdir}/*
93 92
 %{_mandir}/man5/*
... ...
@@ -122,7 +145,17 @@ make %{?_smp_mflags} check
122 122
 %{_mandir}/man3/*
123 123
 /usr/share/aclocal/audit.m4
124 124
 
125
+%files python
126
+%defattr(-,root,root)
127
+%{python2_sitelib}/*
128
+
129
+%files -n python3-audit
130
+%defattr(-,root,root)
131
+%{python3_sitelib}/*
132
+
125 133
 %changelog
134
+*   Thu May 18 2017 Xiaolin Li <xiaolinl@vmware.com> 2.7.5-2
135
+-   Move python2 requires to python subpackage and added python3.
126 136
 *   Fri Apr 14 2017 Alexey Makhalov <amakhalov@vmware.com> 2.7.5-1
127 137
 -   Version update.
128 138
 *   Wed Dec 07 2016 Xiaolin Li <xiaolinl@vmware.com> 2.5-7
... ...
@@ -1,23 +1,21 @@
1
+%{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
1 3
 # Got this spec from http://downloads.sourceforge.net/cracklib/cracklib-2.9.6.tar.gz
2 4
 
3
-Summary:	A password strength-checking library.
4
-Name:		cracklib
5
-Version:	2.9.6
6
-Release:	5%{?dist}
7
-Group:		System Environment/Libraries
8
-Source:		cracklib-%{version}.tar.gz
9
-%define sha1 cracklib-%{version}=9199e7b8830717565a844430653f5a90a04fcd65
10
-Source1:	cracklib-words-%{version}.gz
11
-%define sha1 cracklib-words-%{version}=b0739c990431a0971545dff347b50f922604c1cd
12
-Patch0:		CVE-2016-6318.patch
13
-URL:		http://sourceforge.net/projects/cracklib/
14
-License:	GPL
15
-Vendor:     VMware, Inc.
16
-Distribution: Photon
17
-
18
-BuildRequires: python2
19
-BuildRequires: python2-libs
20
-BuildRequires: python2-devel
5
+Summary:        A password strength-checking library.
6
+Name:           cracklib
7
+Version:        2.9.6
8
+Release:        6%{?dist}
9
+Group:          System Environment/Libraries
10
+Source:         cracklib-%{version}.tar.gz
11
+%define sha1    cracklib-%{version}=9199e7b8830717565a844430653f5a90a04fcd65
12
+Source1:        cracklib-words-%{version}.gz
13
+%define sha1    cracklib-words-%{version}=b0739c990431a0971545dff347b50f922604c1cd
14
+Patch0:         CVE-2016-6318.patch
15
+URL:            http://sourceforge.net/projects/cracklib/
16
+License:        GPL
17
+Vendor:         VMware, Inc.
18
+Distribution:   Photon
21 19
 
22 20
 %description
23 21
 CrackLib tests passwords to determine whether they match certain
... ...
@@ -41,12 +39,12 @@ passwords to see if they are at least minimally secure. If you
41 41
 install CrackLib, you'll also want to install the cracklib-dicts
42 42
 package.
43 43
 
44
-%package	dicts
45
-Summary:	The standard CrackLib dictionaries.
46
-Group:		System Environment/Utilities
44
+%package    dicts
45
+Summary:    The standard CrackLib dictionaries.
46
+Group:      System Environment/Utilities
47 47
 Requires:   cracklib
48 48
 
49
-%description	dicts
49
+%description    dicts
50 50
 The cracklib-dicts package includes the CrackLib dictionaries.
51 51
 CrackLib will need to use the dictionary appropriate to your system,
52 52
 which is normally put in /usr/share/dict/words.  Cracklib-dicts also contains
... ...
@@ -55,17 +53,22 @@ the utilities necessary for the creation of new dictionaries.
55 55
 If you are installing CrackLib, you should also install cracklib-dicts.
56 56
 
57 57
 %package devel
58
-Summary:	Cracklib link library & header file
59
-Group:		Development/Libraries
60
-Requires:	cracklib
58
+Summary:    Cracklib link library & header file
59
+Group:      Development/Libraries
60
+Requires:   cracklib
61 61
 
62 62
 %description devel
63 63
 The cracklib devel package include the needed library link and
64 64
 header files for development.
65 65
 
66
-%package python
66
+%package    python
67 67
 Summary:    The cracklib python module
68 68
 Group:      Development/Languages/Python
69
+BuildRequires:  python2
70
+BuildRequires:  python2-libs
71
+BuildRequires:  python2-devel
72
+BuildRequires:  python-setuptools
73
+
69 74
 Requires:   cracklib
70 75
 Requires:   python2
71 76
 Requires:   python2-libs
... ...
@@ -73,6 +76,20 @@ Requires:   python2-libs
73 73
 %description python
74 74
 The cracklib python module
75 75
 
76
+%package -n python3-cracklib
77
+Summary:        The cracklib python module
78
+Group:          Development/Languages/Python
79
+BuildRequires:  python3
80
+BuildRequires:  python3-libs
81
+BuildRequires:  python3-devel
82
+
83
+Requires:   cracklib
84
+Requires:   python3
85
+Requires:   python3-libs
86
+
87
+%description -n python3-cracklib
88
+The cracklib python3 module
89
+
76 90
 %package lang
77 91
 Summary:    The CrackLib language pack.
78 92
 Group:      System Environment/Libraries
... ...
@@ -97,9 +114,13 @@ CFLAGS="$RPM_OPT_FLAGS" ./configure \
97 97
   --libexecdir=%{_libdir} \
98 98
   --datadir=%{_datadir} \
99 99
   --disable-static \
100
-  --with-python
100
+  --without-python
101 101
 
102 102
 make
103
+pushd python
104
+python2 setup.py build
105
+python3 setup.py build
106
+popd
103 107
 
104 108
 %install
105 109
 rm -rf $RPM_BUILD_ROOT
... ...
@@ -112,6 +133,11 @@ rm -f $RPM_BUILD_ROOT/%{_datadir}/cracklib/cracklib-small
112 112
 ln -s cracklib-format $RPM_BUILD_ROOT/%{_sbindir}/mkdict
113 113
 ln -s cracklib-packer $RPM_BUILD_ROOT/%{_sbindir}/packer
114 114
 
115
+pushd python
116
+python2 setup.py install --skip-build --root %{buildroot}
117
+python3 setup.py install --skip-build --root %{buildroot}
118
+popd
119
+
115 120
 %check
116 121
 mkdir -p /usr/share/cracklib
117 122
 cp $RPM_BUILD_ROOT%{_datadir}/cracklib/* /usr/share/cracklib/
... ...
@@ -164,7 +190,11 @@ rm -f %{_datadir}/cracklib/pw_dict.pwi
164 164
 
165 165
 %files python
166 166
 %defattr(-,root,root)
167
-%{_libdir}/python*
167
+%{python2_sitelib}/*
168
+
169
+%files -n python3-cracklib
170
+%defattr(-,root,root)
171
+%{python3_sitelib}/*
168 172
 
169 173
 %files dicts
170 174
 %defattr(-,root,root)
... ...
@@ -176,6 +206,8 @@ rm -f %{_datadir}/cracklib/pw_dict.pwi
176 176
 %{_datadir}/locale/*
177 177
 
178 178
 %changelog
179
+*   Thu May 18 2017 Xiaolin Li <xiaolinl@vmware.com> 2.9.6-6
180
+-   Move python2 requires to python subpackage and added python3.
179 181
 *   Thu Apr 13 2017 Bo Gan <ganb@vmware.com> 2.9.6-5
180 182
 -   Fix CVE-2016-6318, trigger for cracklib-dicts
181 183
 -   Trigger for dynamic symlink for dict
... ...
@@ -1,25 +1,22 @@
1
-Summary: Create deltas between rpms
2
-Name: deltarpm
3
-Version: 3.6.1
4
-Release: 1%{?dist}
5
-License: BSD
6
-Group: Applications/System
7
-Vendor: VMware, Inc.
8
-Distribution: Photon
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
+
4
+Summary:        Create deltas between rpms
5
+Name:           deltarpm
6
+Version:        3.6.1
7
+Release:        2%{?dist}
8
+License:        BSD
9
+Group:          Applications/System
10
+Vendor:         VMware, Inc.
11
+Distribution:   Photon
9 12
 URL: https://github.com/rpm-software-management/deltarpm
10 13
 Source0: https://github.com/rpm-software-management/deltarpm/archive/deltarpm-%{version}.tar.gz
11 14
 %define sha1 deltarpm=29f39a8c55f48a7e538cabe49ca3203ebb823b2c
12
-BuildRequires: rpm-devel >= 4.2
13
-BuildRequires: bzip2-devel
14
-BuildRequires: xz-devel
15
-BuildRequires: popt-devel
16
-BuildRequires: python2
17
-BuildRequires: python2-libs
18
-BuildRequires: python2-devel
19
-Requires: perl
20
-Requires: python2
21
-Requires: python2-libs
22
-
15
+BuildRequires:  rpm-devel >= 4.2
16
+BuildRequires:  bzip2-devel
17
+BuildRequires:  xz-devel
18
+BuildRequires:  popt-devel
19
+Requires:       perl
23 20
 
24 21
 %description
25 22
 A deltarpm contains the difference between an old
... ...
@@ -28,6 +25,27 @@ to recreate the new rpm from the deltarpm and the old
28 28
 one. You don't have to have a copy of the old rpm,
29 29
 deltarpms can also work with installed rpms.
30 30
 
31
+%package        python
32
+Summary:        Python2 bindings for deltarpm
33
+License:        LGPLv2+
34
+BuildRequires:  python2-devel
35
+BuildRequires:  python2-libs
36
+Requires:       %{name} = %{version}-%{release}
37
+Requires:       python2
38
+
39
+%description python
40
+The deltarpm-python package contains the python2 bindings for deltarpm.
41
+
42
+%package  -n    python3-deltarpm
43
+Summary:        Python3 bindings for deltarpm
44
+License:        LGPLv2+
45
+BuildRequires:  python3-devel
46
+BuildRequires:  python3-libs
47
+Requires:       %{name} = %{version}-%{release}
48
+Requires:       python2
49
+
50
+%description -n python3-deltarpm
51
+The python3-deltarpm package contains the python3 bindings for deltarpm.
31 52
 %prep
32 53
 %setup
33 54
 
... ...
@@ -60,18 +78,27 @@ deltarpms can also work with installed rpms.
60 60
 %{_bindir}/makedeltarpm
61 61
 %{_bindir}/rpmdumpheader
62 62
 %{_bindir}/fragiso
63
+
64
+%files python
65
+%defattr(-,root,root)
63 66
 %{python_sitelib}/*
64 67
 
68
+%files -n python3-deltarpm
69
+%defattr(-,root,root)
70
+%{python3_sitelib}/*
71
+
65 72
 %changelog
66
-* Tue Apr 25 2017 Bo Gan <ganb@vmware.com> 3.6.1-1
67
-- Update to 3.6.1
68
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 3.6-2
69
--	GA - Bump release of all rpms
70
-* Tue Apr 28 2015 Fabio Rapposelli <fabio@vmware.com> - 3.6-2
71
-- Fixed Python install.
73
+*   Thu May 18 2017 Xiaolin Li <xiaolinl@vmware.com> 3.6.1-2
74
+-   Move python2 requires to python subpackage and added python3.
75
+*   Tue Apr 25 2017 Bo Gan <ganb@vmware.com> 3.6.1-1
76
+-   Update to 3.6.1
77
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 3.6-2
78
+-   GA - Bump release of all rpms
79
+*   Tue Apr 28 2015 Fabio Rapposelli <fabio@vmware.com> - 3.6-2
80
+-   Fixed Python install.
72 81
 
73
-* Fri Mar 09 2007 Dag Wieers <dag@wieers.com> - 3.3-2
74
-- Fixed group.
82
+*   Fri Mar 09 2007 Dag Wieers <dag@wieers.com> - 3.3-2
83
+-   Fixed group.
75 84
 
76
-* Sat Dec 03 2005 Dries Verachtert <dries@ulyssis.org> - 3.3-1
77
-- Initial package.
85
+*   Sat Dec 03 2005 Dries Verachtert <dries@ulyssis.org> - 3.3-1
86
+-   Initial package.