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