- some more tweaks for the binding packages
[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-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 %py_requires
140 Summary:        Python bindings for the libsolv library
141 Group:          Development/Languages/Python
142
143 %description -n python-solv
144 Python bindings for sat solver.
145
146 %package -n perl-solv
147 Requires:       perl = %{perl_version}
148 Summary:        Perl bindings for the libsolv library
149 Group:          Development/Languages/Perl
150
151 %description -n perl-solv
152 Perl bindings for sat solver.
153
154 %prep
155 %setup -n libsolv-%{version}
156
157 %build
158 export CFLAGS="$RPM_OPT_FLAGS"
159 export CXXFLAGS="$CFLAGS"
160
161 CMAKE_FLAGS=
162 %if 0%{?fedora_version}
163 CMAKE_FLAGS="-DFEDORA=1"
164 %endif
165
166 cmake   $CMAKE_FLAGS \
167         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
168         -DLIB=%{_lib} \
169         -DCMAKE_VERBOSE_MAKEFILE=TRUE \
170         -DCMAKE_BUILD_TYPE=Release \
171         %{?with_enable_static:-DENABLE_STATIC=1} \
172         %{?with_disable_shared:-DDISABLE_SHARED=1} \
173         %{?with_perl_binding:-DENABLE_PERL=1} \
174         %{?with_python_binding:-DENABLE_PYTHON=1} \
175         %{?with_ruby_binding:-DENABLE_RUBY=1} \
176         -DUSE_VENDORDIRS=1 \
177         -DCMAKE_SKIP_RPATH=1 
178 make %{?jobs:-j %jobs}
179
180 %install
181 make DESTDIR=$RPM_BUILD_ROOT install
182 %if %{with python_binding}
183 pushd $RPM_BUILD_ROOT/%{py_sitedir}
184 python %py_libdir/py_compile.py *.py
185 python -O %py_libdir/py_compile.py *.py
186 popd
187 %endif
188 # we want to leave the .a file untouched
189 export NO_BRP_STRIP_DEBUG=true
190
191 %clean
192 rm -rf "$RPM_BUILD_ROOT"
193
194 %if !%{with disable_shared}
195 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
196
197 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
198
199 %files -n libsolv@LIBSOLV_SOVERSION@
200 %defattr(-,root,root)
201 %doc LICENSE*
202 %_libdir/libsolv.so.*
203 %_libdir/libsolvext.so.*
204 %endif
205
206 %files tools
207 %defattr(-,root,root)
208 %exclude /usr/bin/helix2solv
209 %exclude /usr/bin/solv
210 /usr/bin/*
211
212 %files devel
213 %defattr(-,root,root)
214 %_libdir/libsolv.so
215 %_libdir/libsolvext.so
216 /usr/include/solv
217 /usr/bin/helix2solv
218
219 %files demo
220 %defattr(-,root,root)
221 /usr/bin/solv
222
223 %if %{with perl_binding}
224 %files -n perl-solv
225 %defattr(-,root,root)
226 %{perl_vendorarch}/*
227 %endif
228
229 %if %{with ruby_binding}
230 %files -n ruby-solv
231 %defattr(-,root,root)
232 %{ruby_vendorarch}/*
233 %endif
234
235 %if %{with python_binding}
236 %files -n python-solv
237 %defattr(-,root,root)
238 %{py_sitedir}/*
239 %endif
240
241 %changelog