Fix swig source to resolve build error
[platform/upstream/libzypp-bindings.git] / packaging / libzypp-bindings.spec
1
2 # spec file for package libzypp-bindings
3 #
4 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
7 #
8 # Please submit bugfixes or comments via http://bugs.opensuse.org/
9
10 Name:           libzypp-bindings
11 Version:        0.7.4
12 Release:        0
13 License:        GPL-2.0+
14 Summary:        Bindings for libzypp
15 Group:          Development/Sources
16 Source:         %{name}-%{version}.tar.gz
17 Source1001:     libzypp-bindings.manifest
18 Source1002:     Fix_Swig_Source.patch
19
20 BuildRequires:  cmake gcc-c++ python-devel
21 BuildRequires:  swig
22
23 BuildRequires:  libzypp-devel
24
25 %description
26 This package provides bindings for libzypp, the library for package management.
27
28 %prep
29 %setup -q
30 cp %{SOURCE1001} .
31 %{__patch} -p1 < %{SOURCE1002}
32
33 %build
34 mkdir build
35 cd build
36 %cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
37       -DPYTHON_SITEDIR=%{python_sitearch} \
38       -DLIB=%{_lib} \
39       -DCMAKE_VERBOSE_MAKEFILE=TRUE \
40       -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
41       -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
42       -DCMAKE_BUILD_TYPE=Release \
43       -DCMAKE_SKIP_RPATH=1 \
44       ..
45 make -j1
46
47 %install
48 cd build
49 make install DESTDIR=$RPM_BUILD_ROOT
50
51 %clean
52
53 %package -n python-zypp
54 Summary:        Python bindings for libzypp
55 Group:          Development/Languages/Python
56 Requires:  libzypp
57
58 %description -n python-zypp
59 Python bindings of libzypp
60
61
62 %files -n python-zypp
63 %manifest %{name}.manifest
64 %defattr(-,root,root,-)
65 %{python_sitearch}/_zypp.so
66 %{python_sitearch}/zypp.py*