Skip to content

Commit c610797

Browse files
committed
Initial import of tarantool documentation
0 parents  commit c610797

File tree

229 files changed

+69519
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+69519
-0
lines changed

CMakeLists.txt

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
3+
project(tarantool C)
4+
5+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
6+
set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_INCLUDE_PATH})
7+
8+
include(FindOptionalPackage)
9+
include(FindPackageMessage)
10+
11+
include(cmake/FindSphinx.cmake)
12+
13+
#
14+
# Get version
15+
#
16+
17+
set (PACKAGE_VERSION "")
18+
set (TARANTOOL_VERSION "")
19+
20+
# Try to get version from VERSION file
21+
set(VERSION_FILE_ORIG "${PROJECT_SOURCE_DIR}/VERSION")
22+
set(VERSION_FILE "${PROJECT_BINARY_DIR}/VERSION")
23+
if (EXISTS "${VERSION_FILE_ORIG}")
24+
file (STRINGS "${VERSION_FILE_ORIG}" TARANTOOL_VERSION)
25+
elseif (EXISTS "${VERSION_FILE}")
26+
file (STRINGS "${VERSION_FILE}" TARANTOOL_VERSION)
27+
endif()
28+
29+
if (NOT TARANTOOL_VERSION)
30+
message (FATAL_ERROR "Unable to retrive version from git or ${VERSION_FILE} file.")
31+
endif()
32+
33+
#
34+
# Split full version (git describe --long) to get components
35+
#
36+
string(REPLACE "-" "." TARANTOOL_VERSION_LIST ${TARANTOOL_VERSION})
37+
string(REPLACE "." ";" TARANTOOL_VERSION_LIST ${TARANTOOL_VERSION_LIST})
38+
LIST(GET TARANTOOL_VERSION_LIST 0 CPACK_PACKAGE_VERSION_MAJOR)
39+
LIST(GET TARANTOOL_VERSION_LIST 1 CPACK_PACKAGE_VERSION_MINOR)
40+
LIST(GET TARANTOOL_VERSION_LIST 2 CPACK_PACKAGE_VERSION_PATCH)
41+
42+
set(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}")
43+
set(PACKAGE_VERSION "${PACKAGE_VERSION}.${CPACK_PACKAGE_VERSION_MINOR}")
44+
set(PACKAGE_VERSION "${PACKAGE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
45+
46+
find_package_message(TARANTOOL_VERSION
47+
"Tarantool version is ${TARANTOOL_VERSION} (${PACKAGE_VERSION})"
48+
"${PACKAGE_VERSION}")
49+
50+
configure_file(
51+
"${PROJECT_SOURCE_DIR}/www/content/newsite/download.yml.in"
52+
"${PROJECT_BINARY_DIR}/www/content/newsite/download.yml"
53+
)
54+
55+
add_subdirectory(sphinx)
56+
add_subdirectory(www)

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.7.0

cmake/FindOptionalPackage.cmake

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
if (NOT _OptionalPackagesFile)
2+
set(_OptionalPackagesFile
3+
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OptionalPackages.txt)
4+
if (EXISTS ${_OptionalPackagesFile})
5+
file(REMOVE ${_OptionalPackagesFile})
6+
endif()
7+
endif()
8+
file(APPEND "${_OptionalPackagesFile}" "")
9+
10+
macro (find_optional_package _package)
11+
string(TOUPPER ${_package} _packageUpper)
12+
if (NOT DEFINED WITH_${_packageUpper})
13+
# First run and WITH_${_packageUpper} option is not set by the user.
14+
# Enable auto-mode and try to find package.
15+
find_package(${_package} ${ARGN})
16+
elseif (WITH_${_packageUpper})
17+
# Non-first run or WITH_${_packageUpper} was set by the user.
18+
# Force error if the package will not be found.
19+
set(${_packageUpper}_FIND_REQUIRED ON)
20+
find_package(${_package} ${ARGN})
21+
endif ()
22+
if (${_package}_FOUND OR ${_packageUpper}_FOUND)
23+
set(_default ON)
24+
else()
25+
set(_default OFF)
26+
endif()
27+
# Add the user option and (!) update the cache
28+
option(WITH_${_packageUpper} "Search for ${_package} package" ${_default})
29+
# Now ${WITH_${_packageUpper}} is either ON or OFF
30+
file(APPEND "${_OptionalPackagesFile}"
31+
"-- WITH_${_packageUpper}=${WITH_${_packageUpper}}\n")
32+
endmacro (find_optional_package)
33+
34+
macro(list_optional_packages)
35+
file(READ ${_OptionalPackagesFile} _message)
36+
find_package_message(OPTIONAL_PACKAGES "${_message}" "${_message}")
37+
endmacro()

cmake/FindSphinx.cmake

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
include(FindPackageHandleStandardArgs)
2+
3+
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
4+
HINTS
5+
$ENV{SPHINX_DIR}
6+
PATH_SUFFIXES bin
7+
)
8+
9+
find_program(SPHINX_INTL_EXECUTABLE NAMES sphinx-intl
10+
HINTS
11+
$ENV{SPHINX_INTL_DIR}
12+
PATH_SUFFIXES bin
13+
)
14+
15+
find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE SPHINX_INTL_EXECUTABLE)
16+
mark_as_advanced(SPHINX_EXECUTABLE SPHINX_INTL_EXECUTABLE)

coding-style-shell.txt

+259
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
2+
Bourne Shell Coding Conventions
3+
--------------------------------
4+
5+
Original version by Mike Shapiro and OpenSolaris Shell Project.
6+
This document describes the shell coding style used for all the ON shell
7+
script changes integrated into Solaris.
8+
9+
All new shell code should conform to this coding standard, which is intended
10+
to match our existing C coding standard.
11+
12+
When in doubt, think "what would be the C-Style equivalent?"
13+
14+
Basic Format
15+
------------
16+
17+
Similar to cstyle, the basic format is that all lines are indented by TABs,
18+
and continuation lines (which in the shell end with "\") are indented by
19+
an equivalent number of TABs and then an additional four spaces, e.g.
20+
21+
cp foo bar
22+
cp some_realllllllllllllllly_realllllllllllllly_long_path \
23+
to_another_really_long_path
24+
25+
If, For, and While
26+
------------------
27+
28+
To match cstyle, the sh token equivalent to the C "{" should appear on
29+
the same line, separated by a ";", as in:
30+
31+
if [ $x = hello ]; then
32+
echo $x
33+
fi
34+
35+
for i in 1 2 3; do
36+
echo $i
37+
done
38+
39+
while [ $# -gt 0 ]; do
40+
echo $1
41+
shift
42+
done
43+
44+
Test Built-in
45+
-------------
46+
47+
DO NOT use the test built-in. Sorry, executive decision. In our Bourne shell,
48+
the test built-in is the same as the "[" built-in (if you don't believe me,
49+
try "type test" or refer to usr/src/cmd/sh/msg.c). So please do not write:
50+
51+
if test $# -gt 0; then
52+
53+
instead use:
54+
55+
if [ $# -gt 0 ]; then
56+
57+
Single-line if-statements
58+
-------------------------
59+
60+
It is permissible to use && and || to construct shorthand for an "if"
61+
statement in the case where the if statement has a single consequent line:
62+
63+
[ $# -eq 0 ] && exit 0
64+
65+
instead of the longer:
66+
67+
if [ $# -eq 0 ]; then
68+
exit 0
69+
fi
70+
71+
DO NOT combine && with { }, as in:
72+
73+
[ $# -eq 0 ] && {
74+
do something
75+
do something else
76+
}
77+
78+
Use a complete "if-then-fi" construct for this instead.
79+
80+
Infinite Loops
81+
--------------
82+
83+
The proper way to write an infinite loop in the Bourne shell is to use
84+
the ":" built-in, which evaluates to true (exit status 0).
85+
This is better than using "true", because that is *not* a built-in in the
86+
Bourne shell and thus runs /bin/true.
87+
88+
while :; do
89+
echo infinite loop
90+
done
91+
92+
Exit Status and If/While Statements
93+
-----------------------------------
94+
95+
Recall that "if" and "while" operate on the exit status of the statement
96+
to be executed. In the shell, zero (0) means true and non-zero means false.
97+
The exit status of the last command which was executed is available in
98+
the $? variable. When using "if" and "while", it is typically not necessary
99+
to use $? explicitly, as in:
100+
101+
grep foo /etc/passwd >/dev/null 2>&1
102+
if [ $? -eq 0 ]; then
103+
echo found
104+
fi
105+
106+
Instead, you can more concisely write:
107+
108+
if grep foo /etc/passwd >/dev/null 2>&1; then
109+
echo found
110+
fi
111+
112+
Or, when appropriate:
113+
grep foo /etc/passwd >/dev/null 2>&1 && echo found
114+
115+
DO NOT attempt to make pseudo-booleans by setting variables to "true"
116+
and "false" and then running the variable as a command instead of using a
117+
comparison test. This is non-idiomatic and confusing to many long-time
118+
shell programmers.
119+
120+
Use:
121+
122+
good=true
123+
if [[ $good = "true" ]] ; then
124+
125+
Not:
126+
127+
good=false
128+
if $good ; then
129+
130+
Variable References
131+
-------------------
132+
133+
Variable references begin with $ and *may* have their name enclosed in {}'s.
134+
We prefer to only see the {}'s when required.
135+
Do not spuriously enclose all your variable names in braces, like this:
136+
foo=${bar}
137+
138+
This is kind of like writing all your C variable assignments like this:
139+
foo = (bar);
140+
141+
It compiles, but it looks stupid.
142+
143+
Braces are required around variable names in two specific cases:
144+
145+
(1) when you are forming the string concatenation of your variable with
146+
another string:
147+
148+
[ $install = yes ] && root="/a/" || root="/"
149+
hosts=${root}etc/inet/hosts
150+
151+
and (2) when you are using one of the various substitution/assignment operators:
152+
153+
echo ${BASEDIR:-/a}
154+
155+
Variable Naming
156+
---------------
157+
158+
We prefer that you adopt a shell variable naming scheme where capitalization
159+
provides additional meaning (as in our C style): use CAPITAL letters for
160+
variables that are exported into the environment, or are equivalent to C
161+
constants or #defines. Use lowercase letters for other variable names:
162+
BASEDIR=/a; export BASEDIR
163+
argc=$#
164+
165+
This helps your reader immediately understand the implication of modifying a
166+
given variable (i.e. whether it will be inherited by child processes).
167+
168+
Quoting
169+
-------
170+
171+
Quick review of the quoting basics:
172+
173+
Single quotes ('') mean quote but do not expand variable or backquote
174+
substitutions.
175+
Double quotes ("") mean quote but allow expansion.
176+
Backquotes (``) mean execute the command and substitute its standard output
177+
(note: stderr is unchanged and may "leak" through unless properly redirected)
178+
179+
Use whatever quotes are appropriate for your situation, but please do not
180+
unnecessarily quote everything (also see 7 above).
181+
182+
For example, references to variables controlled by your script do not have to
183+
be quoted unless you are expecting your variable to expand to multiple tokens,
184+
or to the empty string.
185+
186+
However, any variable which contains values from outside the script, such as
187+
user input or filenames, should be quoted to avoid errors from special
188+
characters, including whitespace
189+
190+
Testing for (Non-)Empty Strings
191+
-------------------------------
192+
193+
DO NOT test for (non-)/empty strings by comparing to "" or ''. ALWAYS use the
194+
test operators -n (non-zero-length string) and -z (zero-length string):
195+
196+
if [ -z "$foo" ]; then
197+
echo 'you forgot to set $foo'
198+
fi
199+
200+
if [ -n "$BASEDIR" ]; then
201+
echo "\$BASEDIR is set to $BASEDIR"
202+
fi
203+
204+
Commenting
205+
----------
206+
207+
Shell comments are preceded by the '#' character. Place single-line comments
208+
in the right-hand margin. Use an extra '#' above and below the comment in the
209+
case of multi-line comments:
210+
cp foo bar # Copy foo to bar
211+
212+
#
213+
# Modify the permissions on bar. We need to set them to root/sys
214+
# in order to match the package prototype.
215+
#
216+
chown root bar
217+
chgrp sys bar
218+
219+
Pathnames
220+
---------
221+
222+
It is always a good idea to be careful about $PATH settings and pathnames when
223+
writing shell scripts. This allows them to function correctly even when the
224+
user invoking your script has some strange $PATH set in their environment.
225+
226+
There are two acceptable ways to do this:
227+
228+
(1) make *all* command references in your script use explicit pathnames:
229+
/usr/bin/chown root bar
230+
/usr/bin/chgrp sys bar
231+
232+
or (2) explicitly reset $PATH in your script:
233+
PATH=/usr/bin; export PATH
234+
235+
chown root bar
236+
chgrp sys bar
237+
238+
DO NOT use a mixture of (1) and (2) in the same script.
239+
Pick one method and use it consistently.
240+
241+
Command arguments
242+
-----------------
243+
244+
When passing user input to commands, if the first operand of a command is a
245+
variable, use -- for any command that accepts this to flag the end of
246+
arguments to avoid problems if the variable expands to a value startingwith -.
247+
248+
Interpreter Magic
249+
-----------------
250+
251+
The proper interpreter magic for a shell script should be simply #!/bin/sh.
252+
253+
End of file
254+
-----------
255+
256+
Following 2 lines should be placed at the end of file:
257+
258+
# __EOF__
259+
<empty line>

requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pygments>=2.0.0
2+
pelican>=3.5.0
3+
BeautifulSoup>=3.2.0
4+
breathe>=4.0.0

sphinx/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
!.gitignore
2+
*.pyc
3+
_html_build
4+
_single_build
5+
_locale_build
6+
conf.py

0 commit comments

Comments
 (0)