diff --git a/.gitmodules b/.gitmodules index 6badff0..f987e25 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,45 +1,15 @@ [submodule "argparse"] - path = argparse + path = third-party/argparse url = https://github.com/cofyc/argparse [submodule "cJSON"] - path = cJSON + path = third-party/cJSON url = https://github.com/DaveGamble/cJSON -[submodule "lmdb"] - path = lmdb - url = https://github.com/LMDB/lmdb -[submodule "utf8.h"] - path = utf8.h - url = https://github.com/sheredom/utf8.h -[submodule "lib/bzip2-1.0.6"] - path = lib/bzip2-1.0.6 - url = https://github.com/enthought/bzip2-1.0.6 -[submodule "lib/libmagic"] - path = lib/libmagic - url = https://github.com/threatstack/libmagic -[submodule "lib/harfbuzz"] - path = lib/harfbuzz - url = https://github.com/harfbuzz/harfbuzz -[submodule "lib/openjpeg"] - path = lib/openjpeg - url = https://github.com/uclouvain/openjpeg -[submodule "lib/ffmpeg"] - path = lib/ffmpeg - url = https://git.ffmpeg.org/ffmpeg.git [submodule "lib/onion"] - path = lib/onion + path = third-party/onion url = https://github.com/davidmoreno/onion -[submodule "lib/mupdf"] - path = lib/mupdf - url = git://git.ghostscript.com/mupdf.git -[submodule "lib/tesseract"] - path = lib/tesseract - url = https://github.com/tesseract-ocr/tesseract -[submodule "lib/leptonica"] - path = lib/leptonica - url = https://github.com/danbloomberg/leptonica -[submodule "lib/libtiff"] - path = lib/libtiff - url = https://gitlab.com/libtiff/libtiff -[submodule "lib/libpng"] - path = lib/libpng - url = https://github.com/glennrp/libpng +[submodule "third-party/libscan"] + path = third-party/libscan + url = https://github.com/simon987/libscan +[submodule "third-party/utf8.h"] + path = third-party/utf8.h + url = https://github.com/sheredom/utf8.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f49a9b..e9d46cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,81 +6,44 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules") option(SIST_DEBUG "Build a debug executable" on) +add_subdirectory(third-party/libscan) +add_subdirectory(third-party/argparse) + add_executable( sist2 src/main.c src/sist.h src/io/walk.h src/io/walk.c - src/parsing/media.h src/parsing/media.c - src/parsing/pdf.h src/parsing/pdf.c src/io/store.h src/io/store.c src/tpool.h src/tpool.c src/parsing/parse.h src/parsing/parse.c src/io/serialize.h src/io/serialize.c src/parsing/mime.h src/parsing/mime.c src/parsing/mime_generated.c - src/parsing/text.h src/parsing/text.c src/index/web.c src/index/web.h src/web/serve.c src/web/serve.h src/web/auth_basic.h src/web/auth_basic.c src/index/elastic.c src/index/elastic.h src/util.c src/util.h - src/ctx.h src/types.h src/parsing/font.c src/parsing/font.h - src/parsing/arc.c src/parsing/arc.h - src/parsing/doc.c src/parsing/doc.h + src/ctx.h src/types.h src/log.c src/log.h - src/parsing/cbr.h src/parsing/cbr.c # argparse - argparse/argparse.h argparse/argparse.c + third-party/argparse/argparse.h third-party/argparse/argparse.c - # cJSON - cJSON/cJSON.h cJSON/cJSON.c - - # LMDB - lmdb/libraries/liblmdb/lmdb.h lmdb/libraries/liblmdb/mdb.c - lmdb/libraries/liblmdb/midl.h lmdb/libraries/liblmdb/midl.c src/cli.c src/cli.h - - # utf8.h - utf8.h/utf8.h ) -find_package(PkgConfig REQUIRED) -set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig/") +find_package(lmdb CONFIG REQUIRED) +find_package(cJSON CONFIG REQUIRED) +find_package(unofficial-glib CONFIG REQUIRED) -find_package(Freetype REQUIRED) - -pkg_check_modules(GLIB REQUIRED glib-2.0) -pkg_check_modules(GOBJECT REQUIRED gobject-2.0) -pkg_check_modules(UUID REQUIRED uuid) - -add_definitions(${UUID_CFLAGS_OTHER}) -add_definitions(${GLIB_CFLAGS_OTHER}) -add_definitions(${GOBJECT_CFLAGS_OTHER}) -add_definitions(${FREETYPE_CFLAGS_OTHER}) - -list(REMOVE_ITEM GLIB_LIBRARIES pcre) -list(REMOVE_ITEM GOBJECT_LIBRARIES pcre) -list(REMOVE_ITEM UUID_LIBRARIES pcre) target_include_directories( sist2 PUBLIC - ${GOBJECT_INCLUDE_DIRS} - ${GLIB_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR}/lib/ffmpeg/ - ${FREETYPE_INCLUDE_DIRS} - ${UUID_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR}/ - ${PROJECT_SOURCE_DIR}/lmdb/libraries/liblmdb/ - ${PROJECT_SOURCE_DIR}/lib/onion/src/ - ${PROJECT_SOURCE_DIR}/lib/mupdf/include/ - ${PROJECT_SOURCE_DIR}/include/ - /usr/include/libxml2/ - ${PROJECT_SOURCE_DIR}/lib/tesseract/include/ -) -target_link_directories( - sist2 PUBLIC - ${UUID_LIBRARY_DIRS} + ${CMAKE_SOURCE_DIR}/third-party/onion/src/ + ${CMAKE_SOURCE_DIR}/third-party/utf8.h/ + ${CMAKE_SOURCE_DIR}/third-party/libscan/ + ${CMAKE_SOURCE_DIR}/ ) target_compile_options( @@ -119,53 +82,26 @@ else () ) endif () -TARGET_LINK_LIBRARIES( +add_dependencies( + sist2 + scan + argparse +) + +target_link_libraries( sist2 - ${GLIB_LIBRARIES} - ${GOBJECT_LIBRARIES} - ${UUID_LIBRARIES} - - # ffmpeg - ${PROJECT_SOURCE_DIR}/lib/libavcodec.a - ${PROJECT_SOURCE_DIR}/lib/libavformat.a - ${PROJECT_SOURCE_DIR}/lib/libavutil.a - ${PROJECT_SOURCE_DIR}/lib/libswscale.a - ${PROJECT_SOURCE_DIR}/lib/libswresample.a - - # mupdf - ${PROJECT_SOURCE_DIR}/lib/libmupdf.a - ${PROJECT_SOURCE_DIR}/lib/libmupdf-third.a + lmdb + cjson + argparse + unofficial::glib::glib # onion ${PROJECT_SOURCE_DIR}/lib/libonion_static.a pthread - m - bz2 -# ${PROJECT_SOURCE_DIR}/lib/libmagic.a - magic - ${PROJECT_SOURCE_DIR}/lib/libharfbuzz.a - ${PROJECT_SOURCE_DIR}/lib/libopenjp2.a - freetype - archive - - xml2 - - ${PROJECT_SOURCE_DIR}/lib/libtesseract.a - ${PROJECT_SOURCE_DIR}/lib/liblept.a - ${PROJECT_SOURCE_DIR}/lib/libtiff.a - ${PROJECT_SOURCE_DIR}/lib/libpng16.a - stdc++ - - # curl - ${PROJECT_SOURCE_DIR}/lib/libcurl.a - ${PROJECT_SOURCE_DIR}/lib/libcrypto.a - ${PROJECT_SOURCE_DIR}/lib/libssl.a - dl - - pcre + scan ) add_custom_target( diff --git a/CMakeModules/FindFFmpeg.cmake b/CMakeModules/FindFFmpeg.cmake deleted file mode 100644 index 2a5c0de..0000000 --- a/CMakeModules/FindFFmpeg.cmake +++ /dev/null @@ -1,80 +0,0 @@ -# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil) -# Once done this will define -# -# FFMPEG_FOUND - system has ffmpeg or libav -# FFMPEG_INCLUDE_DIR - the ffmpeg include directory -# FFMPEG_LIBRARIES - Link these to use ffmpeg -# FFMPEG_LIBAVCODEC -# FFMPEG_LIBAVFORMAT -# FFMPEG_LIBAVUTIL -# -# Copyright (c) 2008 Andreas Schneider -# Modified for other libraries by Lasse Kärkkäinen -# Modified for Hedgewars by Stepik777 -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# - -if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) -# in cache already -set(FFMPEG_FOUND TRUE) -else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) -# use pkg-config to get the directories and then use these values -# in the FIND_PATH() and FIND_LIBRARY() calls -find_package(PkgConfig) -if (PKG_CONFIG_FOUND) -pkg_check_modules(_FFMPEG_AVCODEC libavcodec) -pkg_check_modules(_FFMPEG_AVFORMAT libavformat) -pkg_check_modules(_FFMPEG_AVUTIL libavutil) -endif (PKG_CONFIG_FOUND) - -find_path(FFMPEG_AVCODEC_INCLUDE_DIR -NAMES libavcodec/avcodec.h -PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include -PATH_SUFFIXES ffmpeg libav -) - -find_library(FFMPEG_LIBAVCODEC -NAMES avcodec -PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib -) - -find_library(FFMPEG_LIBAVFORMAT -NAMES avformat -PATHS ${_FFMPEG_AVFORMAT_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib -) - -find_library(FFMPEG_LIBAVUTIL -NAMES avutil -PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib -) - -if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT) -set(FFMPEG_FOUND TRUE) -endif() - -if (FFMPEG_FOUND) -set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR}) - -set(FFMPEG_LIBRARIES -${FFMPEG_LIBAVCODEC} -${FFMPEG_LIBAVFORMAT} -${FFMPEG_LIBAVUTIL} -) - -endif (FFMPEG_FOUND) - -if (FFMPEG_FOUND) -if (NOT FFMPEG_FIND_QUIETLY) -message(STATUS "Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}") -endif (NOT FFMPEG_FIND_QUIETLY) -else (FFMPEG_FOUND) -if (FFMPEG_FIND_REQUIRED) -message(FATAL_ERROR "Could not find libavcodec or libavformat or libavutil") -endif (FFMPEG_FIND_REQUIRED) -endif (FFMPEG_FOUND) - -endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) - - diff --git a/CMakeModules/FindLibMagic.cmake b/CMakeModules/FindLibMagic.cmake deleted file mode 100644 index c25a24c..0000000 --- a/CMakeModules/FindLibMagic.cmake +++ /dev/null @@ -1,100 +0,0 @@ - -#------------------------------------------------------------------------------- -# Copyright (c) 2013-2013, Lars Baehren -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#------------------------------------------------------------------------------- - -# - Check for the presence of LIBMAGIC -# -# The following variables are set when LIBMAGIC is found: -# LIBMAGIC_FOUND = Set to true, if all components of LIBMAGIC have been -# found. -# LIBMAGIC_INCLUDES = Include path for the header files of LIBMAGIC -# LIBMAGIC_LIBRARIES = Link these to use LIBMAGIC -# LIBMAGIC_LFLAGS = Linker flags (optional) - -if (NOT LIBMAGIC_FOUND) - - if (NOT LIBMAGIC_ROOT_DIR) - set (LIBMAGIC_ROOT_DIR ${CMAKE_INSTALL_PREFIX}) - endif (NOT LIBMAGIC_ROOT_DIR) - - ##____________________________________________________________________________ - ## Check for the header files - - find_path (LIBMAGIC_FILE_H - NAMES file/file.h - HINTS ${LIBMAGIC_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} - PATH_SUFFIXES include - ) - if (LIBMAGIC_FILE_H) - list (APPEND LIBMAGIC_INCLUDES ${LIBMAGIC_FILE_H}) - endif (LIBMAGIC_FILE_H) - - find_path (LIBMAGIC_MAGIC_H - NAMES magic.h - HINTS ${LIBMAGIC_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} - PATH_SUFFIXES include include/linux - ) - if (LIBMAGIC_MAGIC_H) - list (APPEND LIBMAGIC_INCLUDES ${LIBMAGIC_MAGIC_H}) - endif (LIBMAGIC_MAGIC_H) - - list (REMOVE_DUPLICATES LIBMAGIC_INCLUDES) - - ##____________________________________________________________________________ - ## Check for the library - - find_library (LIBMAGIC_LIBRARIES magic - HINTS ${LIBMAGIC_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} - PATH_SUFFIXES lib - ) - - ##____________________________________________________________________________ - ## Actions taken when all components have been found - - #find_package_handle_standard_args (LIBMAGIC DEFAULT_MSG LIBMAGIC_LIBRARIES LIBMAGIC_INCLUDES) - - if (LIBMAGIC_FOUND) - if (NOT LIBMAGIC_FIND_QUIETLY) - message (STATUS "Found components for LIBMAGIC") - message (STATUS "LIBMAGIC_ROOT_DIR = ${LIBMAGIC_ROOT_DIR}") - message (STATUS "LIBMAGIC_INCLUDES = ${LIBMAGIC_INCLUDES}") - message (STATUS "LIBMAGIC_LIBRARIES = ${LIBMAGIC_LIBRARIES}") - endif (NOT LIBMAGIC_FIND_QUIETLY) - else (LIBMAGIC_FOUND) - if (LIBMAGIC_FIND_REQUIRED) - message (FATAL_ERROR "Could not find LIBMAGIC!") - endif (LIBMAGIC_FIND_REQUIRED) - endif (LIBMAGIC_FOUND) - - ##____________________________________________________________________________ - ## Mark advanced variables - - mark_as_advanced ( - LIBMAGIC_ROOT_DIR - LIBMAGIC_INCLUDES - LIBMAGIC_LIBRARIES - ) - -endif (NOT LIBMAGIC_FOUND) diff --git a/CMakeModules/FindOpenSSL.cmake b/CMakeModules/FindOpenSSL.cmake deleted file mode 100644 index a62105c..0000000 --- a/CMakeModules/FindOpenSSL.cmake +++ /dev/null @@ -1,478 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) - if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND - (("${ssl_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") OR - ("${crypto_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))) - set(_OpenSSL_has_dependencies TRUE) - find_package(Threads) - else() - set(_OpenSSL_has_dependencies FALSE) - endif() -endmacro() - -function(_OpenSSL_add_dependencies libraries_var library) - if(CMAKE_THREAD_LIBS_INIT) - list(APPEND ${libraries_var} ${CMAKE_THREAD_LIBS_INIT}) - endif() - list(APPEND ${libraries_var} ${CMAKE_DL_LIBS}) - set(${libraries_var} ${${libraries_var}} PARENT_SCOPE) -endfunction() - -function(_OpenSSL_target_add_dependencies target) - if(_OpenSSL_has_dependencies) - set_property( TARGET ${target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads ) - set_property( TARGET ${target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS} ) - endif() -endfunction() - -if (UNIX) - find_package(PkgConfig QUIET) - pkg_check_modules(_OPENSSL QUIET openssl) -endif () - -# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES -if(OPENSSL_USE_STATIC_LIBS) - set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - if(WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) - endif() -endif() - -if (WIN32) - # http://www.slproweb.com/products/Win32OpenSSL.html - set(_OPENSSL_ROOT_HINTS - ${OPENSSL_ROOT_DIR} - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]" - ENV OPENSSL_ROOT_DIR - ) - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) - set(_OPENSSL_ROOT_PATHS - "${_programfiles}/OpenSSL" - "${_programfiles}/OpenSSL-Win32" - "${_programfiles}/OpenSSL-Win64" - "C:/OpenSSL/" - "C:/OpenSSL-Win32/" - "C:/OpenSSL-Win64/" - ) - unset(_programfiles) -else () - set(_OPENSSL_ROOT_HINTS - ${OPENSSL_ROOT_DIR} - ENV OPENSSL_ROOT_DIR - ) -endif () - -set(_OPENSSL_ROOT_HINTS_AND_PATHS - HINTS ${_OPENSSL_ROOT_HINTS} - PATHS ${_OPENSSL_ROOT_PATHS} - ) - -find_path(OPENSSL_INCLUDE_DIR - NAMES - openssl/ssl.h - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - HINTS - ${_OPENSSL_INCLUDEDIR} - PATH_SUFFIXES - include -) - -if(WIN32 AND NOT CYGWIN) - if(MSVC) - # /MD and /MDd are the standard values - if someone wants to use - # others, the libnames have to change here too - # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b - # enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL) - # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix: - # * MD for dynamic-release - # * MDd for dynamic-debug - # * MT for static-release - # * MTd for static-debug - - # Implementation details: - # We are using the libraries located in the VC subdir instead of the parent directory even though : - # libeay32MD.lib is identical to ../libeay32.lib, and - # ssleay32MD.lib is identical to ../ssleay32.lib - # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static - - if (OPENSSL_MSVC_STATIC_RT) - set(_OPENSSL_MSVC_RT_MODE "MT") - else () - set(_OPENSSL_MSVC_RT_MODE "MD") - endif () - - # Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib - if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" ) - set(_OPENSSL_MSVC_ARCH_SUFFIX "64") - else() - set(_OPENSSL_MSVC_ARCH_SUFFIX "32") - endif() - - if(OPENSSL_USE_STATIC_LIBS) - set(_OPENSSL_PATH_SUFFIXES - "lib/VC/static" - "VC/static" - "lib" - ) - else() - set(_OPENSSL_PATH_SUFFIXES - "lib/VC" - "VC" - "lib" - ) - endif () - - find_library(LIB_EAY_DEBUG - NAMES - libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d - libcrypto${_OPENSSL_MSVC_RT_MODE}d - libcryptod - libeay32${_OPENSSL_MSVC_RT_MODE}d - libeay32d - cryptod - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - PATH_SUFFIXES - ${_OPENSSL_PATH_SUFFIXES} - ) - - find_library(LIB_EAY_RELEASE - NAMES - libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE} - libcrypto${_OPENSSL_MSVC_RT_MODE} - libcrypto - libeay32${_OPENSSL_MSVC_RT_MODE} - libeay32 - crypto - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - PATH_SUFFIXES - ${_OPENSSL_PATH_SUFFIXES} - ) - - find_library(SSL_EAY_DEBUG - NAMES - libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d - libssl${_OPENSSL_MSVC_RT_MODE}d - libssld - ssleay32${_OPENSSL_MSVC_RT_MODE}d - ssleay32d - ssld - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - PATH_SUFFIXES - ${_OPENSSL_PATH_SUFFIXES} - ) - - find_library(SSL_EAY_RELEASE - NAMES - libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE} - libssl${_OPENSSL_MSVC_RT_MODE} - libssl - ssleay32${_OPENSSL_MSVC_RT_MODE} - ssleay32 - ssl - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - PATH_SUFFIXES - ${_OPENSSL_PATH_SUFFIXES} - ) - - set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}") - set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}") - set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}") - set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}") - - include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) - select_library_configurations(LIB_EAY) - select_library_configurations(SSL_EAY) - - mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE - SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE) - set(OPENSSL_SSL_LIBRARY ${SSL_EAY_LIBRARY} ) - set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_LIBRARY} ) - elseif(MINGW) - # same player, for MinGW - set(LIB_EAY_NAMES crypto libeay32) - set(SSL_EAY_NAMES ssl ssleay32) - find_library(LIB_EAY - NAMES - ${LIB_EAY_NAMES} - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - PATH_SUFFIXES - "lib/MinGW" - "lib" - ) - - find_library(SSL_EAY - NAMES - ${SSL_EAY_NAMES} - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - PATH_SUFFIXES - "lib/MinGW" - "lib" - ) - - mark_as_advanced(SSL_EAY LIB_EAY) - set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) - set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) - unset(LIB_EAY_NAMES) - unset(SSL_EAY_NAMES) - else() - # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues: - find_library(LIB_EAY - NAMES - libcrypto - libeay32 - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - HINTS - ${_OPENSSL_LIBDIR} - PATH_SUFFIXES - lib - ) - - find_library(SSL_EAY - NAMES - libssl - ssleay32 - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - HINTS - ${_OPENSSL_LIBDIR} - PATH_SUFFIXES - lib - ) - - mark_as_advanced(SSL_EAY LIB_EAY) - set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) - set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) - endif() -else() - - find_library(OPENSSL_SSL_LIBRARY - NAMES - ssl - ssleay32 - ssleay32MD - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - HINTS - ${_OPENSSL_LIBDIR} - PATH_SUFFIXES - lib - ) - - find_library(OPENSSL_CRYPTO_LIBRARY - NAMES - crypto - NAMES_PER_DIR - ${_OPENSSL_ROOT_HINTS_AND_PATHS} - HINTS - ${_OPENSSL_LIBDIR} - PATH_SUFFIXES - lib - ) - - mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY) - -endif() - -# compat defines -set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY}) -set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) -_OpenSSL_test_and_find_dependencies("${OPENSSL_SSL_LIBRARY}" "${OPENSSL_CRYPTO_LIBRARY}") -if(_OpenSSL_has_dependencies) - _OpenSSL_add_dependencies( OPENSSL_SSL_LIBRARIES "${OPENSSL_SSL_LIBRARY}" ) - _OpenSSL_add_dependencies( OPENSSL_CRYPTO_LIBRARIES "${OPENSSL_CRYPTO_LIBRARY}" ) -endif() - -function(from_hex HEX DEC) - string(TOUPPER "${HEX}" HEX) - set(_res 0) - string(LENGTH "${HEX}" _strlen) - - while (_strlen GREATER 0) - math(EXPR _res "${_res} * 16") - string(SUBSTRING "${HEX}" 0 1 NIBBLE) - string(SUBSTRING "${HEX}" 1 -1 HEX) - if (NIBBLE STREQUAL "A") - math(EXPR _res "${_res} + 10") - elseif (NIBBLE STREQUAL "B") - math(EXPR _res "${_res} + 11") - elseif (NIBBLE STREQUAL "C") - math(EXPR _res "${_res} + 12") - elseif (NIBBLE STREQUAL "D") - math(EXPR _res "${_res} + 13") - elseif (NIBBLE STREQUAL "E") - math(EXPR _res "${_res} + 14") - elseif (NIBBLE STREQUAL "F") - math(EXPR _res "${_res} + 15") - else() - math(EXPR _res "${_res} + ${NIBBLE}") - endif() - - string(LENGTH "${HEX}" _strlen) - endwhile() - - set(${DEC} ${_res} PARENT_SCOPE) -endfunction() - -if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") - file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str - REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") - - if(openssl_version_str) - # The version number is encoded as 0xMNNFFPPS: major minor fix patch status - # The status gives if this is a developer or prerelease and is ignored here. - # Major, minor, and fix directly translate into the version numbers shown in - # the string. The patch field translates to the single character suffix that - # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so - # on. - - string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$" - "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}") - list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR) - list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR) - from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR) - list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX) - from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX) - list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH) - - if (NOT OPENSSL_VERSION_PATCH STREQUAL "00") - from_hex("${OPENSSL_VERSION_PATCH}" _tmp) - # 96 is the ASCII code of 'a' minus 1 - math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96") - unset(_tmp) - # Once anyone knows how OpenSSL would call the patch versions beyond 'z' - # this should be updated to handle that, too. This has not happened yet - # so it is simply ignored here for now. - string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING) - endif () - - set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}") - endif () -endif () - -set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES} ) -list(REMOVE_DUPLICATES OPENSSL_LIBRARIES) - -foreach(_comp IN LISTS OpenSSL_FIND_COMPONENTS) - if(_comp STREQUAL "Crypto") - if(EXISTS "${OPENSSL_INCLUDE_DIR}" AND - (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR - EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR - EXISTS "${LIB_EAY_LIBRARY_RELEASE}") - ) - set(OpenSSL_${_comp}_FOUND TRUE) - else() - set(OpenSSL_${_comp}_FOUND FALSE) - endif() - elseif(_comp STREQUAL "SSL") - if(EXISTS "${OPENSSL_INCLUDE_DIR}" AND - (EXISTS "${OPENSSL_SSL_LIBRARY}" OR - EXISTS "${SSL_EAY_LIBRARY_DEBUG}" OR - EXISTS "${SSL_EAY_LIBRARY_RELEASE}") - ) - set(OpenSSL_${_comp}_FOUND TRUE) - else() - set(OpenSSL_${_comp}_FOUND FALSE) - endif() - else() - message(WARNING "${_comp} is not a valid OpenSSL component") - set(OpenSSL_${_comp}_FOUND FALSE) - endif() -endforeach() -unset(_comp) - -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(OpenSSL - REQUIRED_VARS - OPENSSL_CRYPTO_LIBRARY - OPENSSL_INCLUDE_DIR - VERSION_VAR - OPENSSL_VERSION - HANDLE_COMPONENTS - FAIL_MESSAGE - "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" -) - -mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) - -if(OPENSSL_FOUND) - if(NOT TARGET OpenSSL::Crypto AND - (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR - EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR - EXISTS "${LIB_EAY_LIBRARY_RELEASE}") - ) - add_library(OpenSSL::Crypto UNKNOWN IMPORTED) - set_target_properties(OpenSSL::Crypto PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") - if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}") - set_target_properties(OpenSSL::Crypto PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}") - endif() - if(EXISTS "${LIB_EAY_LIBRARY_RELEASE}") - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(OpenSSL::Crypto PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" - IMPORTED_LOCATION_RELEASE "${LIB_EAY_LIBRARY_RELEASE}") - endif() - if(EXISTS "${LIB_EAY_LIBRARY_DEBUG}") - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(OpenSSL::Crypto PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${LIB_EAY_LIBRARY_DEBUG}") - endif() - _OpenSSL_target_add_dependencies(OpenSSL::Crypto) - endif() - - if(NOT TARGET OpenSSL::SSL AND - (EXISTS "${OPENSSL_SSL_LIBRARY}" OR - EXISTS "${SSL_EAY_LIBRARY_DEBUG}" OR - EXISTS "${SSL_EAY_LIBRARY_RELEASE}") - ) - add_library(OpenSSL::SSL UNKNOWN IMPORTED) - set_target_properties(OpenSSL::SSL PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") - if(EXISTS "${OPENSSL_SSL_LIBRARY}") - set_target_properties(OpenSSL::SSL PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}") - endif() - if(EXISTS "${SSL_EAY_LIBRARY_RELEASE}") - set_property(TARGET OpenSSL::SSL APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(OpenSSL::SSL PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" - IMPORTED_LOCATION_RELEASE "${SSL_EAY_LIBRARY_RELEASE}") - endif() - if(EXISTS "${SSL_EAY_LIBRARY_DEBUG}") - set_property(TARGET OpenSSL::SSL APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(OpenSSL::SSL PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${SSL_EAY_LIBRARY_DEBUG}") - endif() - if(TARGET OpenSSL::Crypto) - set_target_properties(OpenSSL::SSL PROPERTIES - INTERFACE_LINK_LIBRARIES OpenSSL::Crypto) - endif() - _OpenSSL_target_add_dependencies(OpenSSL::SSL) - endif() -endif() - -# Restore the original find library ordering -if(OPENSSL_USE_STATIC_LIBS) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) -endif() diff --git a/CMakeModules/FindPackageHandleStandardArgs.cmake b/CMakeModules/FindPackageHandleStandardArgs.cmake deleted file mode 100644 index 391d834..0000000 --- a/CMakeModules/FindPackageHandleStandardArgs.cmake +++ /dev/null @@ -1,268 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake) - -# internal helper macro -macro(_FPHSA_FAILURE_MESSAGE _msg) - set (__msg "${_msg}") - if (FPHSA_REASON_FAILURE_MESSAGE) - string(APPEND __msg "\n Reason given by package: ${FPHSA_REASON_FAILURE_MESSAGE}\n") - endif() - if (${_NAME}_FIND_REQUIRED) - message(FATAL_ERROR "${__msg}") - else () - if (NOT ${_NAME}_FIND_QUIETLY) - message(STATUS "${__msg}") - endif () - endif () -endmacro() - - -# internal helper macro to generate the failure message when used in CONFIG_MODE: -macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) - # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: - if(${_NAME}_CONFIG) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing:${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") - else() - # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. - # List them all in the error message: - if(${_NAME}_CONSIDERED_CONFIGS) - set(configsText "") - list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) - math(EXPR configsCount "${configsCount} - 1") - foreach(currentConfigIndex RANGE ${configsCount}) - list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) - list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) - string(APPEND configsText "\n ${filename} (version ${version})") - endforeach() - if (${_NAME}_NOT_FOUND_MESSAGE) - if (FPHSA_REASON_FAILURE_MESSAGE) - string(PREPEND FPHSA_REASON_FAILURE_MESSAGE "${${_NAME}_NOT_FOUND_MESSAGE}\n ") - else() - set(FPHSA_REASON_FAILURE_MESSAGE "${${_NAME}_NOT_FOUND_MESSAGE}") - endif() - else() - string(APPEND configsText "\n") - endif() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:${configsText}") - - else() - # Simple case: No Config-file was found at all: - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") - endif() - endif() -endmacro() - - -function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) - -# Set up the arguments for `cmake_parse_arguments`. - set(options CONFIG_MODE HANDLE_COMPONENTS) - set(oneValueArgs FAIL_MESSAGE REASON_FAILURE_MESSAGE VERSION_VAR FOUND_VAR) - set(multiValueArgs REQUIRED_VARS) - -# Check whether we are in 'simple' or 'extended' mode: - set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) - list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) - - if(${INDEX} EQUAL -1) - set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) - set(FPHSA_REQUIRED_VARS ${ARGN}) - set(FPHSA_VERSION_VAR) - else() - cmake_parse_arguments(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) - - if(FPHSA_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") - endif() - - if(NOT FPHSA_FAIL_MESSAGE) - set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") - endif() - - # In config-mode, we rely on the variable _CONFIG, which is set by find_package() - # when it successfully found the config-file, including version checking: - if(FPHSA_CONFIG_MODE) - list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) - list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) - set(FPHSA_VERSION_VAR ${_NAME}_VERSION) - endif() - - if(NOT FPHSA_REQUIRED_VARS) - message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") - endif() - endif() - -# now that we collected all arguments, process them - - if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG") - set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") - endif() - - list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) - - string(TOUPPER ${_NAME} _NAME_UPPER) - string(TOLOWER ${_NAME} _NAME_LOWER) - - if(FPHSA_FOUND_VAR) - if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$") - set(_FOUND_VAR ${FPHSA_FOUND_VAR}) - else() - message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.") - endif() - else() - set(_FOUND_VAR ${_NAME_UPPER}_FOUND) - endif() - - # collect all variables which were not found, so they can be printed, so the - # user knows better what went wrong (#6375) - set(MISSING_VARS "") - set(DETAILS "") - # check if all passed variables are valid - set(FPHSA_FOUND_${_NAME} TRUE) - foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) - if(NOT ${_CURRENT_VAR}) - set(FPHSA_FOUND_${_NAME} FALSE) - string(APPEND MISSING_VARS " ${_CURRENT_VAR}") - else() - string(APPEND DETAILS "[${${_CURRENT_VAR}}]") - endif() - endforeach() - if(FPHSA_FOUND_${_NAME}) - set(${_NAME}_FOUND TRUE) - set(${_NAME_UPPER}_FOUND TRUE) - else() - set(${_NAME}_FOUND FALSE) - set(${_NAME_UPPER}_FOUND FALSE) - endif() - - # component handling - unset(FOUND_COMPONENTS_MSG) - unset(MISSING_COMPONENTS_MSG) - - if(FPHSA_HANDLE_COMPONENTS) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(${_NAME}_${comp}_FOUND) - - if(NOT DEFINED FOUND_COMPONENTS_MSG) - set(FOUND_COMPONENTS_MSG "found components:") - endif() - string(APPEND FOUND_COMPONENTS_MSG " ${comp}") - - else() - - if(NOT DEFINED MISSING_COMPONENTS_MSG) - set(MISSING_COMPONENTS_MSG "missing components:") - endif() - string(APPEND MISSING_COMPONENTS_MSG " ${comp}") - - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - string(APPEND MISSING_VARS " ${comp}") - endif() - - endif() - endforeach() - set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") - string(APPEND DETAILS "[c${COMPONENT_MSG}]") - endif() - - # version handling: - set(VERSION_MSG "") - set(VERSION_OK TRUE) - - # check with DEFINED here as the requested or found version may be "0" - if (DEFINED ${_NAME}_FIND_VERSION) - if(DEFINED ${FPHSA_VERSION_VAR}) - set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}}) - - if(${_NAME}_FIND_VERSION_EXACT) # exact version required - # count the dots in the version string - string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${_FOUND_VERSION}") - # add one dot because there is one dot more than there are components - string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS) - if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT) - # Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT - # is at most 4 here. Therefore a simple lookup table is used. - if (${_NAME}_FIND_VERSION_COUNT EQUAL 1) - set(_VERSION_REGEX "[^.]*") - elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2) - set(_VERSION_REGEX "[^.]*\\.[^.]*") - elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3) - set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*") - else () - set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*") - endif () - string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${_FOUND_VERSION}") - unset(_VERSION_REGEX) - if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD) - set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")") - endif () - unset(_VERSION_HEAD) - else () - if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _FOUND_VERSION) - set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")") - endif () - endif () - unset(_VERSION_DOTS) - - else() # minimum version specified: - if (${_NAME}_FIND_VERSION VERSION_GREATER _FOUND_VERSION) - set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable version \"${_FOUND_VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")") - endif () - endif() - - else() - - # if the package was not found, but a version was given, add that to the output: - if(${_NAME}_FIND_VERSION_EXACT) - set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") - else() - set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") - endif() - - endif() - else () - # Check with DEFINED as the found version may be 0. - if(DEFINED ${FPHSA_VERSION_VAR}) - set(VERSION_MSG "(found version \"${${FPHSA_VERSION_VAR}}\")") - endif() - endif () - - if(VERSION_OK) - string(APPEND DETAILS "[v${${FPHSA_VERSION_VAR}}(${${_NAME}_FIND_VERSION})]") - else() - set(${_NAME}_FOUND FALSE) - endif() - - - # print the result: - if (${_NAME}_FOUND) - FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") - else () - - if(FPHSA_CONFIG_MODE) - _FPHSA_HANDLE_FAILURE_CONFIG_MODE() - else() - if(NOT VERSION_OK) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") - else() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing:${MISSING_VARS}) ${VERSION_MSG}") - endif() - endif() - - endif () - - set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) - set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) -endfunction() diff --git a/CMakeModules/FindPackageMessage.cmake b/CMakeModules/FindPackageMessage.cmake deleted file mode 100644 index 0628b98..0000000 --- a/CMakeModules/FindPackageMessage.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#[=======================================================================[.rst: -FindPackageMessage ------------------- - -.. code-block:: cmake - - find_package_message( "message for user" "find result details") - -This function is intended to be used in FindXXX.cmake modules files. -It will print a message once for each unique find result. This is -useful for telling the user where a package was found. The first -argument specifies the name (XXX) of the package. The second argument -specifies the message to display. The third argument lists details -about the find result so that if they change the message will be -displayed again. The macro also obeys the QUIET argument to the -find_package command. - -Example: - -.. code-block:: cmake - - if(X11_FOUND) - find_package_message(X11 "Found X11: ${X11_X11_LIB}" - "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") - else() - ... - endif() -#]=======================================================================] - -function(find_package_message pkg msg details) - # Avoid printing a message repeatedly for the same find result. - if(NOT ${pkg}_FIND_QUIETLY) - string(REPLACE "\n" "" details "${details}") - set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg}) - if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") - # The message has not yet been printed. - message(STATUS "${msg}") - - # Save the find details in the cache to avoid printing the same - # message again. - set("${DETAILS_VAR}" "${details}" - CACHE INTERNAL "Details about finding ${pkg}") - endif() - endif() -endfunction() diff --git a/README.md b/README.md index 42dcc5e..c693980 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ sist2 (Simple incremental search tool) *Warning: sist2 is in early development* -![sist2.png](sist2.png) +![sist2.png](DOCS/sist2.png) ## Features @@ -49,7 +49,7 @@ sist2 (Simple incremental search tool) 1. *(or)* Download a [development snapshot](https://files.simon987.net/artifacts/Sist2/Build/) *(Not recommended!)* 1. *(or)* `docker pull simon987/sist2:latest` -1. See [Usage guide](USAGE.md) +1. See [Usage guide](DOCS/USAGE.md) \* *Windows users*: **sist2** runs under [WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) @@ -57,7 +57,7 @@ sist2 (Simple incremental search tool) ## Example usage -See [Usage guide](USAGE.md) for more details +See [Usage guide](DOCS/USAGE.md) for more details 1. Scan a directory: `sist2 scan ~/Documents -o ./docs_idx` 1. Push index to Elasticsearch: `sist2 index ./docs_idx` @@ -117,13 +117,8 @@ binaries. 1. Install compile-time dependencies - *(Debian)* - ```bash - apt install git cmake pkg-config libglib2.0-dev \ - libssl-dev uuid-dev python3 libmagic-dev libfreetype6-dev \ - libcurl4-openssl-dev libbz2-dev yasm libharfbuzz-dev ragel \ - libarchive-dev libtiff5 libpng16-16 libpango1.0-dev \ - libxml2-dev libopenjp2-7-dev libleptonica-dev + ```bash + vcpkg install lmdb ``` 2. Build diff --git a/USAGE.md b/USAGE.md deleted file mode 100644 index b245fb4..0000000 --- a/USAGE.md +++ /dev/null @@ -1,275 +0,0 @@ -# Usage - -*More examples (specifically with docker/compose) are in progress* - -* [scan](#scan) - * [options](#scan-options) - * [examples](#scan-examples) - * [index format](#index-format) -* [index](#index) - * [options](#index-options) - * [examples](#index-examples) -* [web](#web) - * [options](#web-options) - * [examples](#web-examples) - * [rewrite_url](#rewrite_url) - * [link to specific indices](#link-to-specific-indices) - -``` -Usage: sist2 scan [OPTION]... PATH - or: sist2 index [OPTION]... INDEX - or: sist2 web [OPTION]... INDEX... -Lightning-fast file system indexer and search tool. - - -h, --help show this help message and exit - -v, --version Show version and exit - --verbose Turn on logging - --very-verbose Turn on debug messages - -Scan options - -t, --threads= Number of threads. DEFAULT=1 - -q, --quality= Thumbnail quality, on a scale of 1.0 to 31.0, 1.0 being the best. DEFAULT=5 - --size= Thumbnail size, in pixels. Use negative value to disable. DEFAULT=500 - --content-size= Number of bytes to be extracted from text documents. Use negative value to disable. DEFAULT=32768 - --incremental= Reuse an existing index and only scan modified files. - -o, --output= Output directory. DEFAULT=index.sist2/ - --rewrite-url= Serve files from this url instead of from disk. - --name= Index display name. DEFAULT: (name of the directory) - --depth= Scan up to DEPTH subdirectories deep. Use 0 to only scan files in PATH. DEFAULT: -1 - --archive= Archive file mode (skip|list|shallow|recurse). skip: Don't parse, list: only get file names as text, shallow: Don't parse archives inside archives. DEFAULT: recurse - --ocr= Tesseract language (use tesseract --list-langs to see which are installed on your machine) - -e, --exclude= Files that match this regex will not be scanned - --fast Only index file names & mime type - -Index options - --es-url= Elasticsearch url with port. DEFAULT=http://localhost:9200 - -p, --print Just print JSON documents to stdout. - --script-file= Path to user script. - --batch-size= Index batch size. DEFAULT: 100 - -f, --force-reset Reset Elasticsearch mappings and settings. (You must use this option the first time you use the index command) - -Web options - --es-url= Elasticsearch url. DEFAULT=http://localhost:9200 - --bind= Listen on this address. DEFAULT=localhost - --port= Listen on this port. DEFAULT=4090 - --auth= Basic auth in user:password format -Made by simon987 . Released under GPL-3.0 - -``` - -## Scan - -### Scan options - -* `-t, --threads` - Number of threads for file parsing. **Do not set a number higher than `$(nproc)`!**. -* `-q, --quality` - Thumbnail quality, on a scale of 1.0 to 31.0, 1.0 being the best. *Does not affect PDF thumbnails quality* -* `--size` - Thumbnail size in pixels. -* `--content-size` - Number of bytes of text to be extracted from the content of files (plain text and PDFs). - Repeated whitespace and special characters do not count toward this limit. -* `--incremental` - Specify an existing index. Information about files in this index that were not modified (based on *mtime* attribute) - will be copied to the new index and will not be parsed again. -* `-o, --output` Output directory. -* `--rewrite-url` Set the `rewrite_url` option for the web module (See [rewrite_url](#rewrite_url)) -* `--name` Set the `name` option for the web module -* `--depth` Maximum scan dept. Set to 0 only scan files directly in the root directory, set to -1 for infinite depth -* `--archive` Archive file mode. - * skip: Don't parse - * list: Only get file names as text - * shallow: Don't parse archives inside archives. - * recurse: Scan archives recursively (default) -* `--ocr` See [OCR](README.md#OCR) -* `-e, --exclude` Regex pattern to exclude files. A file is excluded if the pattern matches any - part of the full absolute path. - - Examples: - * `-e ".*\.ttf"`: Ignore ttf files - * `-e ".*\.(ttf|rar)"`: Ignore ttf and rar files - * `-e "^/mnt/backups/"`: Ignore all files in the `/mnt/backups/` directory - * `-e "^/mnt/Data[12]/"`: Ignore all files in the `/mnt/Data1/` and `/mnt/Data2/` directory - * `-e "(^/usr/)|(^/var/)|(^/media/DRIVE-A/tmp/)|(^/media/DRIVE-B/Trash/)"` Exclude the - `/usr`, `/var`, `/media/DRIVE-A/tmp`, `/media/DRIVE-B/Trash` directories -* `--fast` Only index file names and mime type - -### Scan examples - -Simple scan -```bash -sist2 scan ~/Documents - -sist2 scan \ - --threads 4 --content-size 16000000 --quality 1.0 --archive shallow \ - --name "My Documents" --rewrite-url "http://nas.domain.local/My Documents/" \ - ~/Documents -o ./documents.idx/ -``` - -Incremental scan -``` -sist2 scan --incremental ./orig_idx/ -o ./updated_idx/ ~/Documents -``` - -### Index format - -A typical `binary` type index structure looks like this: -``` -documents.idx/ -├── descriptor.json -├── _index_139965416830720 -├── _index_139965425223424 -├── _index_139965433616128 -├── _index_139965442008832 -└── thumbs - ├── data.mdb - └── lock.mdb -``` - -The `_index_*` files contain the raw binary index data and are not meant to be -read by other applications. The format is generally compatible across different -sist2 versions. - -The `thumbs/` folder is a [LMDB](https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database) -database containing the thumbnails. - -The `descriptor.json` file contains general information about the index. The -following fields are safe to modify manually: `root`, `name`, [rewrite_url](#rewrite_url) and `timestamp`. - - -*Advanced usage* - -Instead of using the `scan` module, you can also import an index generated -by a third party application. The 'external' index must have the following format: - -``` -my_index/ -├── descriptor.json -├── _index_0 -└── thumbs - ├── data.mdb - └── lock.mdb -``` - -*descriptor.json*: -```json -{ - "uuid": "", - "version": "_external_v1", - "root": "(optional)", - "name": "", - "rewrite_url": "(optional)", - "type": "json", - "timestamp": 1578971024 -} -``` - -*_index_0*: NDJSON format (One json object per line) - -```json -{ - "_id": "unique uuid for the file", - "index": "index uuid4 (same one as descriptor.json!)", - "mime": "application/x-cbz", - "size": 14341204, - "mtime": 1578882996, - "extension": "cbz", - "name": "my_book", - "path": "path/to/books", - "content": "text contents of the book", - "title": "Title of the book", - "tag": ["genre.fiction", "author.someguy", "etc..."], - "_keyword": [ - {"k": "ISBN", "v": "ABCD34789231"} - ], - "_text": [ - {"k": "other", "v": "This will be indexed as text"} - ] -} -``` - -You can find the full list of supported fields [here](src/io/serialize.c#L90) - -The `_keyword.*` items will be indexed and searchable as **keyword** fields (only full matches allowed). -The `_text.*` items will be indexed and searchable as **text** fields (fuzzy searching allowed) - - -*thumbs/*: - -LMDB key-value store. Keys are **binary** 128-bit UUID4s (`_id` field) -and values are raw image bytes. - -Importing an external `binary` type index is technically possible but -it is currently unsupported and has no guaranties of back/forward compatibility. - - -## Index -### Index options - * `--es-url` - Elasticsearch url and port. If you are using docker, make sure that both containers are on the - same network. - * `-p, --print` - Print index in JSON format to stdout. - * `--script-file` - Path to user script. See [Scripting](scripting/README.md). - * `--batch-size=` - Index batch size. Indexing is generally faster with larger batches, but payloads that - are too large will fail and additional overhead for retrying with smaller sizes may slow - down the process. - * `-f, --force-reset` - Reset Elasticsearch mappings and settings. - **(You must use this option the first time you use the index command)**. - -### Index examples - -**Push to elasticsearch** -```bash -sist2 index --force-reset --batch-size 1000 --es-url http://localhost:9200 ./my_index/ -sist2 index ./my_index/ -``` - -**Save index in JSON format** -```bash -sist2 index --print ./my_index/ > my_index.ndjson -``` - -**Inspect contents of an index** -```bash -sist2 index --print ./my_index/ | jq | less -``` - -## Web - -### Web options - * `--es-url=` Elasticsearch url. - * `--bind=` Listen on this address. - * `--port=` Listen on this port. - * `--auth=` Basic auth in user:password format - -### Web examples - -**Single index** -```bash -sist2 web --auth admin:hunter2 --bind 0.0.0.0 --port 8888 my_index -``` - -**Multiple indices** -```bash -# Indices will be displayed in this order in the web interface -sist2 web index1 index2 index3 index4 -``` - -### rewrite_url - -When the `rewrite_url` field is not empty, the web module ignores the `root` -field and will return a HTTP redirect to `/` -instead of serving the file from disk. -Both the `root` and `rewrite_url` fields are safe to manually modify from the -`descriptor.json` file. - -### Link to specific indices - -To link to specific indices, you can add a list of comma-separated index name to -the URL: `?i=,`. By default, indices with `"(nsfw)"` in their name are -not displayed. diff --git a/argparse b/argparse deleted file mode 160000 index 4ed6099..0000000 --- a/argparse +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ed6099cb33245b06343518b9f3c45ac56e8283c diff --git a/cJSON b/cJSON deleted file mode 160000 index 3ece4c8..0000000 --- a/cJSON +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3ece4c893c123aa3d77f90d580cf6b0a4b3a2ad5 diff --git a/lib/bzip2-1.0.6 b/lib/bzip2-1.0.6 deleted file mode 160000 index 288acf9..0000000 --- a/lib/bzip2-1.0.6 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 288acf97a15d558f96c24c89f578b724d6e06b0c diff --git a/lib/ffmpeg b/lib/ffmpeg deleted file mode 160000 index 7239254..0000000 --- a/lib/ffmpeg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7239254b1da28c1a0d8dff8916edefc98b88775e diff --git a/lib/harfbuzz b/lib/harfbuzz deleted file mode 160000 index b07714d..0000000 --- a/lib/harfbuzz +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b07714d6b53bb20a2796f5efa607dc32aac587f1 diff --git a/lib/leptonica b/lib/leptonica deleted file mode 160000 index a9d04f7..0000000 --- a/lib/leptonica +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a9d04f7b0f72711677241e1c6805612ef56f157b diff --git a/lib/libmagic b/lib/libmagic deleted file mode 160000 index 1249b5c..0000000 --- a/lib/libmagic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1249b5cd02c3b6fb9b917d16c76bc76c862932b6 diff --git a/lib/libpng b/lib/libpng deleted file mode 160000 index 301f7a1..0000000 --- a/lib/libpng +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 301f7a14295a3bdfaf406dbb5004d0784dc137ea diff --git a/lib/libtiff b/lib/libtiff deleted file mode 160000 index ed881da..0000000 --- a/lib/libtiff +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ed881da0db424dd77a195a90511130aca1122dc3 diff --git a/lib/mupdf b/lib/mupdf deleted file mode 160000 index abada6f..0000000 --- a/lib/mupdf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit abada6f26c8d3e5190bea932cb05e3474558e18d diff --git a/lib/onion b/lib/onion deleted file mode 160000 index 2b3b230..0000000 --- a/lib/onion +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2b3b230b79ecae119b7eb847f2f9545a46bef13c diff --git a/lib/openjpeg b/lib/openjpeg deleted file mode 160000 index 563ecfb..0000000 --- a/lib/openjpeg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 563ecfb55ca77c0fc5ea19e4885e00f55ec82ca9 diff --git a/lib/tesseract b/lib/tesseract deleted file mode 160000 index d576c7c..0000000 --- a/lib/tesseract +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d576c7cbd57393ed26d1e02cf60530e690b4f5c2 diff --git a/lmdb b/lmdb deleted file mode 160000 index 5c012bb..0000000 --- a/lmdb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5c012bbe033f9bbb273078b07dded59f080d348d diff --git a/mime.csv b/mime.csv deleted file mode 100644 index 04d4266..0000000 --- a/mime.csv +++ /dev/null @@ -1,429 +0,0 @@ -application/arj, arj -application/base64, mme -application/binhex, hqx -application/book, boo|book -application/CDFV2-corrupt, -application/CDFV2, sdv -application/clariscad, ccad -application/commonground, dp -application/csv, -application/dicom, dcm -application/drafting, drw -application/epub+zip, epub -application/freeloader, frl -application/futuresplash, spl -application/groupwise, vew -application/gzip, gz -application/hta, hta -application/i-deas, unv -application/iges, iges|igs -application/inf, inf -application/java-archive, jar -application/java, class -application/javascript, -application/json, json -application/marc, mrc -application/mbedlet, mbd -application/mime, aps -application/mspowerpoint, ppz -application/msword, doc|dot|w6w|wiz|word -application/netmc, mcp -application/octet-stream, bin|dump|gpg -application/oda, oda -application/ogg, ogv -application/pdf, pdf -application/pgp-keys, -application/pgp-signature, pgp -application/pkcs7-signature, p7s -application/pkix-cert, cer|crt -application/postscript, ai|ps -application/pro_eng, part|prt -application/ringing-tones, rng -application/smil, smi|smil -application/solids, sol -application/sounder, sdr -application/step, step|stp -application/streamingmedia, ssm -application/vda, vda -application/vnd.fdf, fdf -application/vnd.font-fontforge-sfd, sfd -application/vnd.hp-hpgl, hgl|hpg|hpgl -application/vnd.iccprofile, icm -application/vnd.iccprofile, icm -application/vnd.lotus-1-2-3, -application/vnd.ms-cab-compressed, cab -application/vnd.ms-excel, xlb|xlc|xll|xlm|xls|xlw -application/vnd.ms-fontobject, eot -application/vnd.ms-opentype, otf -application/vnd.ms-pki.certstore, sst -application/vnd.ms-pki.pko, pko -application/vnd.ms-pki.seccat, cat -application/vnd.ms-powerpoint, pot|ppa|pps|ppt|pwz -application/vnd.ms-project, mpp -application/vnd.oasis.opendocument.base, odb -application/vnd.oasis.opendocument.formula, odf -application/vnd.oasis.opendocument.graphics, odg -application/vnd.oasis.opendocument.presentation, odp -application/vnd.oasis.opendocument.spreadsheet, ods -application/vnd.oasis.opendocument.text, odt -application/vnd.openxmlformats-officedocument.presentationml.presentation, pptx -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xlsx -application/vnd.openxmlformats-officedocument.wordprocessingml.document, docx -application/vnd.symbian.install, -application/vnd.tcpdump.pcap, pcap -application/vnd.wap.wmlc, wmlc -application/vnd.wap.wmlscriptc, wmlsc -application/vnd.xara, web -application/vocaltec-media-desc, vmd -application/vocaltec-media-file, vmf -application/warc, warc -application/winhelp, hlp -application/wordperfect6.0, w60 -application/wordperfect6.1, w61 -application/wordperfect, wp|wp5|wp6|wpd -application/x-123, wk1 -application/x-7z-compressed, 7z -application/x-aim, aim -application/x-apple-diskimage, -application/x-arc, -application/x-archive, a -application/x-atari-7800-rom, a78 -application/x-authorware-bin, aab -application/x-authorware-map, aam -application/x-authorware-seg, aas -application/x-avira-qua, -application/x-bcpio, bcpio -application/x-bittorrent, torrent -application/x-bsh, bsh -application/x-bytecode.python, pyc -application/x-bzip2, boz|bz2 -application/x-bzip, bz -application/x-cbr, cbr -application/x-cbz, cbz -application/x-cdlink, vcd -application/x-chat, cha|chat -application/x-chrome-extension, -application/x-cocoa, cco -application/x-conference, nsc -application/x-coredump, -application/x-cpio, cpio -application/x-dbf, dbf -application/x-dbt, -application/x-debian-package, deb -application/x-deepv, deepv -application/x-director, dcr|dir|dxr -application/x-dmp, dmp -application/x-dosdriver, -application/x-dosexec, dll -application/x-dvi, dvi -application/x-elc, elc -application/x-empty, -application/x-envoy, env|evy -application/x-esrehber, es -application/x-excel, xla|xld|xlk|xlt|xlv -application/x-executable, exe -application/x-font-gdos, -application/x-font-pf2, pf2 -application/x-font-pfm, pfm -application/x-font-sfn, -application/x-font-ttf, ttf|ttc -application/x-fptapplication/x-dbt, -application/x-freelance, pre -application/x-gamecube-rom, -application/x-gdbm, -application/x-gettext-translation, -application/x-git, -application/x-gsp, gsp -application/x-gss, gss -application/x-gtar, gtar -application/x-gzip, gzip -application/x-hdf, hdf -application/x-helpfile, help -application/x-httpd-imap, imap -application/x-ima, ima -application/x-innosetup, -application/x-internett-signup, ins -application/x-inventor, iv -application/x-ip2, ip -application/x-java-applet, -application/x-java-commerce, jcm -application/x-java-image, -application/x-java-jmod, jmod -application/x-java-keystore, -application/x-kdelnk, -application/x-koan, skd|skm|skp|skt -application/x-latex, latex|ltx -application/x-livescreen, ivy -application/x-lotus, wq1 -application/x-lz4+json, jsonlz4 -application/x-lz4, lz4 -application/x-lz4, lz4 -application/x-lzh-compressed, -application/x-lzh, lzh -application/x-lzip, lz -application/x-lzma, lzma -application/x-lzop, lzo -application/x-lzx, lzx -application/x-mach-binary, jnilib|dylib -application/x-mach-executable, -application/x-magic-cap-package-1.0, mc$ -application/x-mathcad, mcd -application/x-maxis-dbpf, -application/x-meme, mm -application/x-midi, midi -application/x-mif, mif -application/x-mix-transfer, nix -application/xml, opf -application/x-mobipocket-ebook, mobi -application/x-msaccess, accdb -application/x-ms-compress-szdd, fon -application/x-ms-pdb, pdb -application/x-ms-reader, lit -application/x-n64-rom, z64 -application/x-navi-animation, ani -application/x-navidoc, nvd -application/x-navimap, map -application/x-navistyle, stl -application/x-nes-rom, nes -application/x-netcdf, cdf|nc -application/x-newton-compatible-pkg, pkg -application/x-nintendo-ds-rom, -application/x-object, o -application/x-omcdatamaker, omcd -application/x-omc, omc -application/x-omcregerator, omcr -application/x-pagemaker, pm4|pm5 -application/x-pcl, pcl -application/x-pgp-keyring, -application/x-pixclscript, plx -application/x-pkcs7-certreqresp, p7r -application/x-pkcs7-signature, p7a -application/x-project, mpc|mpt|mpv|mpx -application/x-qpro, wb1 -application/x-rar, rar -application/x-rpm, rpm -application/x-sdp, sdp -application/x-sea, sea -application/x-seelogo, sl -application/x-setupscript, -application/x-sharedlib, so -application/x-shar, shar -application/x-shockwave-flash, swf -application/x-snappy-framed, -application/x-sprite, spr|sprite -application/x-sqlite3, -application/x-stargallery-thm, -application/x-stuffit, sit -application/x-sv4cpio, sv4cpio -application/x-sv4crc, sv4crc -application/x-tar, tar -application/x-tbook, sbk|tbk -application/x-terminfo, -application/x-terminfo2, -application/x-texinfo, texi|texinfo -application/x-tex-tfm, tfm -application/x-ustar, ustar -application/x-visio, vsd|vst|vsw -application/x-vnd.audioexplosion.mzz, mzz -application/x-vnd.ls-xpix, xpix -application/x-vrml, vrml -application/x-wais-source, src|wsrc -application/x-wine-extension-ini, -application/x-wintalk, wtk -application/x-world, svr -application/x-wri, wri -application/x-x509-ca-cert, der -application/x-xz, xz -application/x-zip, -application/x-zstd, zst -application/zip, zip -application/zlib, z -!audio/basic, au -audio/it, it -audio/make, funk|my|pfunk -audio/midi, kar -audio/mid, rmi -audio/mp4, m4b -audio/mpeg, m2a|mpa -audio/ogg, ogg -audio/s3m, s3m -audio/tsp-audio, tsi -audio/tsplayer, tsp -audio/vnd.qcelp, qcp -audio/voxware, vox -audio/x-aiff, aiff|aif -audio/x-flac, flac -audio/x-gsm, gsd|gsm -audio/x-hx-aac-adts, -audio/x-jam, jam -audio/x-liveaudio, lam -audio/x-m4a, m4a -audio/x-midi, mid -audio/x-mod, -audio/x-mp4a-latm, -audio/x-mpeg-3, mp3 -audio/x-mpequrl, -audio/xm, xm -audio/x-nspaudio, lma -audio/x-pn-realaudio, ram|rm|rmm|rmp -audio/x-psid, sid -audio/x-realaudio, ra -audio/x-s3m, -audio/x-twinvq-plugin, vqe|vql -audio/x-twinvq, vqf -audio/x-voc, voc -audio/x-wav, wav -!audio/x-xbox360-executable, xex -!audio/x-xbox-executable, xbe -font/otf, -font/sfnt, -font/woff2, woff2 -font/woff, woff -image/bmp, -image/cmu-raster, rast -image/fif, fif -image/florian, flo|turbot -image/g3fax, g3 -image/gif, gif -image/heic, heic -image/ief, ief|iefs -image/jpeg, jfif|jfif-tbnl|jpe|jpeg|jpg -image/jutvision, jut -image/naplps, nap|naplps -image/pict, pic|pict -image/png, png|x-png -!image/svg, svg -!image/svg+xml, -image/tiff, -!image/vnd.adobe.photoshop, psd -!image/vnd.djvu, djvu -image/vnd.fpx, fpx -image/vnd.microsoft.icon, -image/vnd.rn-realflash, rf -image/vnd.rn-realpix, rp -image/vnd.wap.wbmp, wbmp -image/vnd.xiff, xif -image/webp, webp -image/wmf, -image/x-3ds, 3ds -image/x-award-bioslogo, -image/x-cmu-raster, ras -image/x-cur, tga -image/x-dwg, dwg|dxf|svf -image/x-eps, -image/x-exr, exr -image/x-gem, -image/x-icns, -!image/x-icon, ico -image/x-jg, art -image/x-jps, jps -image/x-ms-bmp, bm|bmp -image/x-niff, nif|niff -image/x-pcx, pcx -image/x-pict, pct -image/x-portable-bitmap, pbm -image/x-portable-graymap, pgm -image/x-portable-pixmap, ppm -image/x-quicktime, qif|qti|qtif -image/x-rgb, rgb -image/x-tga, -image/x-tiff, tif|tiff -image/x-win-bitmap, -!image/x-xcf, xcf -!image/x-xpixmap, xpm -image/x-xwindowdump, xwd -message/news, -message/rfc822, mht|mhtml|mime -model/vnd.dwf, dwf -model/vnd.gdl, gdl -model/vnd.gs.gdl, gdsl -model/vrml, wrz -model/x-pov, pov -text/asp, asp -text/css, css -text/html, acgi|htm|html|htmls|htx|shtml -text/javascript, js -text/mcf, mcf -text/pascal, pas -text/PGP, -text/plain, com|cmd|conf|def|g|idc|list|lst|mar|sdml|text|txt|md|groovy|license|properties|desktop|ini|rst|cmake|ipynb|readme|less|lo|go|yml|d|cs|hpp|srt|nfo|sfv|m3u|csv|eml -text/richtext, rt|rtf|rtx -text/rtf, -text/scriplet, wsc -text/tab-separated-values, tsv -text/troff, man|me|ms|roff|t|tr -text/uri-list, uji|unis|uri|uris -text/vnd.abc, abc -text/vnd.fmi.flexstor, flx -text/vnd.wap.wmlscript, wmls -text/vnd.wap.wml, wml -text/webviewhtml, htt -text/x-Algol68, -text/x-asm, asm|s -text/x-audiosoft-intra, aip -text/x-awk, awk -text/x-bcpl, -text/x-c, c|cc|h -text/x-c++, cpp|cxx|c++ -text/x-component, htc -text/x-diff, -text/x-fortran, f|f77|f90|for -text/x-java, jav|java -text/x-la-asf, lsx -text/x-lisp, el -text/x-m4, m4|ac -text/x-makefile, am|mak -text/xml, xml|pom|iml|plist -text/x-m, m -text/x-msdos-batch, bat -text/x-ms-regedit, reg -text/x-objective-c, -text/x-pascal, p -text/x-perl, pl -text/x-php, php -text/x-po, po -text/x-python, py -text/x-ruby, rb -text/x-sass, sass -text/x-scss, scss -text/x-server-parsed-html, ssi -text/x-setext, etx -text/x-sgml, sgm|sgml -text/x-shellscript, sh -text/x-speech, talk -text/x-tcl, -text/x-tex, tex -text/x-uil, uil -text/x-uuencode, uue -text/x-vcalendar, vcs -text/x-vcard, vcf -video/animaflex, afl -video/avi, avi -video/avs-video, avs -video/MP2T, -video/mp4, mp4 -video/mpeg, m1v|m2v|mpe|mpeg|mpg -video/quicktime, moov|mov|qt -video/vdo, vdo -video/vivo, viv|vivo -video/vnd.rn-realvideo, rv -video/vosaic, vos -video/webm, webm -video/x-amt-demorun, xdr -video/x-amt-showrun, xsr -video/x-atomic3d-feature, fmf -video/x-dl, dl -video/x-dv, dif|dv -video/x-fli, fli -video/x-flv, flv -video/x-isvideo, isu -!video/x-jng, jng -video/x-m4v, m4v -video/x-matroska, mkv -video/x-mng, mng -video/x-motion-jpeg, mjpg -video/x-ms-asf, asf|asx|wmv -video/x-msvideo, divx -video/x-qtc, qtc -video/x-sgi-movie, movie|mv -x-epoc/x-sisx-app, diff --git a/scripting/README.md b/scripting/README.md deleted file mode 100644 index f0b43f7..0000000 --- a/scripting/README.md +++ /dev/null @@ -1,152 +0,0 @@ -## User scripts - -*This document is under construction, more in-depth guide coming soon* - -During the `index` step, you can use the `--script-file - -