- include FindZypp.cmake in libzypp-devel so
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 26 Feb 2007 13:57:08 +0000 (13:57 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 26 Feb 2007 13:57:08 +0000 (13:57 +0000)
  apps using zypp dont need to include it.
- allow FindZypp to recognize ZYPP_PREFIX in
  order to allow in-home-dir development
- Commit po gettext build system
- fix sqlite sources (removed methods)

CMakeLists.txt
cmake/modules/FindZypp.cmake [new file with mode: 0644]
libzypp.spec.cmake
po/CMakeLists.txt [new file with mode: 0644]
zypp2/source/sqlite-source/SqliteSources.cc

index 469ebb6..6941554 100644 (file)
@@ -145,15 +145,16 @@ MESSAGE(STATUS "version: ${VERSION}")
 ####################################################################
 # RPM SPEC                                                         #
 ####################################################################
-
 MESSAGE(STATUS "Writing spec file...")
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.spec.cmake ${CMAKE_BINARY_DIR}/package/libzypp.spec @ONLY)
 
 MESSAGE(STATUS "Writing pkg-config file...")
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.pc.cmake ${CMAKE_BINARY_DIR}/libzypp.pc @ONLY)
-
 INSTALL( FILES ${CMAKE_BINARY_DIR}/libzypp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
 
+MESSAGE(STATUS "FindZypp.cmake will be installed in ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules")
+INSTALL( FILES ${CMAKE_SOURCE_DIR}/cmake/modules/FindZypp.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )
+
 MACRO(add_subdir_sources subdir real_sources)
   MESSAGE( STATUS "Adding ${subdir} to sources..." )
   SET(sources)
diff --git a/cmake/modules/FindZypp.cmake b/cmake/modules/FindZypp.cmake
new file mode 100644 (file)
index 0000000..3e1cb4d
--- /dev/null
@@ -0,0 +1,36 @@
+
+IF (ZYPP_PREFIX)
+  MESSAGE(STATUS "ZYpp library prefix set to ${ZYPP_PREFIX}")
+ELSE (ZYPP_PREFIX)
+  MESSAGE(STATUS "ZYpp path not set. Looking for it.")
+ENDIF (ZYPP_PREFIX)
+
+if(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY)
+       # Already in cache, be silent
+       set(ZYPP_FIND_QUIETLY TRUE)     
+endif(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY)
+
+set(ZYPP_LIBRARY)
+set(ZYPP_INCLUDE_DIR)
+
+FIND_PATH(ZYPP_INCLUDE_DIR zypp/ZYpp.h
+       /usr/include
+       /usr/local/include
+       ${ZYPP_PREFIX}/include
+)
+
+FIND_LIBRARY(ZYPP_LIBRARY NAMES zypp
+       PATHS
+       /usr/lib
+       /usr/local/lib
+       ${ZYPP_PREFIX}/lib
+)
+
+if(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY)
+   MESSAGE( STATUS "ZYpp found: includes in ${ZYPP_INCLUDE_DIR}, library in ${ZYPP_LIBRARY}")
+   set(ZYPP_FOUND TRUE)
+else(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY)
+   MESSAGE( FATAL "ZYpp not found")
+endif(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY)
+
+MARK_AS_ADVANCED(ZYPP_INCLUDE_DIR ZYPP_LIBRARY)
\ No newline at end of file
index 1ad7b01..a0ba3d3 100644 (file)
@@ -50,6 +50,7 @@ Authors:
 Requires:       libzypp
 Requires:       libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
 Requires:       bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
+Requires:       cmake
 Summary:        Package, Patch, Pattern, and Product Management - developers files
 Group:          System/Packages
 Provides:       yast2-packagemanager-devel
@@ -120,6 +121,7 @@ make -C po %{?jobs:-j %jobs} install DESTDIR=$RPM_BUILD_ROOT
 %{_docdir}/%{name}
 %dir %{prefix}/include/zypp
 %{prefix}/include/zypp/*
+%{prefix}/share/cmake/Modules/FindLibzypp.cmake
 %{_libdir}/pkgconfig/libzypp.pc
 
 %changelog -n libzypp
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644 (file)
index 0000000..086042e
--- /dev/null
@@ -0,0 +1,3 @@
+
+FILE( GLOB LIBZYPP_PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po )
+GETTEXT_CREATE_TRANSLATIONS( "${CMAKE_SOURCE_DIR}/po/zypp.pot" ${LIBZYPP_PO_FILES} )
index bd7c2aa..683f349 100644 (file)
@@ -73,8 +73,6 @@ SqliteSources::createDummy( const Url & url, const string & catalog )
     SqliteSourceImpl *impl = new SqliteSourceImpl( SqliteSourceImplPolicy() );
     impl->factoryCtor( mediaid, Pathname(), catalog, "", false, false );
     impl->setId( catalog );
-    impl->setZmdName( catalog );
-    impl->setZmdDescription ( catalog );
     impl->setPriority( 0 );
     impl->setSubscribed( true );
 
@@ -170,9 +168,6 @@ SqliteSources::sources( bool refresh )
       SqliteSourceImpl *impl = new SqliteSourceImpl ();
       impl->factoryCtor( mediaid, Pathname(), alias, "", false, false );
       impl->setId( id );
-      //impl->setZmdDescription ( desc );
-      //impl->setPriority( priority );
-      //impl->setSubscribed( subscribed != 0 );
 
       impl->attachDatabase( _db );
       impl->attachIdMap( &_idmap );