Skip to content
Snippets Groups Projects
Commit 2c11851d authored by ocelot-inc's avatar ocelot-inc
Browse files

Merge branch 'master' of https://github.com/tarantool/tarantool

parents 43abc795 761f26e0
No related branches found
No related tags found
No related merge requests found
Showing
with 1053 additions and 57 deletions
......@@ -34,6 +34,8 @@ doc/www-data/*.ru.html
doc/www-data.in/_text/download.md
doc/www-data.in/doc
extra/rpm.spec
extra/rpm/tarantool.rpm.spec
include/tarantool/config.h
src/trivia/config.h
install_manifest.txt
lcov
......
......@@ -11,7 +11,8 @@ set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_IGNORE_FILES
"\\\\.git" "_CPack_Packages"
"CMakeCache.txt" "CPackSourceConfig.cmake" "CPackConfig.cmake"
"CMakeFiles" "\\\\.gz" "\\\\.Z" "\\\\.zip" "\\\\.rpm"
"CMakeFiles" "\\\\.gz" "\\\\.Z" "\\\\.zip"
"x86_64\\\\.rpm" "i386\\\\.rpm" "i686\\\\.rpm"
"\\\\.o" "\\\\.so" "\\\\.a"
"src/tarantool$"
"src/00000000000000000001.snap"
......
find_program(RPMBUILD rpmbuild)
find_program(MKDIR mkdir)
find_program(CP cp)
find_program(WC wc)
execute_process (COMMAND ${GIT} describe HEAD --abbrev=0
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${GIT} rev-list --oneline ${VERSION}..
COMMAND ${WC} -l
OUTPUT_VARIABLE RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE)
set (RPM_PACKAGE_VERSION ${VERSION} CACHE STRING "" FORCE)
set (RPM_PACKAGE_RELEASE ${RELEASE} CACHE STRING "" FORCE)
set (RPM_SOURCE_DIRECTORY_NAME ${CPACK_SOURCE_PACKAGE_FILE_NAME}
CACHE STRING "" FORCE)
set (RPM_PACKAGE_SOURCE_FILE_NAME ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
CACHE STRING "" FORCE)
set (RPM_ROOT "${PROJECT_BINARY_DIR}/RPM" CACHE STRING "" FORCE)
set (RPM_BUILDROOT "${RPM_ROOT}/BUILDROOT" CACHE STRING "" FORCE)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND $(MAKE) package_source)
add_custom_command(OUTPUT ${RPM_ROOT}
COMMAND ${MKDIR} -p ${RPM_ROOT}/BUILD ${RPM_ROOT}/BUILDROOT
${RPM_ROOT}/SOURCES)
add_custom_target(rpm
DEPENDS ${RPM_ROOT}
DEPENDS ${PROJECT_SOURCE_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${CP} ${PROJECT_BINARY_DIR}/${RPM_PACKAGE_SOURCE_FILE_NAME}
${RPM_ROOT}/SOURCES
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} -bb ${PROJECT_SOURCE_DIR}/extra/rpm.spec
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
add_custom_target(rpm_src
DEPENDS ${RPM_ROOT}
DEPENDS ${PROJECT_SOURCE_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${CP} ${PROJECT_BINARY_DIR}/${RPM_PACKAGE_SOURCE_FILE_NAME}
${RPM_ROOT}/SOURCES
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} -bs ${PROJECT_SOURCE_DIR}/extra/rpm.spec
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
if (RPMBUILD)
find_program(MKDIR mkdir)
find_program(CP cp)
find_program(WC wc)
execute_process (COMMAND ${GIT} describe HEAD --abbrev=0
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${GIT} rev-list --oneline ${VERSION}..
COMMAND ${WC} -l
OUTPUT_VARIABLE RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${RPMBUILD} -E '%_srcrpmdir'
OUTPUT_VARIABLE RPM_SRCRPMDIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${RPMBUILD} -E '%_sourcedir'
OUTPUT_VARIABLE RPM_SOURCEDIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set (RPM_PACKAGE_VERSION ${VERSION} CACHE STRING "" FORCE)
set (RPM_PACKAGE_RELEASE ${RELEASE} CACHE STRING "" FORCE)
set (RPM_SOURCE_DIRECTORY_NAME ${CPACK_SOURCE_PACKAGE_FILE_NAME}
CACHE STRING "" FORCE)
set (RPM_PACKAGE_SOURCE_FILE_NAME ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
CACHE STRING "" FORCE)
set (RPM_BUILDROOT "${PROJECT_BINARY_DIR}/RPM/BUILDROOT" CACHE STRING "" FORCE)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND $(MAKE) package_source)
add_custom_command(OUTPUT ${RPM_BUILDROOT}
COMMAND ${MKDIR} -p ${RPM_BUILDROOT})
add_custom_command(OUTPUT ${RPM_SOURCEDIR}
COMMAND ${MKDIR} -p ${RPM_SOURCEDIR})
##############################################################################################
set (RPM_ROOT "${PROJECT_BINARY_DIR}/RPM" CACHE STRING "" FORCE)
add_custom_command(OUTPUT ${RPM_ROOT}
COMMAND ${MKDIR} -p ${RPM_ROOT}/{BUILD,SOURCES,SRPMS} ${RPM_ROOT}/RPMS/{i386,x86_64})
add_custom_target(rpm
DEPENDS ${RPM_ROOT}
DEPENDS ${PROJECT_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${CP} ${PROJECT_BINARY_DIR}/${RPM_PACKAGE_SOURCE_FILE_NAME} ${RPM_ROOT}/SOURCES
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} -bb ${PROJECT_SOURCE_DIR}/extra/rpm.spec
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
add_custom_target(rpm_src
DEPENDS ${RPM_ROOT}
DEPENDS ${PROJECT_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${CP} ${PROJECT_BINARY_DIR}/${RPM_PACKAGE_SOURCE_FILE_NAME} ${RPM_ROOT}/SOURCES
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} -bs ${PROJECT_SOURCE_DIR}/extra/rpm.spec
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
##############################################################################################
add_custom_target(new_rpm
DEPENDS ${RPM_BUILDROOT}
DEPENDS ${PROJECT_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} --define '_sourcedir ./' -bb ${PROJECT_SOURCE_DIR}/extra/rpm/tarantool.rpm.spec
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
add_custom_target(new_rpm_src
DEPENDS ${PROJECT_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} --define '_sourcedir ./' --define '_srcrpmdir ./' -bs ${PROJECT_SOURCE_DIR}/extra/rpm/tarantool.rpm.spec
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
add_custom_target(new_rpm_scl
DEPENDS ${RPM_BUILDROOT}
DEPENDS ${PROJECT_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} -bb ${PROJECT_SOURCE_DIR}/extra/rpm/tarantool-scl.rpm.spec
COMMAND ${RPMBUILD} --buildroot ${RPM_BUILDROOT} --define '_sourcedir ./' -bb ${PROJECT_SOURCE_DIR}/extra/rpm/tarantool.rpm.spec --define 'scl 15'
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
# TODO: Add MOCK builds
# : -DMOCK_TARGET
# : -DMOCK_OS: EPEL / FEDORA
endif()
#
# Scripts for a RPM package
#
......@@ -24,6 +23,7 @@ if (ENABLE_RPM)
endif()
configure_file(rpm.spec.in rpm.spec @ONLY)
configure_file(rpm/tarantool.rpm.spec.in rpm/tarantool.rpm.spec @ONLY)
if (TARGET_OS_DARWIN)
# NOTE: need add execution 'plutil -lint org.tarantool.tarantool.plist
......@@ -42,10 +42,10 @@ if (TARGET_OS_DARWIN)
# chmod +x 644
install (FILES ${CMAKE_BINARY_DIR}/extra/${LUANCHD_PLIST}
DESTINATION share/tarantool
PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ GROUP_READ
WORLD_READ WORLD_READ)
PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ GROUP_READ
WORLD_READ WORLD_READ)
endif()
add_executable(txt2c txt2c.c)
......
......@@ -136,7 +136,7 @@ useradd -r -g tarantool tarantool > /dev/null 2>&1
"%{_bindir}/tarantool"
"%{_bindir}/tarantool_multi.sh"
"%{_bindir}/tarantool_deploy.sh"
"/etc/init.d/tarantool"
"%{_sysconfdir}/init.d/tarantool"
# %dir "%{_sysconfdir}/tarantool"
......@@ -149,7 +149,7 @@ useradd -r -g tarantool tarantool > /dev/null 2>&1
%files pg-module
%defattr(-,root,root,-)
%dir "%{_libdir}/tarantool"
%dir "%{_libdir}/tarantool/"
%dir "%{_libdir}/tarantool/box"
"%{_libdir}/tarantool/box/net/pg.so"
......@@ -162,7 +162,6 @@ useradd -r -g tarantool tarantool > /dev/null 2>&1
%files dev
%defattr(-,root,root,-)
%dir "%{_includedir}/tarantool"
%dir "%{_includedir}/tarantool"
"%{_includedir}/tarantool/config.h"
"%{_includedir}/tarantool/lauxlib.h"
"%{_includedir}/tarantool/luaconf.h"
......
config_opts['root'] = 'tarantool-el-5-i386'
config_opts['target_arch'] = 'i386'
config_opts['legal_host_arches'] = ('i386', 'i586', 'i686', 'x86_64')
config_opts['chroot_setup_cmd'] = 'install buildsys-build'
config_opts['dist'] = 'el5' # only useful for --resultdir variable subst
config_opts['plugin_conf']['ccache_enable'] = False
# beware RHEL use 5Server or 5Client
config_opts['releasever'] = '5'
if not config_opts.has_key('macros'): config_opts['macros'] = {}
config_opts['macros']['%__arch_install_post'] = '%{nil}'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[base]
name=BaseOS
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=os
exclude=postgresql*,cmake*
[updates]
name=updates
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates
exclude=postgresql*,cmake*
[groups]
name=groups
baseurl=http://buildsys.fedoraproject.org/buildgroups/rhel5/i386/
[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386
[testing]
name=epel-testing
enabled=1
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=i386
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/dist-5E-epel-build/latest/i386/
cost=2000
enabled=0
[pgdg91]
name=PostgreSQL 9.1 $releasever - $basearch
baseurl=http://yum.postgresql.org/9.1/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=0
[testing-devtoolset-2-centos]
name=testing 2 devtools for CentOS
baseurl=http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS
gpgcheck=0
[epel-debug]
name=epel-debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=i386
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-el-5-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install buildsys-build'
config_opts['dist'] = 'el5' # only useful for --resultdir variable subst
config_opts['plugin_conf']['ccache_enable'] = False
# beware RHEL use 5Server or 5Client
config_opts['releasever'] = '5'
if not config_opts.has_key('macros'): config_opts['macros'] = {}
config_opts['macros']['%__arch_install_post'] = '%{nil}'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[base]
name=BaseOS
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os
exclude=postgresql*,cmake*
[updates]
name=updates
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates
exclude=postgresql*,cmake*
[groups]
name=groups
baseurl=http://buildsys.fedoraproject.org/buildgroups/rhel5/x86_64/
[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64
[testing]
name=epel-testing
enabled=1
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=x86_64
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/dist-5E-epel-build/latest/x86_64/
cost=2000
enabled=0
[pgdg91]
name=PostgreSQL 9.1 $releasever - $basearch
baseurl=http://yum.postgresql.org/9.1/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=0
[testing-devtoolset-2-centos]
name=testing 2 devtools for CentOS
baseurl=http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS
gpgcheck=0
[epel-debug]
name=epel-debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=x86_64
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-el-6-i386'
config_opts['target_arch'] = 'i386'
config_opts['legal_host_arches'] = ('i386', 'i586', 'i686', 'x86_64')
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'el6' # only useful for --resultdir variable subst
config_opts['plugin_conf']['ccache_enable'] = False
# beware RHEL use 6Server or 6Client
config_opts['releasever'] = '6'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[base]
name=BaseOS
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=6&arch=i386&repo=os
exclude=postgresql*,cmake*
failovermethod=priority
[updates]
name=updates
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates
exclude=postgresql*,cmake*
failovermethod=priority
[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386
failovermethod=priority
[testing]
name=epel-testing
enabled=1
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel6&arch=i386
failovermethod=priority
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/dist-6E-epel-build/latest/i386/
cost=2000
enabled=0
[pgdg91]
name=PostgreSQL 9.1 $releasever - $basearch
baseurl=http://yum.postgresql.org/9.1/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=0
[testing-devtoolset-2-centos]
name=testing 2 devtools for CentOS
baseurl=http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS
gpgcheck=0
[epel-debug]
name=epel-debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-6&arch=i386
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-el-6-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'el6' # only useful for --resultdir variable subst
config_opts['plugin_conf']['ccache_enable'] = False
# beware RHEL use 6Server or 6Client
config_opts['releasever'] = '6'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[base]
name=BaseOS
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os
exclude=postgresql*,cmake*
failovermethod=priority
[updates]
name=updates
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates
exclude=postgresql*,cmake*
failovermethod=priority
[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64
failovermethod=priority
[testing]
name=epel-testing
enabled=1
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel6&arch=x86_64
failovermethod=priority
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/dist-6E-epel-build/latest/x86_64/
cost=2000
enabled=0
[pgdg91]
name=PostgreSQL 9.1 $releasever - $basearch
baseurl=http://yum.postgresql.org/9.1/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=0
[testing-devtoolset-2-centos]
name=testing 2 devtools for CentOS
baseurl=http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS
gpgcheck=0
[epel-debug]
name=epel-debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-6&arch=x86_64
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-fedora-19-i386'
config_opts['target_arch'] = 'i386'
config_opts['legal_host_arches'] = ('i386', 'i586', 'i686', 'x86_64')
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'fc19' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '19'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[fedora]
name=fedora
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-19&arch=i386
failovermethod=priority
[updates]
name=updates
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f19&arch=i386
failovermethod=priority
[updates-testing]
name=updates-testing
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f19&arch=i386
failovermethod=priority
enabled=0
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/f19-build/latest/i386/
cost=2000
enabled=0
[fedora-debuginfo]
name=fedora-debuginfo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-19&arch=i386
failovermethod=priority
enabled=0
[updates-debuginfo]
name=updates-debuginfo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f19&arch=i386
failovermethod=priority
enabled=0
[updates-testing-debuginfo]
name=updates-testing-debuginfo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-debug-f19&arch=i386
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-fedora-19-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'fc19' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '19'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[fedora]
name=fedora
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-19&arch=x86_64
failovermethod=priority
[updates]
name=updates
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f19&arch=x86_64
failovermethod=priority
[updates-testing]
name=updates-testing
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f19&arch=x86_64
failovermethod=priority
enabled=0
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/f19-build/latest/x86_64/
cost=2000
enabled=0
[fedora-debuginfo]
name=fedora-debuginfo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-19&arch=x86_64
failovermethod=priority
enabled=0
[updates-debuginfo]
name=updates-debuginfo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f19&arch=x86_64
failovermethod=priority
enabled=0
[updates-testing-debuginfo]
name=updates-testing-debuginfo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-debug-f19&arch=x86_64
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-fedora-20-i386'
config_opts['target_arch'] = 'i386'
config_opts['legal_host_arches'] = ('i386', 'i586', 'i686', 'x86_64')
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'fc20' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '20'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[fedora]
name=fedora
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
failovermethod=priority
[updates]
name=updates
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
failovermethod=priority
[updates-testing]
name=updates-testing
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch
failovermethod=priority
enabled=0
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/f20-build/latest/i386/
cost=2000
enabled=0
[fedora-debuginfo]
name=fedora-debuginfo
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
failovermethod=priority
enabled=0
[updates-debuginfo]
name=updates-debuginfo
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
failovermethod=priority
enabled=0
[updates-testing-debuginfo]
name=updates-testing-debuginfo
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-debug-f$releasever&arch=$basearch
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-fedora-20-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'fc20' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '20'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[fedora]
name=fedora
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
failovermethod=priority
[updates]
name=updates
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
failovermethod=priority
[updates-testing]
name=updates-testing
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch
failovermethod=priority
enabled=0
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/f20-build/latest/x86_64/
cost=2000
enabled=0
[fedora-debuginfo]
name=fedora-debuginfo
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
failovermethod=priority
enabled=0
[updates-debuginfo]
name=updates-debuginfo
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
failovermethod=priority
enabled=0
[updates-testing-debuginfo]
name=updates-testing-debuginfo
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-debug-f$releasever&arch=$basearch
failovermethod=priority
enabled=0
"""
config_opts['root'] = 'tarantool-fedora-rawhide-i386'
config_opts['target_arch'] = 'i386'
config_opts['legal_host_arches'] = ('i386', 'i586', 'i686', 'x86_64')
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'rawhide' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '21'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[fedora]
name=fedora
metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=$basearch
failovermethod=priority
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/i386
cost=2000
enabled=0
[debug]
name=Fedora Rawhide - i386 - Debug
failovermethod=priority
metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide-debug&arch=$basearch
enabled=0
"""
config_opts['root'] = 'tarantool-fedora-rawhide-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'rawhide' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '21'
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# repos
[fedora]
name=fedora
metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=$basearch
failovermethod=priority
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/
cost=2000
enabled=0
[debug]
name=Fedora Rawhide - x86_64 - Debug
failovermethod=priority
metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide-debug&arch=$basearch
enabled=0
"""
%global scl 15
%{?scl:%global _scl_prefix /opt/tarantool}
%{?scl:%scl_package}
%{?scl:%global scl_name tarantool-%scl}
Summary: Package that installs %scl Software Collection.
Name: %scl_name
Version: 1.0
Release: 1%{?dist}
Buildarch: noarch
License: BSD
Group: Applications/File
Requires: %{scl_prefix}tarantool
Requires: %{scl_prefix}tarantool-sql-module
Requires: %{scl_prefix}tarantool-pg-module
Requires: %{scl_prefix}tarantool-mysql-module
Requires: %{scl_prefix}tarantool-sophia-module
Requires: %{scl_prefix}tarantool-client
Requires: %{scl_prefix}tarantool-dev
%{?scl:BuildRequires: scl-utils-build}
%{?scl:BuildRequires: iso-codes}
%description
This is the main package for %scl_name Software Collection.
%package build
Summary: Package shipping basic build configuration
Group: Applications/File
%description build
Package shipping essential configuration macros to build %scl Software Collection.
%package runtime
Summary: Package that handles %scl_name Software Collection.
Group: Applications/File
Requires: scl-utils
%description runtime
Package shipping essential configuration macros to build %scl Software Collection.
%prep
%setup -c -T
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_scl_scripts}/root
cat > %{buildroot}/%{_scl_scripts}/enable <<\EOF
export PATH=%{_bindir}${PATH+:${PATH}}
export MANPATH=%{_mandir}:$MANPATH
export INFOPATH=%{_infodir}${INFOPATH:+:${INFOPATH}}
export LD_LIBRARY_PATH=%{_libdir}:\$LD_LIBRARY_PATH
EOF
%scl_install
%files
%files build
%{_root_sysconfdir}/rpm/macros.%{scl}-config
%files runtime
%scl_files
%changelog
* Fri Jun 06 2014 Blikh Eugine <bigbes@gmail.com> 1.0 1
- Initial release
- Initscripts are broken.
####################################################
################# MACROS AND DEFAULTS ##############
####################################################
%{?scl:%{?scl_package:%scl_package tarantool}}
%define _source_filedigest_algorithm 0
%define _binary_filedigest_algorithm 0
%bcond_without postgresql
%bcond_without mysql
%bcond_without client
BuildRequires: scl-utils
BuildRequires: scl-utils-build
BuildRequires: e2fsprogs-devel
%{lua:
function rpm_check_string(str)
if type(str) == 'table' then
local ans = false
for _, v in ipairs(str) do
ans = ans or rpm_check_string(v)
end
return ans
end
local temp = rpm.expand(str)
if temp == str or temp == '' or temp == 0 then
return false
end
return true
end
local devtoolset = 'scl enable devtoolset-2 %q'
if rpm_check_string({'%el4', '%el5', '%el6'}) then
print('BuildRequires: cmake28\n')
print('BuildRequires: devtoolset-2-toolchain\n')
print('BuildRequires: devtoolset-2-binutils-devel\n')
else
print('BuildRequires: cmake >= 2.8\n')
print('BuildRequires: gcc >= 4.5\n')
print('BuildRequires: binutils-devel\n')
end
}
Name: %{?scl_prefix}tarantool
Version: @RPM_PACKAGE_VERSION@
Release: @RPM_PACKAGE_RELEASE@
Group: Applications/Databases
Summary: Tarantool - an efficient in-memory data store
Vendor: tarantool.org
License: BSD
Requires: %{?scl_prefix}tarantool-debuginfo = @RPM_PACKAGE_VERSION@-@RPM_PACKAGE_RELEASE@
Requires: e2fsprogs-libs
URL: http://tarantool.org
Source0: @RPM_PACKAGE_SOURCE_FILE_NAME@
%description
Tarantool is a high performance in-memory NoSQL database. It supports
replication, online backup, stored procedures in Lua.
This package provides the server daemon and administration
scripts.
# Tarantool dev spec
%package dev
Summary: Tarantool C connector and header files
Vendor: tarantool.org
Group: Applications/Databases
Provides: %{?scl_prefix}tarantool-dev
Requires: %{?scl_prefix}tarantool = @RPM_PACKAGE_VERSION@-@RPM_PACKAGE_RELEASE@
%description -n %{?scl_prefix}tarantool-dev
Tarantool is a high performance in-memory NoSQL database.
It supports replication, online backup, stored procedures in Lua.
This package provides Tarantool client libraries.
# Tarantool sql module
%package sql-module
Summary: Tarantool common sql interface
Vendor: tarantool.org
Group: Applications/Databases
Provides: %{?scl_prefix}tarantool-sql-module
%description -n %{?scl_prefix}tarantool-sql-module
Tarantool is a high performance in-memory NoSQL database.
It supports replication, online backup, stored procedures in Lua.
This package provides a common sql interface to use with
tarantool-pg-module or by tarantool-mysql-module.
%if %{with postgresql}
%package pg-module
Summary: Tarantool common sql interface
Vendor: tarantool.org
Group: Applications/Databases
Provides: %{?scl_prefix}tarantool-pg-module
BuildRequires: postgresql-devel >= 9.0
Requires: postgresql-libs >= 9.0
%description -n %{?scl_prefix}tarantool-pg-module
Tarantool is a high performance in-memory NoSQL database.
It supports replication, online backup, stored procedures in Lua.
This package provides a PostgreSQL interface to use with
tarantool-sql-module.
%endif
%if %{with mysql}
%package mysql-module
Summary: Tarantool common sql interface
Vendor: tarantool.org
Group: Applications/Databases
Provides: %{?scl_prefix}tarantool-mysql-module
BuildRequires: mysql-devel >= 5.0
Requires: mysql-libs >= 5.0
%description -n %{?scl_prefix}tarantool-mysql-module
Tarantool is a high performance in-memory NoSQL database.
It supports replication, online backup, stored procedures in Lua.
This package provides a MySQL interface to use with
tarantool-sql-module.
%endif
##################################################################
%prep
%setup -n @RPM_SOURCE_DIRECTORY_NAME@
%build
# https://fedoraproject.org/wiki/Packaging:RPMMacros
%{lua:
local function wrap_with_toolset(cmd)
local cmd = rpm.expand(cmd)
local devtoolset = 'scl enable devtoolset-2 %q\n'
if rpm_check_string({'%el4', '%el5', '%el6'}) then
return devtoolset:format(cmd)
end
return cmd
end
local function cmake_key_value(key, value)
return " -D"..key.."="..value
end
local function dev_with (obj, flag)
local status = "OFF"
if rpm.expand("%{with "..obj.."}") then
status = "ON"
end
return " -D"..flag.."="..status
end
local cmd = 'cmake'
if rpm_check_string({'%el4', '%el5', '%el6'}) then
cmd = 'cmake28'
end
cmd = cmd .. ' . '
.. cmake_key_value('CMAKE_BUILD_TYPE', '%{_build_type}')
.. cmake_key_value('ENABLE_BACKTRACE', 'ON')
.. cmake_key_value('CMAKE_INSTALL_PREFIX', '%{_prefix}')
.. cmake_key_value('CMAKE_INSTALL_SYSCONFDIR', '%{?scl:%_root_sysconfdir}%{!?scl:%_sysconfdir}')
.. cmake_key_value('CMAKE_INSTALL_BINDIR', '%{_bindir}')
.. cmake_key_value('CMAKE_INSTALL_LIBDIR', '%{_libdir}')
.. cmake_key_value('CMAKE_INSTALL_LIBEXECDIR', '%{_libexecdir}')
.. cmake_key_value('CMAKE_INSTALL_SBINDIR', '%{_sbindir}')
.. cmake_key_value('CMAKE_INSTALL_SHAREDSTATEDIR', '%{_sharedstatedir}')
.. cmake_key_value('CMAKE_INSTALL_DATADIR', '%{_datadir}')
.. cmake_key_value('CMAKE_INSTALL_INCLUDEDIR', '%{_includedir}')
.. cmake_key_value('CMAKE_INSTALL_INFODIR', '%{_infodir}')
.. cmake_key_value('CMAKE_INSTALL_MANDIR', '%{_mandir}')
.. cmake_key_value('CMAKE_INSTALL_LOCALSTATEDIR', '%{_localstatedir}')
.. ' %{?scl:-DRPM_SCL_PREFIX=%scl}'
.. ' %{!?scl:-DENABLE_RPM=ON}'
.. dev_with('client', 'ENABLE_CLIENT')
.. dev_with('postgresql', 'WITH_POSTGRESQL')
.. dev_with('mysql', 'WITH_MYSQL')
print(wrap_with_toolset(cmd))
print(wrap_with_toolset('make %{?_smp_mflags}\n'))
}
%install
make DESTDIR=%{buildroot} install
%post
groupadd tarantool > /dev/null 2>&1
useradd -r -g tarantool tarantool > /dev/null 2>&1
# Performe a single instance setup
/usr/bin/tarantool_deploy.sh --yes --quiet 1.1
%preun
%files
%defattr(-,root,root,-)
%dir "%{_datadir}/tarantool"
"%{_datadir}/tarantool/00000000000000000001.snap"
%dir "%{_datadir}/doc/tarantool"
"%{_datadir}/doc/tarantool/README.md"
"%{_datadir}/doc/tarantool/LICENSE"
"%{_datadir}/doc/tarantool/box-protocol.txt"
"%{_mandir}/man1/tarantool.1.gz"
"%{_bindir}/tarantool"
"%{_bindir}/tarantool_multi.sh"
"%{_bindir}/tarantool_deploy.sh"
%{!?scl: "%{_sysconfdir}/init.d/tarantool"}
%files sql-module
%defattr(-,root,root,-)
%dir "%{_datadir}/tarantool"
%dir "%{_datadir}/tarantool/box"
%dir "%{_datadir}/tarantool/box/net"
"%{_datadir}/tarantool/box/net/sql.lua"
%if %{with postgresql}
%files pg-module
%defattr(-,root,root,-)
%dir "%{_libdir}/tarantool/"
%dir "%{_libdir}/tarantool/box"
"%{_libdir}/tarantool/box/net/pg.so"
%endif
%if %{with mysql}
%files mysql-module
%defattr(-,root,root,-)
%dir "%{_libdir}/tarantool"
%dir "%{_libdir}/tarantool/box"
"%{_libdir}/tarantool/box/net/mysql.so"
%endif
%files dev
%defattr(-,root,root,-)
%dir "%{_includedir}/tarantool"
%dir "%{_includedir}/tarantool"
"%{_includedir}/tarantool/config.h"
"%{_includedir}/tarantool/lauxlib.h"
"%{_includedir}/tarantool/luaconf.h"
"%{_includedir}/tarantool/lua.h"
"%{_includedir}/tarantool/lua.hpp"
"%{_includedir}/tarantool/luajit.h"
"%{_includedir}/tarantool/lualib.h"
%changelog
* Fri Jun 06 2014 Eugine Blikh <bigbes@tarantool.org> 1.0-2
- Add SCL support
- Add flags support
- Add some dependencies
* Mon May 20 2013 Dmitry Simonenko <support@tarantool.org> 1.0-1
- Initial version of the RPM spec
......@@ -41,6 +41,10 @@ int
tarantool_lua_cjson_init(struct lua_State *L)
{
luaopen_cjson(L);
/* Add NULL constant */
lua_pushlightuserdata(L, NULL);
lua_setfield(L, -2, "NULL");
/* Register module */
lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
lua_pushstring(L, jsonlib_name); /* add alias */
lua_pushvalue(L, -3);
......
......@@ -417,5 +417,9 @@ luaopen_msgpack(lua_State *L)
};
luaL_register_module(L, "msgpack", msgpacklib);
/* Add NULL constant */
luaL_loadstring(L, "return require('ffi').cast('void *', 0)");
lua_call(L, 0, 1);
lua_setfield(L, -2, "NULL");
return 1;
}
......@@ -39,6 +39,12 @@ int
tarantool_lua_yaml_init(struct lua_State *L)
{
luaopen_yaml(L);
/* Fix buggy null() function and add NULL constant */
luaL_loadstring(L, "return require('ffi').cast('void *', 0)");
lua_pushvalue(L, -1);
lua_setfield(L, -3, "null");
lua_call(L, 0, 1);
lua_setfield(L, -2, "NULL");
lua_pop(L, 1); /* yaml module */
/* Remove global variable */
lua_pushnil(L);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment