summaryrefslogtreecommitdiff
path: root/packaging/python-rpm.spec
blob: f27dd1d37f25a2b9b772c10326784e112da6b7ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Name:           python-rpm
Version:        4.11.0.1
Release:        0
Summary:        Python Bindings for Manipulating RPM Packages
License:        GPL-2.0+
Group:          System/Packages
Source99:       rpm.spec
BuildRequires:  gettext-tools
BuildRequires:  file-devel
BuildRequires:  libacl-devel
BuildRequires:  bzip2-devel
BuildRequires:  libcap-devel
BuildRequires:  libelf-devel
BuildRequires:  libtool
BuildRequires:  lua-devel
BuildRequires:  ncurses-devel
BuildRequires:  popt-devel
BuildRequires:  python-devel
BuildRequires:  xz-devel
BuildRequires:  zlib-devel
BuildRequires:  nss-devel
BuildRequires:  uthash-devel
BuildRequires:  libxml2-devel
BuildRequires:  libattr-devel
BuildRequires:  pkgconfig(libsmack)
Requires:       rpm = %{version}
%{expand:%(sed -n -e '/^Source0:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)}
%global with_python 2

%description
The python-rpm package contains a module that permits applications
written in the Python programming language to use the interface
supplied by RPM Package Manager libraries.

This package should be installed if you want to develop Python programs
that will manipulate RPM packages and databases.

%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')}

%install
mkdir -p %{buildroot}%{_prefix}/lib
# only installing in python/ does not work because rpm links against
# installed libs at install time
%make_install
find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python*/site-packages/rpm/\* -print0 | xargs -0 rm
pushd %{buildroot}/%{_libdir}/python*/site-packages/rpm
rm -f _rpmmodule.a _rpmmodule.la
#python %{_libdir}/python*/py_compile.py *.py
#python -O %{_libdir}/python*/py_compile.py *.py
popd

%files
%defattr(-,root,root)
%{_libdir}/python*/*/*

%changelog