-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjemalloc.spec
More file actions
123 lines (100 loc) · 3.59 KB
/
jemalloc.spec
File metadata and controls
123 lines (100 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
# Conditional build:
%bcond_without static_libs # static libraries
Summary: General-purpose scalable concurrent malloc implementation
Summary(pl.UTF-8): Ogólnego przeznaczenia, skalowalna, współbieżna implementacja funkcji malloc
Name: jemalloc
Version: 5.3.1
Release: 1
License: BSD
Group: Libraries
#Source0Download: https://github.com/jemalloc/jemalloc/releases
Source0: https://github.com/jemalloc/jemalloc/releases/download/%{version}/%{name}-%{version}.tar.bz2
# Source0-md5: 2b183326fcff2c087efd7efc0a808ba2
URL: http://jemalloc.net/
BuildRequires: libxslt-progs
BuildRequires: rpmbuild(macros) >= 1.527
BuildRequires: sed >= 4.0
# list from include/jemalloc/internal/jemalloc_internal.h.in
# https://github.com/jemalloc/jemalloc/blob/3.6.0/include/jemalloc/internal/jemalloc_internal.h.in#L239
ExclusiveArch: %{ix86} %{x8664} x32 alpha %{arm} aarch64 hppa ia64 le32 mips or1k ppc riscv s390 s390x sh4 sparcv9 sparc64 tile
# broken for us
# alpha: Missing implementation for 64-bit atomic operations"
# alpha: Missing implementation for 32-bit atomic operations"
ExcludeArch: alpha
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
General-purpose scalable concurrent malloc(3) implementation. This
distribution is the stand-alone "portable" implementation of jemalloc.
%description -l pl.UTF-8
Ogólnego przeznaczenia, skalowalna, współbieżna implementacja funkcji
malloc(3). Ten pakiet zawiera samodzielną "przenośną" implementację
jemalloc.
%package devel
Summary: Development files for jemalloc
Summary(pl.UTF-8): Pliki programistyczne biblioteki jemalloc
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package contains the header files for developing applications
that use jemalloc library.
%description devel -l pl.UTF-8
Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
wykorzystujących bibliotekę jemalloc.
%package static
Summary: Static jemalloc library
Summary(pl.UTF-8): Statyczna biblioteka jemalloc
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description static
Static jemalloc library.
%description static -l pl.UTF-8
Statyczna biblioteka jemalloc.
%prep
%setup -q
# This is truncated during build. Seems interesting to save.
cp -p VERSION version
%{__sed} -i '1s, /usr/bin/env perl,%{__perl},' bin/jeprof.in
%build
# enable GNU+C99 standard (C99 for restrict keyword, GNU for asm)
CFLAGS="%{rpmcflags} -std=gnu99"
%configure \
%{__enable_disable static_libs static} \
--with-jemalloc-prefix=je_
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
# restore
cp -pf version VERSION
# soname improperly made, use fake main name (just use our current version)
%{__mv} $RPM_BUILD_ROOT%{_libdir}/libjemalloc.so.{2,%{version}}
ln -s $(basename $RPM_BUILD_ROOT%{_libdir}/libjemalloc.so.*.*.*) \
$RPM_BUILD_ROOT%{_libdir}/libjemalloc.so.2
# Install this with doc macro instead
%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}/jemalloc.html
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(644,root,root,755)
%doc COPYING README VERSION doc/jemalloc.html
%attr(755,root,root) %{_bindir}/jemalloc.sh
%{_libdir}/libjemalloc.so.*.*.*
%ghost %{_libdir}/libjemalloc.so.2
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/jemalloc-config
%attr(755,root,root) %{_bindir}/jeprof
%{_libdir}/libjemalloc.so
%{_includedir}/jemalloc
%{_pkgconfigdir}/jemalloc.pc
%{_mandir}/man3/jemalloc.3*
%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libjemalloc.a
%{_libdir}/libjemalloc_pic.a
%endif