-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加hyperscan rpm包构建脚本 * add hyperscan deps
- Loading branch information
1 parent
b4aba31
commit 785d1fc
Showing
2 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
CUR_DIR=$(dirname $(readlink -f "$0")) | ||
ROOT_DIR=$CUR_DIR/.. | ||
PROJECT_DIR=${1:-"$ROOT_DIR"} | ||
PROJECT_NAME=${2:-"devdeps-hyperscan"} | ||
VERSION=${3:-"5.4.2"} | ||
RELEASE=${4:-"1"} | ||
|
||
# check source code | ||
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/hyperscan-v5.4.2.*[tar|gz|bz2|xz|zip]$"` ]]; then | ||
echo "Download source code" | ||
wget https://codeload.github.com/intel/hyperscan/tar.gz/refs/tags/v5.4.2 -O $ROOT_DIR/hyperscan-5.4.2.tar.gz --no-check-certificate | ||
fi | ||
|
||
# download boost | ||
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/boost_1_84_0.*[tar|gz|bz2|xz|zip]$"` ]]; then | ||
echo "Download boost library" | ||
wget https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz -O $ROOT_DIR/boost_1_84_0.tar.gz --no-check-certificate | ||
fi | ||
|
||
# download ragel | ||
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/rage-7.0.4.*[tar|gz|bz2|xz|zip]$"` ]]; then | ||
echo "Download ragel source code" | ||
wget http://www.colm.net/files/ragel/ragel-6.10.tar.gz -O $ROOT_DIR/ragel-6.10.tar.gz --no-check-certificate | ||
fi | ||
|
||
os_release=`grep -Po '(?<=release )\d' /etc/redhat-release` | ||
arch=`uname -p` | ||
|
||
# build dependenciescd | ||
dep_pkgs=(obdevtools-gcc9-9.3.0-52022092914.el obdevtools-cmake-3.22.1-22022100417.el) | ||
|
||
target_dir_3rd=${PROJECT_DIR}/deps/3rd | ||
pkg_dir=$target_dir_3rd/pkg | ||
mkdir -p $pkg_dir | ||
for dep_pkg in ${dep_pkgs[@]} | ||
do | ||
TEMP=$(mktemp -p "/" -u ".XXXX") | ||
download_base_url="https://mirrors.aliyun.com/oceanbase/development-kit/el" | ||
deps_url=${download_base_url}/${os_release}/${arch} | ||
pkg=${dep_pkg}${os_release}.${arch}.rpm | ||
echo "start to download pkg from "$deps_url | ||
wget $deps_url/$pkg -O $pkg_dir/$TEMP | ||
if [[ $? == 0 ]]; then | ||
mv -f $pkg_dir/$TEMP $pkg_dir/$pkg | ||
fi | ||
(cd $target_dir_3rd && rpm2cpio $pkg_dir/$pkg | cpio -di -u --quiet) | ||
done | ||
|
||
export TOOLS_DIR=$target_dir_3rd/usr/local/oceanbase/devtools | ||
export DEP_DIR=$target_dir_3rd/usr/local/oceanbase/deps/devel | ||
|
||
|
||
cd $CUR_DIR | ||
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
Name: devdeps-hyperscan | ||
Version: 5.4.2 | ||
Release: %(echo $RELEASE)%{?dist} | ||
Summary: This is the repository for the Intel Hyperscan | ||
License: https://github.com/intel/hyperscan/blob/master/LICENSE | ||
AutoReqProv:no | ||
%undefine _missing_build_ids_terminate_build | ||
%define _build_id_links compat | ||
%define _prefix /usr/local/oceanbase/deps/devel | ||
%define _product_prefix hyperscan | ||
%define _src hyperscan-5.4.2 | ||
%define _boost boost_1_84_0 | ||
%define _ragel ragel-6.10 | ||
|
||
|
||
%description | ||
This is the repository for the International Components for Unicode | ||
|
||
%define debug_package %{nil} | ||
# support debuginfo package, to reduce runtime package size | ||
|
||
# prepare your files | ||
%install | ||
# create dirs | ||
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib | ||
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/include/%{_product_prefix} | ||
cd $OLDPWD/../; | ||
|
||
export PATH=$TOOLS_DIR/bin/:$PATH | ||
export CC=$TOOLS_DIR/bin/gcc | ||
export CXX=$TOOLS_DIR/bin/g++ | ||
export LD_LIBRARY_PATH=$TOOLS_DIR/lib64/:$DEP_DIR/lib/ | ||
CPU_CORES=`grep -c ^processor /proc/cpuinfo` | ||
|
||
# prepare boost | ||
rm -rf %{_boost} | ||
tar xf %{_boost}.tar.gz | ||
boost_dir=$(pwd)/%{_boost} | ||
boost_install_dir=${boost_dir}/install | ||
rm -rf ${boost_install_dir} | ||
mkdir -p ${boost_install_dir} | ||
cd ${boost_dir} | ||
./bootstrap.sh --prefix=${boost_install_dir} | ||
./b2 install | ||
|
||
# prepare ragel | ||
cd ../ | ||
rm -rf %{_ragel} | ||
tar xf %{_ragel}.tar.gz | ||
ragel_dir=$(pwd)/%{_ragel} | ||
ragel_install_dir=${ragel_dir}/install | ||
rm -rf ${ragel_install_dir} | ||
mkdir -p ${ragel_install_dir} | ||
cd ${ragel_dir} | ||
./configure --prefix=${ragel_install_dir} | ||
make -j${CPU_CORES} | ||
make install | ||
export PATH=${ragel_install_dir}/bin/:$PATH | ||
|
||
cd ../ | ||
rm -rf %{_src} | ||
tar xf %{_src}.tar.gz | ||
cd %{_src} | ||
source_dir=$(pwd) | ||
tmp_install_dir=${source_dir}/tmp_install_dir | ||
build_dir=${source_dir}/build | ||
rm -rf ${tmp_install_dir} | ||
rm -rf ${build_dir} | ||
mkdir -p ${tmp_install_dir} | ||
mkdir -p ${build_dir} | ||
|
||
# compile and install | ||
cd ${build_dir} | ||
cmake .. -DBOOST_ROOT=${boost_install_dir}/include -DCMAKE_POSITION_INDEPENDENT_CODE=on -DBUILD_STATIC_AND_SHARED=on -DCMAKE_INSTALL_PREFIX=${tmp_install_dir} | ||
make -j${CPU_CORES} | ||
make install | ||
|
||
# install files | ||
cp -r ${tmp_install_dir}/lib64/*.a $RPM_BUILD_ROOT/%{_prefix}/lib | ||
cp -r ${tmp_install_dir}/lib64/*.so.5.4.2 $RPM_BUILD_ROOT/%{_prefix}/lib | ||
cp $RPM_BUILD_ROOT/%{_prefix}/lib/libhs.so.5.4.2 $RPM_BUILD_ROOT/%{_prefix}/lib/libhs.so.5 | ||
cp $RPM_BUILD_ROOT/%{_prefix}/lib/libhs.so.5.4.2 $RPM_BUILD_ROOT/%{_prefix}/lib/libhs.so | ||
cp -r ${tmp_install_dir}/include/* $RPM_BUILD_ROOT/%{_prefix}/include/%{_product_prefix} | ||
|
||
|
||
# package infomation | ||
%files | ||
# set file attribute here | ||
%defattr(-,root,root) | ||
# need not list every file here, keep it as this | ||
%{_prefix} | ||
%exclude %dir %{_prefix} | ||
%exclude %dir %{_prefix}/include | ||
%exclude %dir %{_prefix}/lib | ||
|
||
%post -p /sbin/ldconfig | ||
%postun -p /sbin/ldconfig | ||
|
||
%changelog | ||
* Wed Nov 04 2024 zongmei.zzm | ||
- version v5.4.2 |