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