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