- we currently need libdb-4_5-devel for building
[platform/upstream/libsolv.git] / package / libsatsolver.spec.in
1 Name:           libsatsolver
2 Version:        @VERSION@
3 Release:        1
4 License:        BSD 3-Clause
5 Url:            git://git.opensuse.org/projects/zypp/sat-solver.git
6 Source:         satsolver-%{version}.tar.bz2
7 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
8 Group:          Development/Libraries/C and C++
9 Prefix:         /usr
10
11 BuildRequires:  doxygen
12 %if 0%{?mandriva_version}
13 # force this version on mandriva
14 BuildRequires:  libneon0.26-devel
15 %endif
16 %if 0%{?fedora_version}
17 BuildRequires:  perl-devel db4-devel ruby ruby-rdoc
18 %endif
19 %if 0%{?suse_version}
20 %if 0%{?suse_version} < 1030
21 BuildRequires:  expat
22 %else
23 BuildRequires:  libexpat-devel
24 %endif
25 %if 0%{?suse_version} < 1100
26 BuildRequires:  graphviz
27 %endif
28 %if 0%{?suse_version} > 1020
29 BuildRequires:  fdupes
30 %endif
31 %if 0%{?suse_version} > 1110
32 BuildRequires:  libdb-4_5-devel
33 %endif
34 %else
35 BuildRequires:  expat-devel
36 %endif
37 BuildRequires:  cmake rpm-devel gcc-c++ ruby-devel swig perl python-devel
38 BuildRequires:  zlib-devel
39 # the testsuite uses the check framework
40 BuildRequires:  check-devel
41 Summary:        A new approach to package dependency solving
42
43 #define some macros missing on fedora
44 %if 0%{?fedora_version}
45 %{!?py_sitedir: %define py_sitedir %(%__python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
46 %{!?py_requires: %define py_requires Requires: python}
47 %{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
48 %endif
49
50 %description
51 A new approach to package dependency solving
52
53 Authors:
54 --------
55     Michael Schroeder <mls@suse.de>
56     Klaus Kaempf <kkaempf@suse.de>
57     Stephan Kulow <coolo@suse.de>
58     Michael Matz <matz@suse.de>
59     Duncan Mac-Vicar P. <dmacvicar@suse.de>
60
61 %package devel
62 Summary:        A new approach to package dependency solving
63 Group:          Development/Libraries/C and C++
64 Requires:       satsolver-tools = %version
65 Requires:       rpm-devel
66
67 #%package devel-doc
68 #Summary:        satsolver developer documentation
69 #Group:          Documentation/HTML
70
71 %description devel
72 Development files for satsolver, a new approach to package dependency solving
73
74 #%description devel-doc
75 #Developer documentation for satsolver, a new approach to package dependency solving
76
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 %package -n satsolver-tools
87 Summary:        A new approach to package dependency solving
88 Group:          Development/Libraries/C and C++
89 Obsoletes:      libsatsolver <= 0.0.15
90 Provides:       libsatsolver = %{version}-%{release}
91 Requires:       gzip bzip2 coreutils
92
93 %description -n satsolver-tools
94 A new approach to package dependency solving.
95
96 %package demo
97 Summary:        Applications demoing the satsolver library
98 Group:          System/Management
99 Requires:       curl
100 %if 0%{?fedora_version}
101 Requires:       gnupg2
102 %endif
103 %if 0%{?suse_version}
104 Requires:       gpg2
105 %endif
106
107 %description demo
108 Applications demoing the satsolver library.
109
110 %package -n ruby-satsolver
111 Summary:        Ruby bindings for sat solver
112 Group:          Development/Languages/Ruby
113
114 %description -n ruby-satsolver
115 Ruby bindings for sat solver.
116
117 %package -n python-satsolver
118 %py_requires
119 Summary:        Python bindings for sat solver
120 Group:          Development/Languages/Python
121
122 %description -n python-satsolver
123 Python bindings for sat solver.
124
125 %package -n perl-satsolver
126 Requires:       perl = %{perl_version}
127 Summary:        Perl bindings for sat solver
128 Group:          Development/Languages/Perl
129
130 %description -n perl-satsolver
131 Perl bindings for sat solver.
132
133
134 %prep
135 %setup -n satsolver-%{version}
136
137 %build
138 export CFLAGS="$RPM_OPT_FLAGS"
139 export CXXFLAGS="$CFLAGS"
140
141 CMAKE_FLAGS=
142 %if 0%{?fedora_version}
143 CMAKE_FLAGS="-DFEDORA=1"
144 %endif
145
146 cmake   $CMAKE_FLAGS \
147         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
148         -DPYTHON_SITEDIR=%{py_sitedir} \
149         -DLIB=%{_lib} \
150         -DCMAKE_VERBOSE_MAKEFILE=TRUE \
151         -DCMAKE_BUILD_TYPE=Release \
152         -DCMAKE_SKIP_RPATH=1 
153 make %{?jobs:-j %jobs}
154 make doc_forced
155
156 %if 0%{?run_testsuite}
157   ln -s . build
158   ctest .
159 %endif
160
161 %install
162 make DESTDIR=$RPM_BUILD_ROOT install
163 # we want to leave the .a file untouched
164 export NO_BRP_STRIP_DEBUG=true
165 #pushd doc/autodoc
166 #make install
167 #popd
168 %if 0%{?suse_version} > 1020
169 # create symlinks for documentation
170 #%fdupes -s %{buildroot}%{_docdir}/ruby-satsolver
171 %fdupes -s bindings/ruby/html
172 %endif
173
174 %clean
175 rm -rf "$RPM_BUILD_ROOT"
176
177 %files -n satsolver-tools
178 %defattr(-,root,root)
179 %doc LICENSE*
180 %exclude /usr/bin/deptestomatic
181 %exclude /usr/bin/helix2solv
182 %exclude /usr/bin/solv
183 /usr/bin/*
184
185 %files devel
186 %defattr(-,root,root)
187 %_libdir/libsatsolver.a
188 %_libdir/libsatsolverext.a
189 %_libdir/libappsatsolver.a
190 %dir /usr/include/satsolver
191 /usr/include/satsolver/*
192 /usr/bin/deptestomatic
193 /usr/bin/helix2solv
194
195 %files demo
196 %defattr(-,root,root)
197 /usr/bin/solv
198
199 #%files devel-doc
200 #%defattr(-,root,root)
201 #%dir %_docdir/satsolver
202 #%_docdir/satsolver/*
203
204 %files -n ruby-satsolver
205 %defattr(-,root,root,-)
206 %if 0%{?suse_version}
207 %if 0%{?suse_version} < 1100
208 %dir %{_libdir}/ruby/site_ruby/%{rb_ver}/%{rb_arch}
209 %{_libdir}/ruby/site_ruby/%{rb_ver}/%{rb_arch}/satsolver.so
210 %else
211 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/satsolver.so
212 %endif
213 %endif
214 %if 0%{?mandriva_version}
215 %{ruby_sitearchdir}/satsolver.so
216 %endif
217 %if 0%{?fedora_version}
218 %{ruby_sitearch}/satsolver.so
219 %endif
220 %doc bindings/ruby/html
221
222 %files -n python-satsolver
223 %defattr(-,root,root,-)
224 #%doc swig/python/examples/*.py
225 %{py_sitedir}/_satsolver.so
226 %{py_sitedir}/satsolver.py*
227
228 %files -n perl-satsolver
229 %defattr(-,root,root,-)
230 %{perl_vendorarch}/satsolver.so
231 %{perl_vendorlib}/satsolver.pm
232
233 %changelog