- some fixes to get the stack built in other distributions
[platform/upstream/libsolv.git] / package / libsatsolver.spec.in
index 593126e..4131afd 100644 (file)
+
 Name:           libsatsolver
 Version:        @VERSION@
 Release:        1
-License:        BSD
+License:        BSD 3-Clause
 Url:            http://svn.opensuse.org/svn/zypp/trunk/sat-solver
 Source:         satsolver-%{version}.tar.bz2
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Group:          System/Libraries
-BuildRequires:  libexpat-devel db43-devel
-BuildRequires:  ruby-devel swig
-Requires:       expat db43
-Summary:        A new approach to package dependency solving
+Group:          Development/Libraries/C and C++
+
+%if 0%{?mandriva_version}
+# force this version on mandriva
+BuildRequires: libneon0.26-devel
+%endif
 
+%if 0%{?suse_version}
+BuildRequires: libexpat-devel
+%else
+BuildRequires: expat-devel
+%endif
+BuildRequires:  cmake rpm-devel gcc-c++ ruby-devel swig
+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>
 
 %package devel
 Summary:        A new approach to package dependency solving
-Group:          Development/Libraries
+Group:          Development/Libraries/C and C++
+Requires:       satsolver-tools = %version
 
 %description devel
--
+A new approach to package dependency solving
+
+Authors:
+--------
+    Michael Schroeder <mls@suse.de>
+    Klaus Kaempf <kkaempf@suse.de>
 
 %package ruby
 Summary:        Ruby bindings for sat solver
 Group:          Development/Languages/Ruby
 
 %description ruby
--
+.
+
+%package -n satsolver-tools
+Summary:        A new approach to package dependency solving
+Group:          Development/Libraries/C and C++
+Obsoletes:      libsatsolver <= 0.0.15
+Provides:       libsatsolver = 0.0.15
+
+%description -n satsolver-tools
+. 
 
 %prep
 %setup -n satsolver-%{version}
 
 %build
-mkdir build
-cd build
 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
       -DLIB=%{_lib} \
       -DCMAKE_VERBOSE_MAKEFILE=TRUE \
       -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
       -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
       -DCMAKE_BUILD_TYPE=Release \
-      -DCMAKE_SKIP_RPATH=1 \
-      ..
+      -DCMAKE_SKIP_RPATH=1 
 make %{?jobs:-j %jobs}
 
 %install
-cd build
-make install DESTDIR=$RPM_BUILD_ROOT
-#rm -f %{buildroot}%{_libdir}/libsatsolver.la
+make DESTDIR=$RPM_BUILD_ROOT install
+# we want to leave the .a file untouched
+export NO_BRP_STRIP_DEBUG=true
 
-#%post -p /sbin/ldconfig
-#%postun -p /sbin/ldconfig
+# remove the perl bindings for now
+rm -rf $RPM_BUILD_ROOT/usr/lib/perl5
 
 %clean
 rm -rf "$RPM_BUILD_ROOT"
 
-#%files
-#%defattr(-,root,root)
+%files -n satsolver-tools
+%defattr(-,root,root)
+%doc LICENSE*
+/usr/bin/*
 
 %files devel
 %defattr(-,root,root)
-%{_libdir}/libsatsolver.a
+%_libdir/libsatsolver.a
+%_libdir/libappsatsolver.a
 %doc doc/README*
 %doc doc/THEORY
 %doc doc/PLANNING
-%dir %{_includedir}/satsolver
-%{_includedir}/satsolver/*
+%dir /usr/include/satsolver
+/usr/include/satsolver/*
 
 %files ruby
 %defattr(-,root,root,-)
+
+%if 0%{?suse_version}
 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/satsolverx.so
 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/satsolver.rb
+%else
+%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}
+%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
+%{ruby_sitearch}/satsolverx.so
+%{ruby_sitelib}/satsolver.rb
+%endif
+
 
 %changelog