Compare commits
No commits in common. "9f5845fc51b9bfef60516b7f5c96f0d26e856a46" and "f9e157293c8bbfe56d29218cbe3b2c6fdc1ea2ba" have entirely different histories.
9f5845fc51
...
f9e157293c
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required (VERSION 3.0)
|
project (json-rpc-shell C)
|
||||||
project (json-rpc-shell VERSION 1.1.0 LANGUAGES C)
|
cmake_minimum_required (VERSION 2.8.5)
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
option (WANT_READLINE "Use GNU Readline for the UI (better)" ON)
|
option (WANT_READLINE "Use GNU Readline for the UI (better)" ON)
|
||||||
@ -10,7 +10,16 @@ if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
|
|||||||
# -Wunused-function is pretty annoying here, as everything is static
|
# -Wunused-function is pretty annoying here, as everything is static
|
||||||
set (CMAKE_C_FLAGS
|
set (CMAKE_C_FLAGS
|
||||||
"${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Wno-unused-function")
|
"${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Wno-unused-function")
|
||||||
endif ()
|
endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
|
# Version
|
||||||
|
set (project_VERSION_MAJOR "1")
|
||||||
|
set (project_VERSION_MINOR "1")
|
||||||
|
set (project_VERSION_PATCH "0")
|
||||||
|
|
||||||
|
set (project_VERSION "${project_VERSION_MAJOR}")
|
||||||
|
set (project_VERSION "${project_VERSION}.${project_VERSION_MINOR}")
|
||||||
|
set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}")
|
||||||
|
|
||||||
# For custom modules
|
# For custom modules
|
||||||
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||||
@ -30,43 +39,25 @@ set (project_libraries ${dependencies_LIBRARIES}
|
|||||||
include_directories (${dependencies_INCLUDE_DIRS}
|
include_directories (${dependencies_INCLUDE_DIRS}
|
||||||
${libssl_INCLUDE_DIRS} ${LIBEV_INCLUDE_DIRS})
|
${libssl_INCLUDE_DIRS} ${LIBEV_INCLUDE_DIRS})
|
||||||
|
|
||||||
# -liconv may or may not be a part of libc
|
|
||||||
find_library (iconv_LIBRARIES iconv)
|
|
||||||
if (iconv_LIBRARIES)
|
|
||||||
list (APPEND project_libraries ${iconv_LIBRARIES})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
|
|
||||||
# Need this for SIGWINCH in FreeBSD and OpenBSD respectively;
|
|
||||||
# our POSIX version macros make it undefined
|
|
||||||
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (ncursesw_FOUND)
|
if (ncursesw_FOUND)
|
||||||
list (APPEND project_libraries ${ncursesw_LIBRARIES})
|
list (APPEND project_libraries ${ncursesw_LIBRARIES})
|
||||||
include_directories (${ncursesw_INCLUDE_DIRS})
|
include_directories (${ncursesw_INCLUDE_DIRS})
|
||||||
elseif (CURSES_FOUND)
|
elseif (CURSES_FOUND)
|
||||||
list (APPEND project_libraries ${CURSES_LIBRARY})
|
list (APPEND project_libraries ${CURSES_LIBRARY})
|
||||||
include_directories (${CURSES_INCLUDE_DIR})
|
include_directories (${CURSES_INCLUDE_DIR})
|
||||||
else ()
|
else (CURSES_FOUND)
|
||||||
message (SEND_ERROR "Curses not found")
|
message (SEND_ERROR "Curses not found")
|
||||||
endif ()
|
endif (ncursesw_FOUND)
|
||||||
|
|
||||||
if ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
|
if ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
|
||||||
message (SEND_ERROR "You have to choose either GNU Readline or libedit")
|
message (SEND_ERROR "You have to choose either GNU Readline or libedit")
|
||||||
elseif (WANT_READLINE)
|
elseif (WANT_READLINE)
|
||||||
# OpenBSD's default readline is too old
|
list (APPEND project_libraries readline)
|
||||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
|
|
||||||
include_directories (${OPENBSD_LOCALBASE}/include/ereadline)
|
|
||||||
list (APPEND degesch_libraries ereadline)
|
|
||||||
else ()
|
|
||||||
list (APPEND degesch_libraries readline)
|
|
||||||
endif ()
|
|
||||||
elseif (WANT_LIBEDIT)
|
elseif (WANT_LIBEDIT)
|
||||||
pkg_check_modules (libedit REQUIRED libedit)
|
pkg_check_modules (libedit REQUIRED libedit)
|
||||||
list (APPEND project_libraries ${libedit_LIBRARIES})
|
list (APPEND project_libraries ${libedit_LIBRARIES})
|
||||||
include_directories (${libedit_INCLUDE_DIRS})
|
include_directories (${libedit_INCLUDE_DIRS})
|
||||||
endif ()
|
endif ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
|
||||||
|
|
||||||
# Generate a configuration file
|
# Generate a configuration file
|
||||||
set (HAVE_READLINE "${WANT_READLINE}")
|
set (HAVE_READLINE "${WANT_READLINE}")
|
||||||
@ -95,23 +86,23 @@ install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|||||||
install (PROGRAMS json-format.pl DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install (PROGRAMS json-format.pl DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||||
|
|
||||||
# Generate documentation from text markup
|
# Generate documentation from program help
|
||||||
find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor)
|
find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor)
|
||||||
if (NOT ASCIIDOCTOR_EXECUTABLE)
|
if (NOT ASCIIDOCTOR_EXECUTABLE)
|
||||||
message (FATAL_ERROR "asciidoctor not found")
|
message (FATAL_ERROR "asciidoctor not found")
|
||||||
endif ()
|
endif (NOT ASCIIDOCTOR_EXECUTABLE)
|
||||||
|
|
||||||
foreach (page ${PROJECT_NAME})
|
foreach (page ${PROJECT_NAME})
|
||||||
set (page_output "${PROJECT_BINARY_DIR}/${page}.1")
|
set (page_output "${PROJECT_BINARY_DIR}/${page}.1")
|
||||||
list (APPEND project_MAN_PAGES "${page_output}")
|
list (APPEND project_MAN_PAGES "${page_output}")
|
||||||
add_custom_command (OUTPUT ${page_output}
|
add_custom_command (OUTPUT ${page_output}
|
||||||
COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage
|
COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage
|
||||||
-a release-version=${PROJECT_VERSION}
|
-a release-version=${project_VERSION}
|
||||||
"${PROJECT_SOURCE_DIR}/${page}.adoc"
|
"${PROJECT_SOURCE_DIR}/${page}.adoc"
|
||||||
-o "${page_output}"
|
-o "${page_output}"
|
||||||
DEPENDS ${page}.adoc
|
DEPENDS ${page}.adoc
|
||||||
COMMENT "Generating man page for ${page}" VERBATIM)
|
COMMENT "Generating man page for ${page}" VERBATIM)
|
||||||
endforeach ()
|
endforeach (page)
|
||||||
|
|
||||||
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
|
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
|
||||||
|
|
||||||
@ -119,19 +110,22 @@ foreach (page ${project_MAN_PAGES})
|
|||||||
string (REGEX MATCH "\\.([0-9])$" manpage_suffix "${page}")
|
string (REGEX MATCH "\\.([0-9])$" manpage_suffix "${page}")
|
||||||
install (FILES "${page}"
|
install (FILES "${page}"
|
||||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")
|
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")
|
||||||
endforeach ()
|
endforeach (page)
|
||||||
|
|
||||||
# CPack
|
# CPack
|
||||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "A shell for JSON-RPC 2.0")
|
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "A shell for JSON-RPC 2.0")
|
||||||
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
|
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
|
||||||
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
|
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
|
||||||
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
set (CPACK_PACKAGE_VERSION_MAJOR ${project_VERSION_MAJOR})
|
||||||
|
set (CPACK_PACKAGE_VERSION_MINOR ${project_VERSION_MINOR})
|
||||||
|
set (CPACK_PACKAGE_VERSION_PATCH ${project_VERSION_PATCH})
|
||||||
set (CPACK_GENERATOR "TGZ;ZIP")
|
set (CPACK_GENERATOR "TGZ;ZIP")
|
||||||
set (CPACK_PACKAGE_FILE_NAME
|
set (CPACK_PACKAGE_FILE_NAME
|
||||||
"${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
"${PROJECT_NAME}-${project_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${PROJECT_VERSION}")
|
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${project_VERSION}")
|
||||||
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
|
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
|
||||||
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git;/build;/CMakeLists.txt.user")
|
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git;/build;/CMakeLists.txt.user")
|
||||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${project_VERSION}")
|
||||||
|
|
||||||
include (CPack)
|
include (CPack)
|
||||||
|
@ -5,7 +5,7 @@ json-rpc-shell
|
|||||||
'json-rpc-shell' is a shell for running JSON-RPC 2.0 queries.
|
'json-rpc-shell' is a shell for running JSON-RPC 2.0 queries.
|
||||||
|
|
||||||
This software was originally created as a replacement for
|
This software was originally created as a replacement for
|
||||||
http://software.dzhuvinov.com/json-rpc-2.0-shell.html[a different shell] made by
|
http://software.dzhuvinov.com/json-rpc-2.0-shell.html[a different one] made by
|
||||||
Vladimir Dzhuvinov, in order to avoid Java, but has evolved since.
|
Vladimir Dzhuvinov, in order to avoid Java, but has evolved since.
|
||||||
|
|
||||||
Features
|
Features
|
||||||
@ -58,6 +58,9 @@ Or you can try telling CMake to make a package for you. For Debian it is:
|
|||||||
$ cpack -G DEB
|
$ cpack -G DEB
|
||||||
# dpkg -i json-rpc-shell-*.deb
|
# dpkg -i json-rpc-shell-*.deb
|
||||||
|
|
||||||
|
Note that for versions of CMake before 2.8.9, you need to prefix `cpack` with
|
||||||
|
`fakeroot` or file ownership will end up wrong.
|
||||||
|
|
||||||
Test server
|
Test server
|
||||||
-----------
|
-----------
|
||||||
If you install development packages for libmagic, an included test server will
|
If you install development packages for libmagic, an included test server will
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
#define PROGRAM_NAME "${PROJECT_NAME}"
|
#define PROGRAM_NAME "${PROJECT_NAME}"
|
||||||
#define PROGRAM_VERSION "${PROJECT_VERSION}"
|
#define PROGRAM_VERSION "${project_VERSION}"
|
||||||
|
|
||||||
#cmakedefine HAVE_READLINE
|
#cmakedefine HAVE_READLINE
|
||||||
#cmakedefine HAVE_EDITLINE
|
#cmakedefine HAVE_EDITLINE
|
||||||
|
@ -96,16 +96,8 @@ Program information
|
|||||||
*--write-default-cfg*[**=**__PATH__]::
|
*--write-default-cfg*[**=**__PATH__]::
|
||||||
Write a default configuration file, show its path and exit.
|
Write a default configuration file, show its path and exit.
|
||||||
|
|
||||||
Environment
|
|
||||||
-----------
|
|
||||||
*VISUAL*, *EDITOR*::
|
|
||||||
The editor program to be launched by the M-e key binding.
|
|
||||||
If neither variable is set, it defaults to *vi*(1).
|
|
||||||
|
|
||||||
Files
|
Files
|
||||||
-----
|
-----
|
||||||
*json-rpc-shell* follows the XDG Base Directory Specification.
|
|
||||||
|
|
||||||
_~/.config/json-rpc-shell/json-rpc-shell.conf_::
|
_~/.config/json-rpc-shell/json-rpc-shell.conf_::
|
||||||
The configuration file, in which you can configure color output and
|
The configuration file, in which you can configure color output and
|
||||||
CA certificate paths. Use the *--write-default-cfg* option to create
|
CA certificate paths. Use the *--write-default-cfg* option to create
|
||||||
|
2
liberty
2
liberty
@ -1 +1 @@
|
|||||||
Subproject commit d71c47f8ce7aecdc4856630e9d73a48912be68c1
|
Subproject commit 69101eb1554ad2fca6de30cdbaccac076210d7e3
|
Loading…
x
Reference in New Issue
Block a user