summaryrefslogtreecommitdiff
path: root/package/libsolv.spec.in
blob: 2209d1f651c86d1b5a5b5eac73b09fc7a12851de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
Name:           libsolv
Version:        @VERSION@
Release:        1
License:        BSD 3-Clause
Url:            git://gitorious.org/opensuse/libsolv.git
Source:         libsolv-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Group:          Development/Libraries/C and C++
Prefix:         /usr

%bcond_with    enable_static
%bcond_with    disable_shared
%bcond_without perl_binding
%bcond_without python_binding
%bcond_without ruby_binding

%if 0%{?mandriva_version}
# force this version on mandriva
BuildRequires:  libneon0.26-devel
%endif
%if 0%{?fedora_version}
BuildRequires:  db4-devel
%endif
%if 0%{?suse_version}
%if 0%{?suse_version} < 1030
BuildRequires:  expat
%else
BuildRequires:  libexpat-devel
%endif
%if 0%{?suse_version} < 1100
BuildRequires:  graphviz
%endif
%if 0%{?suse_version} > 1020
BuildRequires:  fdupes
%endif
%else
BuildRequires:  expat-devel
%endif
BuildRequires:  cmake rpm-devel gcc-c++
BuildRequires:  zlib-devel

%if %{with perl_binding}
BuildRequires: perl
%if 0%{?fedora_version}
BuildRequires: perl-devel
%endif
BuildRequires: swig
%endif
%if %{with ruby_binding}
%if 0%{?fedora_version}
%global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')
%else
%global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"]')
%endif
BuildRequires: ruby ruby-devel
BuildRequires: swig
%endif
%if %{with python_binding}
%global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
BuildRequires: python-devel
BuildRequires: swig
%endif

Summary:        A new approach to package dependency solving


%description
A new approach to package dependency solving

Authors:
--------
    Michael Schroeder <mls@suse.de>
    Klaus Kaempf <kkaempf@suse.de>
    Stephan Kulow <coolo@suse.de>
    Michael Matz <matz@suse.de>
    Duncan Mac-Vicar P. <dmacvicar@suse.de>

%if !%{with disable_shared}
%package -n libsolv@LIBSOLV_SOVERSION@
Summary:        A new approach to package dependency solving
Group:          Development/Libraries/C and C++

%description -n libsolv@LIBSOLV_SOVERSION@
A new approach to package dependency solving

Authors:
--------
    Michael Schroeder <mls@suse.de>
    Klaus Kaempf <kkaempf@suse.de>
    Stephan Kulow <coolo@suse.de>
    Michael Matz <matz@suse.de>
    Duncan Mac-Vicar P. <dmacvicar@suse.de>

%endif
%package devel
Summary:        A new approach to package dependency solving
Group:          Development/Libraries/C and C++
Requires:       libsolv-tools = %version
%if !%{with disable_shared}
Requires:       libsolv@LIBSOLV_SOVERSION@ = %version
%endif
Requires:       rpm-devel

%description devel
Development files for libsolv, a new approach to package dependency solving

Authors:
--------
    Michael Schroeder <mls@suse.de>
    Klaus Kaempf <kkaempf@suse.de>
    Stephan Kulow <coolo@suse.de>
    Michael Matz <matz@suse.de>
    Duncan Mac-Vicar P. <dmacvicar@suse.de>

%package tools
Summary:        A new approach to package dependency solving
Group:          Development/Libraries/C and C++
Obsoletes:      libsatsolver <= 0.0.15
Provides:       libsatsolver = %{version}-%{release}
Requires:       gzip bzip2 coreutils

%description tools
A new approach to package dependency solving.

%package demo
Summary:        Applications demoing the libsolv library
Group:          System/Management
Requires:       curl
%if 0%{?fedora_version}
Requires:       gnupg2
%endif
%if 0%{?suse_version}
Requires:       gpg2
%endif

%description demo
Applications demoing the libsolv library.

%package -n ruby-solv
Summary:        Ruby bindings for the libsolv library
Group:          Development/Languages/Ruby

%description -n ruby-solv
Ruby bindings for sat solver.

%package -n python-solv
%if 0%{?py_requires:1}
%py_requires
%endif
Summary:        Python bindings for the libsolv library
Group:          Development/Languages/Python

%description -n python-solv
Python bindings for sat solver.

%package -n perl-solv
Requires:       perl = %{perl_version}
Summary:        Perl bindings for the libsolv library
Group:          Development/Languages/Perl

%description -n perl-solv
Perl bindings for sat solver.

%prep
%setup -n libsolv-%{version}

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$CFLAGS"

CMAKE_FLAGS=
%if 0%{?fedora_version}
CMAKE_FLAGS="-DFEDORA=1"
%endif

cmake   $CMAKE_FLAGS \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DLIB=%{_lib} \
	-DCMAKE_VERBOSE_MAKEFILE=TRUE \
	-DCMAKE_BUILD_TYPE=Release \
	%{?with_enable_static:-DENABLE_STATIC=1} \
	%{?with_disable_shared:-DDISABLE_SHARED=1} \
	%{?with_perl_binding:-DENABLE_PERL=1} \
	%{?with_python_binding:-DENABLE_PYTHON=1} \
	%{?with_ruby_binding:-DENABLE_RUBY=1} \
	-DUSE_VENDORDIRS=1 \
	-DCMAKE_SKIP_RPATH=1
make %{?jobs:-j %jobs}

%install
make DESTDIR=$RPM_BUILD_ROOT install
%if %{with python_binding}
%if 0%{?suse_version}
pushd $RPM_BUILD_ROOT/%{python_sitearch}
python %py_libdir/py_compile.py *.py
python -O %py_libdir/py_compile.py *.py
popd
%endif
%endif
# we want to leave the .a file untouched
export NO_BRP_STRIP_DEBUG=true

%clean
rm -rf "$RPM_BUILD_ROOT"

%if !%{with disable_shared}
%post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig

%postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig

%files -n libsolv@LIBSOLV_SOVERSION@
%defattr(-,root,root)
%doc LICENSE*
%{_libdir}/libsolv.so.*
%{_libdir}/libsolvext.so.*
%endif

%files tools
%defattr(-,root,root)
%exclude %{_bindir}/helix2solv
%exclude %{_bindir}/solv
%{_bindir}/*

%files devel
%defattr(-,root,root)
%{_libdir}/libsolv.so
%{_libdir}/libsolvext.so
%{_includedir}/solv
%{_bindir}/helix2solv
%{_datadir}/cmake/Modules/*

%files demo
%defattr(-,root,root)
%{_bindir}/solv

%if %{with perl_binding}
%files -n perl-solv
%defattr(-,root,root)
%{perl_vendorarch}/*
%endif

%if %{with ruby_binding}
%files -n ruby-solv
%defattr(-,root,root)
%{ruby_vendorarch}/*
%endif

%if %{with python_binding}
%files -n python-solv
%defattr(-,root,root)
%{python_sitearch}/*
%endif

%changelog