Skip to content

Commit

Permalink
Merge branch support_obstack into master
Browse files Browse the repository at this point in the history
Title: add elfutils into ob-deps 

add elfutils into ob-deps
Link: https://code.alibaba-inc.com/oceanbase-ce-publish/ob-deps/codereview/17373472
  • Loading branch information
xf375358 committed Jul 4, 2024
2 parents f3c98ee + b3b27be commit f02fb4b
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
15 changes: 15 additions & 0 deletions rpm/devdeps-elfutils-libelf-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"devdeps-elfutils-libelf"}
VERSION=${3:-"1.0.2"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/elfutils-*.*[tar|gz|bz2|xz|zip]$"` ]]; then
echo "Download source code"
wget https://mirrors.aliyun.com/blfs/conglomeration/elfutils/elfutils-0.163.tar.bz2 -O $ROOT_DIR/elfutils-0.163.tar.bz2 --no-check-certificate
fi

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
94 changes: 94 additions & 0 deletions rpm/devdeps-elfutils-libelf.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
##############################################################
# http://baike.corp.taobao.com/index.php/%E6%B7%98%E5%AE%9Drpm%E6%89%93%E5%8C%85%E8%A7%84%E8%8C%83 #
# http://www.rpm.org/max-rpm/ch-rpm-inside.html #
##############################################################
Name: devdeps-elfutils-libelf
Version:1.0.2
Release: %(echo $RELEASE)%{?dist}
# if you want use the parameter of rpm_create on build time,
# uncomment below
Summary: elfutils-libelf-devel lets you read, modify or create ELF files in an architecture-independent way
Group: alibaba/application
License: Commercial
%define _prefix /usr/local/oceanbase/deps/devel
%define _src elfutils-0.163
#%define debug_package %{nil}
#%define __strip $OLDPWD/rpm/strip
#%define __strip /usr/bin/strip
%define __strip /bin/true
%global _find_debuginfo_opts -s



# uncomment below, if your building depend on other packages

#BuildRequires: package_name = 1.0.0

# uncomment below, if depend on other packages

#Requires: package_name = 1.0.0


%description
# if you want publish current svn URL or Revision use these macros
elfutils-libelf-devel lets you read, modify or create ELF files in an architecture-independent way
CodeUrl:%{_source_path}
CodeRev:%{_source_revision}

#%debug_package
# support debuginfo package, to reduce runtime package size

# prepare your files
%install
# OLDPWD is the dir of rpm_create running
# _prefix is an inner var of rpmbuild,
# can set by rpm_create, default is "/home/a"
# _lib is an inner var, maybe "lib" or "lib64" depend on OS
#export PATH=/usr/local/gcc-5.2.0/bin:$PATH
mkdir -p $RPM_BUILD_ROOT/%{_prefix}
cd $OLDPWD/..
rm -rf %{_src}
tar xf %{_src}.tar.bz2
cd %{_src}
./configure
cd libelf
make %{_smp_mflags};
mkdir -p tmp
make install DESTDIR=$(pwd)/tmp
mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/lib/
mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/include/
cp tmp/usr/local/lib/*.a ${RPM_BUILD_ROOT}/%{_prefix}/lib/
cp $(pwd)/libelf_pic.a ${RPM_BUILD_ROOT}/%{_prefix}/lib/
cp tmp/usr/local/lib/*.so ${RPM_BUILD_ROOT}%{_prefix}/lib/
cp tmp/usr/local/include/*.h ${RPM_BUILD_ROOT}%{_prefix}/include/

# package infomation
%files
# set file attribute here
%defattr(-,root,root)
# need not list every file here, keep it as this
%{_prefix}
## create an empy dir

# %dir %{_prefix}/var/log

## need bakup old config file, so indicate here

# %config %{_prefix}/etc/sample.conf

## or need keep old config file, so indicate with "noreplace"

# %config(noreplace) %{_prefix}/etc/sample.conf

## indicate the dir for crontab

# %attr(644,root,root) %{_crondir}/*

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
* Thu Jul 4 2024 wangzelin.wzl
- add spec to ob-deps
* Wed Nov 18 2020 nijia.nj
- add spec of ob-elfutils-libelf
3 changes: 2 additions & 1 deletion rpm/obdevtools-binutils.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cd $OLDPWD/../
rm -rf %{_src}
tar xf %{_src}.tar.bz2
cd %{_src}
./configure --prefix=${RPM_BUILD_ROOT}/%{_prefix}
./configure --prefix=${RPM_BUILD_ROOT}/%{_prefix} --enable-install-libiberty --enable-host-shared --with-pic
CPU_CORES=`grep -c ^processor /proc/cpuinfo`
make -j${CPU_CORES};

Expand All @@ -36,6 +36,7 @@ make -j${CPU_CORES};
mkdir -p $RPM_BUILD_ROOT/%{_prefix}
cd $OLDPWD/../%{_src}
make install
cp libiberty/pic/libiberty.a ${RPM_BUILD_ROOT}%{_prefix}/lib/

%files

Expand Down

0 comments on commit f02fb4b

Please sign in to comment.