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