+%bcond_with Intra2net
+%bcond_with xmllib
+
+# Detect Intra2net build environment
+%if %{with Intra2net}
+ %define with_xmllib 1
+%endif
+
Summary: library with functions common in Intra2net programs
Name: libi2ncommon
Version: ##VERSION##
The config module provides a global configuration system with decentralized
declaration of the config variables.
+%if %{with xmllib}
%package xml
Summary: library with a xml module
Group: Intranator
%description xml
The xml module provides common xml functions.
+%endif
%package utils
Summary: library with open source utility modules
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
-cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" ../
+
+CMAKE_OPTS=""
+%if %{with xmllib}
+ CMAKE_OPTS="$CMAKE_OPTS -DBUILD_XMLLIB=ON"
+%endif
+
+cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
make %{?_smp_mflags} VERBOSE=1
%doc COPYING.GPL
%{prefix}/lib/libi2ncommon_config.so*
+%if %{with xmllib}
%files xml
%defattr(-,root,root)
%doc COPYING.GPL
%{prefix}/lib/libi2ncommon_xml.so*
+%endif
%files utils
%defattr(-,root,root)