Skip to content
Snippets Groups Projects
Commit 9533e4b9 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

build python rpm packages

parent 35dae3eb
No related branches found
No related tags found
No related merge requests found
Showing
with 108 additions and 37 deletions
......@@ -13,7 +13,6 @@ ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
SET(BUILD_SHARED_LIBS OFF)
ENDIF(WIN32)
#TODO: Better way then GLOBAL PROPERTY
IF(WIN32)
find_package(Threads REQUIRED)
......
......@@ -42,6 +42,19 @@ set(TEST_LIBRARIES "${TARGET_NAME}")
gtest(${TARGET_NAME} "${TEST_SOURCE_FILES}" "${TEST_LIBRARIES}")
install(TARGETS ${TARGET_NAME} DESTINATION lib)
set(CPACK_PACKAGE_VERSION ${ASAPO_VERSION})
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_NAME "asapo_consumer")
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_CONTACT "IT")
set(CPACK_PACKAGE_VENDOR "DESY")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
include(CPack)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/consumer.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/consumer.spec" @ONLY IMMEDIATE)
set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/my_project.spec")
install(TARGETS ${TARGET_NAME} DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)
Buildroot: @CMAKE_CURRENT_BINARY_DIR@/_CPack_Packages/Linux/RPM/@CPACK_PACKAGE_FILE_NAME@
Summary: Asapo Consumer
Name: @CPACK_PACKAGE_NAME@
Version: @CPACK_PACKAGE_VERSION@
Release: @CPACK_PACKAGE_RELEASE@
License: MIT
Group: Development/Tools/Other
Vendor: @CPACK_PACKAGE_VENDOR@
Prefix: @CPACK_PACKAGING_INSTALL_PREFIX@
#Requires: opencv >= 2.4
%define _rpmdir @CMAKE_CURRENT_BINARY_DIR@/_CPack_Packages/Linux/RPM
%define _rpmfilename @CPACK_PACKAGE_FILE_NAME@.rpm
%define _unpackaged_files_terminate_build 0
%define _topdir @CMAKE_CURRENT_BINARY_DIR@/_CPack_Packages/Linux/RPM
%description
Cool project solving the problems of many colleagues.
# This is a shortcutted spec file generated by CMake RPM generator
# we skip _install step because CPack does that for us.
# We do only save CPack installed tree in _prepr
# and then restore it in build.
%prep
mv $RPM_BUILD_ROOT @CMAKE_CURRENT_BINARY_DIR@/_CPack_Packages/Linux/RPM/tmpBBroot
%install
if [ -e $RPM_BUILD_ROOT ];
then
rm -Rf $RPM_BUILD_ROOT
fi
mv "@CMAKE_CURRENT_BINARY_DIR@/_CPack_Packages/Linux/RPM/tmpBBroot" $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
@CPACK_PACKAGING_INSTALL_PREFIX@/@LIB_INSTALL_DIR@/*
@CPACK_PACKAGING_INSTALL_PREFIX@/bin/my_project
......@@ -6,6 +6,14 @@ ADD_CUSTOM_TARGET(python-dist ALL
COMMAND ${Python_EXECUTABLE} setup.py sdist
)
ADD_CUSTOM_TARGET(python-rpm
COMMAND PACKAGE_PREFIX=python- python setup.py bdist_rpm
)
ADD_CUSTOM_TARGET(python3-rpm
COMMAND PACKAGE_PREFIX=python3- python3 setup.py bdist_rpm
)
#get_property(ASAPO_CONSUMER_LIB TARGET asapo-consumer PROPERTY LOCATION)
ADD_CUSTOM_TARGET(copy_python_dist ALL
......
from distutils.core import setup
from distutils.core import Extension
import numpy
import os
# TODO 'lib/libcurl.a' seems to have no effect, because there is a libcurl.so file
ext_modules = [
......@@ -13,7 +14,7 @@ ext_modules = [
]
setup(
name ="asapo_consumer",
name = os.environ.get('PACKAGE_PREFIX', '') + "asapo_consumer",
ext_modules = ext_modules,
version = "@PYTHON_ASAPO_VERSION@",
setup_requires=["numpy>=@NUMPY_VERSION@", "cython>=0.28"],
......
from centos:7
ENV GOPATH /tmp
RUN yum update -y && yum install -y cmake g++ golang zlib1g-dev python cython python-numpy python3 cython3 python3-numpy git wget
RUN yum -y install gcc
RUN yum -y install epel-release make
ADD install_curl.sh install_curl.sh
RUN ./install_curl.sh /curl
RUN yum install -y python-pip python3-pip && pip install --upgrade cython && pip3 install --upgrade cython
RUN pip3 install sphinx
ADD build.sh /bin/build.sh
RUN yum -y install gcc-c++
ADD install_cmake.sh install_cmake.sh
RUN ./install_cmake.sh
RUN yum -y install zlib-devel
RUN yum -y install python3-numpy python-numpy
RUN yum -y install numpy
RUN yum -y install python-devel python36-devel
RUN yum -y install glibc-static libstdc++-static
\ No newline at end of file
#!/usr/bin/env bash
docker build -t yakser/asapo-env:centos7.7 .
#docker push yakser/asapo-env:ubuntu16.04
from centos:7.9.2009
RUN yum update -y && yum install -y epel-release make g++ python python3 git wget rpm-build
RUN yum -y install gcc gcc-c++ glibc-static libstdc++-static zlib-devel libcurl-devel python-pip python3-pip python-devel python3-devel numpy python3-numpy
RUN pip install --upgrade pip
RUN pip install cython
RUN pip3 install cython
ADD install_cmake.sh install_cmake.sh
RUN ./install_cmake.sh
ADD install_curl.sh install_curl.sh
RUN ./install_curl.sh /curl
RUN yum -y install autoconf libtool libibverbs librdmacm librdmacm-devel
ADD install_libfabric.sh install_libfabric.sh
RUN ./install_libfabric.sh
ENV GOPATH /tmp
ADD build.sh /bin/build.sh
\ No newline at end of file
......@@ -4,10 +4,8 @@ cd /asapo/build
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DLIBCURL_DIR=/curl \
-DBUILD_PYTHON_DOCS=ON \
-DBUILD_EVENT_MONITOR_PRODUCER=ON \
..
cd consumer && make
cd ../producer && make
cd ../sphinx && make
cd consumer && make && make python-rpm && make python3-rpm
cd ../producer && make && make python-rpm && make python3-rpm
#!/usr/bin/env bash
docker build -t yakser/asapo-env:centos7.9.2009 -f Dockerfile.7.9.2009 .
#!/usr/bin/env bash
wget https://github.com/ofiwg/libfabric/archive/v1.11.0.tar.gz
tar xzf v1.11.0.tar.gz
cd libfabric-1.11.0
./autogen.sh
./configure
make
make install
cd -
rm -rf libfabric-1.11.0
rm v1.11.0.tar.gz
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