avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcrea...@apache.org
Subject svn commit: r1183643 - in /avro/trunk: CHANGES.txt lang/c/CMakeLists.txt lang/c/CPackConfig.txt lang/c/docs/CMakeLists.txt
Date Sat, 15 Oct 2011 14:08:46 GMT
Author: dcreager
Date: Sat Oct 15 14:08:45 2011
New Revision: 1183643

URL: http://svn.apache.org/viewvc?rev=1183643&view=rev
Log:
AVRO-474. C: Add source package target to CMake build files

The CMake build scripts can now produce a source tarball, via CPack.
After running cmake in your build directory, "make package_source" will
produce the source tarball.  The only caveat is that CPack doesn't try
to be smart about what to include in the tarball; basically anything in
the top-level source directory is included.  I've added some ignore
patterns to keep out some of the obvious riff-raff like backup files,
and the CMake build directory.  But to produce a truly pristine source
tarball, you should make sure to keep the source directory itself
pristine.

Added:
    avro/trunk/lang/c/CPackConfig.txt
Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/c/CMakeLists.txt
    avro/trunk/lang/c/docs/CMakeLists.txt

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1183643&r1=1183642&r2=1183643&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Sat Oct 15 14:08:45 2011
@@ -35,6 +35,9 @@ Avro 1.6.0 (unreleased)
 
     AVRO-922. C: Comparison function for new value interface. (dcreager)
 
+    AVRO-474. C: Added source package target to CMake build scripts.
+    (dcreager)
+
     AVRO-890: Java: Add Maven archetype for creating Avro service
     projects.  (Stephen Gargan via cutting)
 

Modified: avro/trunk/lang/c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/CMakeLists.txt?rev=1183643&r1=1183642&r2=1183643&view=diff
==============================================================================
--- avro/trunk/lang/c/CMakeLists.txt (original)
+++ avro/trunk/lang/c/CMakeLists.txt Sat Oct 15 14:08:45 2011
@@ -41,6 +41,35 @@ if(LIBAVRO_VERSION_RESULT)
     message(FATAL_ERROR "Cannot determine libavro version number")
 endif(LIBAVRO_VERSION_RESULT)
 
+#-----------------------------------------------------------------------
+# Extract major.minor.patch from version number
+
+string(REGEX REPLACE "([0-9]+)\\..*"
+    "\\1"
+    AVRO_MAJOR_VERSION
+    ${AVRO_VERSION}
+)
+string(REGEX REPLACE ".*\\.([0-9]+)\\..*"
+    "\\1"
+    AVRO_MINOR_VERSION
+    ${AVRO_VERSION}
+)
+string(REGEX REPLACE ".*\\..*\\.([0-9]+).*"
+    "\\1"
+    AVRO_PATCH_VERSION
+    ${AVRO_VERSION}
+)
+string(REGEX REPLACE ".*\\..*\\.[0-9]+(.*)"
+    "\\1"
+    AVRO_VERSION_EXTENSION
+    ${AVRO_VERSION}
+)
+
+#-----------------------------------------------------------------------
+# Source package support
+
+include(CPackConfig.txt)
+
 
 if(APPLE)
     if (NOT CMAKE_OSX_ARCHITECTURES)

Added: avro/trunk/lang/c/CPackConfig.txt
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/CPackConfig.txt?rev=1183643&view=auto
==============================================================================
--- avro/trunk/lang/c/CPackConfig.txt (added)
+++ avro/trunk/lang/c/CPackConfig.txt Sat Oct 15 14:08:45 2011
@@ -0,0 +1,39 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+set(CPACK_PACKAGE_NAME "avro-c")
+set(CPACK_PACKAGE_DESCRIPTION "C bindings for Avro data serialization framework")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C bindings for Avro data serialization framework")
+set(CPACK_PACKAGE_VENDOR "Apache Software Foundation")
+set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+set(CPACK_PACKAGE_VERSION_MAJOR "${AVRO_MAJOR_VERSION}")
+set(CPACK_PACKAGE_VERSION_MINOR "${AVRO_MINOR_VERSION}")
+set(CPACK_PACKAGE_VERSION_PATCH "${AVRO_PATCH_VERSION}${AVRO_VERSION_EXTENSION}")
+set(CPACK_PACKAGE_VERSION "${AVRO_VERSION}")
+set(CPACK_PACKAGE_CONTACT "avro-dev@apache.org")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+set(CPACK_STRIP_FILES true)
+
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "/usr")
+set(CPACK_GENERATOR "TGZ")
+set(CPACK_SOURCE_GENERATOR "TGZ")
+
+set(CPACK_SOURCE_IGNORE_FILES "^${CMAKE_BINARY_DIR};/\\\\.gitignore;/\\\\.svn;\\\\.swp$;\\\\.#;/#;.*~")
+
+include(CPack)

Modified: avro/trunk/lang/c/docs/CMakeLists.txt
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/docs/CMakeLists.txt?rev=1183643&r1=1183642&r2=1183643&view=diff
==============================================================================
--- avro/trunk/lang/c/docs/CMakeLists.txt (original)
+++ avro/trunk/lang/c/docs/CMakeLists.txt Sat Oct 15 14:08:45 2011
@@ -30,7 +30,7 @@ if (ASCIIDOC_EXECUTABLE AND SOURCE_HIGHL
     foreach(_file ${AVRO_DOC_SRC})
         get_filename_component(_file_we ${_file} NAME_WE)
         set(_file_path "${CMAKE_CURRENT_SOURCE_DIR}/${_file}")
-        set(_html_out "${_file_we}.html")
+        set(_html_out "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}.html")
         add_custom_command(
             OUTPUT "${_html_out}"
             COMMAND ${ASCIIDOC_EXECUTABLE}
@@ -40,10 +40,12 @@ if (ASCIIDOC_EXECUTABLE AND SOURCE_HIGHL
                 --unsafe -n -o "${_html_out}" "${_file_path}"
             DEPENDS "${_file_path}"
             COMMENT "asciidoc ${_file}"
-            )
+        )
+        install(FILES "${_html_out}" DESTINATION share/doc/avro-c)
         add_custom_target("${_file_we}_html" ALL echo -n
             DEPENDS "${_file}" "${_html_out}"
         )
+        add_custom_target(docs DEPENDS "${_html_out}")
     endforeach(_file)
 else(ASCIIDOC_EXECUTABLE AND SOURCE_HIGHLIGHT_EXECUTABLE)
     message(WARNING "asciidoc not found. HTML documentation will *NOT* be built.")



Mime
View raw message