Tizen 2.1 base
[external/libzypp-bindings.git] / libzypp-bindings.spec.cmake
1 #
2 # spec file for package libzypp-bindings
3 #
4 # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
5  #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
16 #
17
18 # nodebuginfo
19
20 Name:           @PACKAGE@
21 Version:        @VERSION@
22 Release:        0
23 License:        GPLv2+
24 Summary:        Bindings for libzypp
25 Group:          Development/Sources
26 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
27 BuildRequires:  cmake python-devel ruby-devel
28 BuildRequires:  gcc-c++ >= 4.5
29 BuildRequires:  swig >= 1.3.40
30 BuildRequires:  libzypp-devel >= 10.2.0
31 Source:         %{name}-%{version}.tar.bz2
32
33 %description
34 This package provides bindings for libzypp, the library for package management.
35
36 %prep
37 %setup -q
38
39 %build
40 mkdir build
41 cd build
42 cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
43       -DPYTHON_SITEDIR=%{py_sitedir} \
44       -DLIB=%{_lib} \
45       -DCMAKE_VERBOSE_MAKEFILE=TRUE \
46       -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
47       -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
48       -DCMAKE_BUILD_TYPE=Release \
49       -DCMAKE_SKIP_RPATH=1 \
50       ..
51 # the swig compile jobs take a lot of memory, so don't use jobs here
52 make -j1
53
54 %check
55 cd build
56 make test
57
58 %install
59 cd build
60 make install DESTDIR=$RPM_BUILD_ROOT
61
62 %clean
63 %{__rm} -rf %{buildroot}
64
65 %package -n ruby-zypp
66 License:        GPLv2+
67 Summary:        Ruby bindings for libzypp
68 Group:          Development/Languages/Ruby
69
70 %description -n ruby-zypp
71 -
72
73 %files -n ruby-zypp
74 %defattr(-,root,root,-)
75 %if 0%{?suse_version}
76 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/zypp.so
77 %endif
78 %if 0%{?mandriva_version}
79 %{ruby_sitearchdir}/zypp.so
80 %endif
81
82 %package -n python-zypp
83 License:        GPLv2+
84 Summary:        Python bindings for libzypp
85 Group:          Development/Languages/Python
86 %description -n python-zypp
87 -
88
89 %files -n python-zypp
90 %defattr(-,root,root,-)
91 %{py_sitedir}/_zypp.so
92 %{py_sitedir}/zypp.py
93
94 %package -n perl-zypp
95 License:        GPLv2+
96 Requires:       perl = %{perl_version}
97 Summary:        Perl bindings for libzypp
98 Group:          Development/Languages/Perl
99
100 %description -n perl-zypp
101 -
102
103 %files -n perl-zypp
104 %defattr(-,root,root,-)
105 %{perl_vendorlib}/zypp.pm
106 %{perl_vendorarch}/zypp.so
107
108 %changelog