Skip to content

Commit

Permalink
Move common code to jemalloc.common
Browse files Browse the repository at this point in the history
  • Loading branch information
gartung committed Mar 19, 2023
1 parent a8539f1 commit 7ea1fad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
16 changes: 16 additions & 0 deletions jemalloc-common.file
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@ BuildRequires: autotools

%prep
%setup -n %{n}-%{realversion}

%install
make install
%if "%{n}" != "jemalloc"
# Rename jemalloc libs
mv %{i}/lib/libjemalloc.so.2 %{i}/lib/lib%{n}.so.2
rm %{i}/lib/libjemalloc.so
ln -sf lib%{n}.so.2 %{i}/lib/lib%{n}.so
patchelf --set-soname lib%{n}.so.2 %{i}/lib/lib%{n}.so.2
# Make sure there are no other libs. If there are then we should fail and update the recipe
if [ $(ls %{i}/lib/lib* | grep -v lib%{n}. | wc -l) -gt 0 ] ; then exit 1; fi
%endif

%post
%{relocateConfig}bin/jemalloc.sh
%{relocateConfig}bin/jemalloc-config
10 changes: 0 additions & 10 deletions jemalloc-debug.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,3 @@ XOPTS="--with-lg-hugepage=24"
--enable-fill \
--prefix %{i}

%install
make install
mv %{i}/lib/libjemalloc.so.2 %{i}/lib/libjemalloc-debug.so.2
rm %{i}/lib/libjemalloc.so
ln -sf libjemalloc-debug.so.2 %{i}/lib/libjemalloc-debug.so
patchelf --set-soname libjemalloc-debug.so.2 %{i}/lib/libjemalloc-debug.so.2

%post
%{relocateConfig}bin/jemalloc.sh
%{relocateConfig}bin/jemalloc-config
11 changes: 0 additions & 11 deletions jemalloc-prof.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,3 @@ export LDFLAGS=-L$LIBUNWIND_ROOT/lib
--enable-prof \
--enable-prof-libunwind \
--prefix %{i}

%install
make install
mv %{i}/lib/libjemalloc.so.2 %{i}/lib/libjemalloc-prof.so.2
rm %{i}/lib/libjemalloc.so
ln -sf libjemalloc-prof.so.2 %{i}/lib/libjemalloc-prof.so
patchelf --set-soname libjemalloc-prof.so.2 %{i}/lib/libjemalloc-prof.so.2

%post
%{relocateConfig}bin/jemalloc.sh
%{relocateConfig}bin/jemalloc-config
4 changes: 0 additions & 4 deletions jemalloc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ XOPTS="--with-lg-hugepage=24"
--disable-doc \
--enable-stats \
--prefix %{i}

%post
%{relocateConfig}bin/jemalloc.sh
%{relocateConfig}bin/jemalloc-config

0 comments on commit 7ea1fad

Please sign in to comment.