- build perl bindings with -Wno-nonnull for SLE 11 SP1
[platform/upstream/libsolv.git] / package / libsolv.spec.in
1 Name:           libsolv
2 Version:        @VERSION@
3 Release:        1
4 License:        BSD 3-Clause
5 Url:            git://gitorious.org/opensuse/libsolv.git
6 Source:         libsolv-%{version}.tar.bz2
7 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
8 Group:          Development/Libraries/C and C++
9 Prefix:         /usr
10
11 %bcond_with    enable_static
12 %bcond_with    disable_shared
13 %bcond_without perl_binding
14 %bcond_without python_binding
15 %bcond_without ruby_binding
16
17 %if 0%{?mandriva_version}
18 # force this version on mandriva
19 BuildRequires:  libneon0.26-devel
20 %endif
21 %if 0%{?fedora_version}
22 BuildRequires:  db4-devel
23 %endif
24 %if 0%{?suse_version}
25 %if 0%{?suse_version} < 1030
26 BuildRequires:  expat
27 %else
28 BuildRequires:  libexpat-devel
29 %endif
30 %if 0%{?suse_version} < 1100
31 BuildRequires:  graphviz
32 %endif
33 %if 0%{?suse_version} > 1020
34 BuildRequires:  fdupes
35 %endif
36 %else
37 BuildRequires:  expat-devel
38 %endif
39 BuildRequires:  cmake rpm-devel gcc-c++
40 BuildRequires:  zlib-devel
41
42 %if %{with perl_binding}
43 BuildRequires: perl
44 BuildRequires: swig
45 %endif
46 %if %{with ruby_binding}
47 %global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"]')
48 BuildRequires: ruby ruby-devel
49 BuildRequires: swig
50 %endif
51 %if %{with python_binding}
52 BuildRequires: python-devel
53 BuildRequires: swig
54 %endif
55
56 Summary:        A new approach to package dependency solving
57
58
59 %description
60 A new approach to package dependency solving
61
62 Authors:
63 --------
64     Michael Schroeder <mls@suse.de>
65     Klaus Kaempf <kkaempf@suse.de>
66     Stephan Kulow <coolo@suse.de>
67     Michael Matz <matz@suse.de>
68     Duncan Mac-Vicar P. <dmacvicar@suse.de>
69
70 %if !%{with disable_shared}
71 %package -n libsolv@LIBSOLV_SOVERSION@
72 Summary:        A new approach to package dependency solving
73 Group:          Development/Libraries/C and C++
74
75 %description -n libsolv@LIBSOLV_SOVERSION@
76 A new approach to package dependency solving
77
78 Authors:
79 --------
80     Michael Schroeder <mls@suse.de>
81     Klaus Kaempf <kkaempf@suse.de>
82     Stephan Kulow <coolo@suse.de>
83     Michael Matz <matz@suse.de>
84     Duncan Mac-Vicar P. <dmacvicar@suse.de>
85
86 %endif
87 %package devel
88 Summary:        A new approach to package dependency solving
89 Group:          Development/Libraries/C and C++
90 Requires:       libsolv-tools = %version
91 %if !%{with disable_shared}
92 Requires:       libsolv@LIBSOLV_SOVERSION@ = %version
93 %endif
94 Requires:       rpm-devel
95
96 %description devel
97 Development files for libsolv, a new approach to package dependency solving
98
99 Authors:
100 --------
101     Michael Schroeder <mls@suse.de>
102     Klaus Kaempf <kkaempf@suse.de>
103     Stephan Kulow <coolo@suse.de>
104     Michael Matz <matz@suse.de>
105     Duncan Mac-Vicar P. <dmacvicar@suse.de>
106
107 %package tools
108 Summary:        A new approach to package dependency solving
109 Group:          Development/Libraries/C and C++
110 Obsoletes:      libsatsolver <= 0.0.15
111 Provides:       libsatsolver = %{version}-%{release}
112 Requires:       gzip bzip2 coreutils
113
114 %description tools
115 A new approach to package dependency solving.
116
117 %package demo
118 Summary:        Applications demoing the libsolv library
119 Group:          System/Management
120 Requires:       curl
121 %if 0%{?fedora_version}
122 Requires:       gnupg2
123 %endif
124 %if 0%{?suse_version}
125 Requires:       gpg2
126 %endif
127
128 %description demo
129 Applications demoing the libsolv library.
130
131 %package -n ruby-solv
132 Summary:        Ruby bindings for the libsolv library
133 Group:          Development/Languages/Ruby
134
135 %description -n ruby-solv
136 Ruby bindings for sat solver.
137
138 %package -n python-solv
139 %if 0{?py_requires}
140 %py_requires
141 %endif
142 Summary:        Python bindings for the libsolv library
143 Group:          Development/Languages/Python
144
145 %description -n python-solv
146 Python bindings for sat solver.
147
148 %package -n perl-solv
149 Requires:       perl = %{perl_version}
150 Summary:        Perl bindings for the libsolv library
151 Group:          Development/Languages/Perl
152
153 %description -n perl-solv
154 Perl bindings for sat solver.
155
156 %prep
157 %setup -n libsolv-%{version}
158
159 %build
160 export CFLAGS="$RPM_OPT_FLAGS"
161 export CXXFLAGS="$CFLAGS"
162
163 CMAKE_FLAGS=
164 %if 0%{?fedora_version}
165 CMAKE_FLAGS="-DFEDORA=1"
166 %endif
167
168 cmake   $CMAKE_FLAGS \
169         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
170         -DLIB=%{_lib} \
171         -DCMAKE_VERBOSE_MAKEFILE=TRUE \
172         -DCMAKE_BUILD_TYPE=Release \
173         %{?with_enable_static:-DENABLE_STATIC=1} \
174         %{?with_disable_shared:-DDISABLE_SHARED=1} \
175         %{?with_perl_binding:-DENABLE_PERL=1} \
176         %{?with_python_binding:-DENABLE_PYTHON=1} \
177         %{?with_ruby_binding:-DENABLE_RUBY=1} \
178         -DUSE_VENDORDIRS=1 \
179         -DCMAKE_SKIP_RPATH=1 
180 make %{?jobs:-j %jobs}
181
182 %install
183 make DESTDIR=$RPM_BUILD_ROOT install
184 %if %{with python_binding}
185 pushd $RPM_BUILD_ROOT/%{py_sitedir}
186 python %py_libdir/py_compile.py *.py
187 python -O %py_libdir/py_compile.py *.py
188 popd
189 %endif
190 # we want to leave the .a file untouched
191 export NO_BRP_STRIP_DEBUG=true
192
193 %clean
194 rm -rf "$RPM_BUILD_ROOT"
195
196 %if !%{with disable_shared}
197 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
198
199 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
200
201 %files -n libsolv@LIBSOLV_SOVERSION@
202 %defattr(-,root,root)
203 %doc LICENSE*
204 %_libdir/libsolv.so.*
205 %_libdir/libsolvext.so.*
206 %endif
207
208 %files tools
209 %defattr(-,root,root)
210 %exclude /usr/bin/helix2solv
211 %exclude /usr/bin/solv
212 /usr/bin/*
213
214 %files devel
215 %defattr(-,root,root)
216 %_libdir/libsolv.so
217 %_libdir/libsolvext.so
218 /usr/include/solv
219 /usr/bin/helix2solv
220
221 %files demo
222 %defattr(-,root,root)
223 /usr/bin/solv
224
225 %if %{with perl_binding}
226 %files -n perl-solv
227 %defattr(-,root,root)
228 %{perl_vendorarch}/*
229 %endif
230
231 %if %{with ruby_binding}
232 %files -n ruby-solv
233 %defattr(-,root,root)
234 %{ruby_vendorarch}/*
235 %endif
236
237 %if %{with python_binding}
238 %files -n python-solv
239 %defattr(-,root,root)
240 %{py_sitedir}/*
241 %endif
242
243 %changelog