Release libi2ncommon 2.7
[libi2ncommon] / libi2ncommon.spec
index f90008f..599e51b 100644 (file)
@@ -8,21 +8,27 @@
     %define with_imap_utf7_support 1
 %endif
 
+%if %{with xmllib}
+    %define with_xmllib 1
+%endif
+%if %{with imap_utf7_support}
+    %define with_imap_utf7_support 1
+%endif
+
 Summary:   library with functions common in Intra2net programs
 Name:      libi2ncommon
-Version:   ##VERSION##
+Version:   2.7
 Release:   1
 License:   GPLv2 + linking exception
-Group:     Intranator
+Group:     Development/Libraries
 Vendor:    Intra2net AG
-Source:    %{name}-%{version}.tar.gz
-Buildroot: /tmp/%{name}-%{version}-root
-Prefix:    /usr/intranator
-Requires:  libi2ncommon-utils = %{version}
-BuildPrereq: libtool
+Source:    %{name}-%{version}.tar.bz2
 BuildRequires: boost-devel >= 1.32.0
-Obsoletes: libgettext
+BuildRequires: libtool
 
+%if "%{with_imap_utf7_support}" == "1"
+BuildRequires: libiconv
+%endif
 
 %description 
 library with functions common in Intra2net programs
@@ -48,11 +54,12 @@ library with a config module.
 The config module provides a global configuration system with decentralized
 declaration of the config variables.
 
-%if %{with xmllib}
+%if "%{with xmllib}" == "1"
 %package xml
 Summary:    library with a xml module
 Group:      Intranator
 Requires:   libi2ncommon = %{version}
+BuildRequires: libxml++-devel
 
 %description xml
 The xml module provides common xml functions.
@@ -70,8 +77,6 @@ Library with open source utility modules.
 %setup -q
 
 %build
-export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig
-
 mkdir build
 cd build
 
@@ -79,14 +84,14 @@ export CFLAGS="$RPM_OPT_FLAGS"
 export CXXFLAGS="$RPM_OPT_FLAGS"
 
 CMAKE_OPTS=""
-%if %{with xmllib}
+%if "%{with_xmllib}" == "1"
     CMAKE_OPTS="$CMAKE_OPTS -DBUILD_XMLLIB=ON"
 %endif
-%if %{with imap_utf7_support}
+%if "%{with_imap_utf7_support}" == "1"
     CMAKE_OPTS="$CMAKE_OPTS -DIMAP_UTF7_SUPPORT=ON"
 %endif
 
-cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
+cmake -DCMAKE_INSTALL_PREFIX="%{_prefix}" $CMAKE_OPTS ../
 
 make %{?_smp_mflags} VERBOSE=1
 
@@ -102,34 +107,36 @@ make DESTDIR=$RPM_BUILD_ROOT install
 %clean
 rm -fr $RPM_BUILD_ROOT
 
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
 
 %files
 %defattr(-,root,root)
-%doc COPYING.GPL
-%{prefix}/lib/libi2ncommon.so*
+%doc COPYING.GPL Linking-Exception.txt
+%{_libdir}/libi2ncommon.so*
 
 %files devel
 %defattr(-,root,root)
 # No static library for now
 #%{prefix}/lib/*.*a*
-%{prefix}/lib/pkgconfig/*.pc
-%{prefix}/include/
+%{_libdir}/libi2ncommon.so
+%{_libdir}/pkgconfig/*.pc
+%{_includedir}/libi2ncommon/*
 
 %files config
 %defattr(-,root,root)
-%doc COPYING.GPL
-%{prefix}/lib/libi2ncommon_config.so*
+%doc COPYING.GPL Linking-Exception.txt
+%{_libdir}/libi2ncommon_config.so*
 
-%if %{with xmllib}
+%if "%{with xmllib}" == "1"
 %files xml
 %defattr(-,root,root)
-%doc COPYING.GPL
-%{prefix}/lib/libi2ncommon_xml.so*
+%doc COPYING.GPL Linking-Exception.txt
+%{_libdir}/libi2ncommon_xml.so*
 %endif
 
 %files utils
 %defattr(-,root,root)
-%doc COPYING.GPL
-%{prefix}/lib/libi2ncommon_utils.so*
+%doc COPYING.GPL Linking-Exception.txt
+%{_libdir}/libi2ncommon_utils.so*