1 |
### RPM external mongo 2.4.2
|
2 |
|
3 |
Patch: mongo2.4
|
4 |
Source: http://downloads.mongodb.org/src/mongodb-src-r%{realversion}.tar.gz
|
5 |
Requires: scons rotatelogs
|
6 |
|
7 |
Provides: libpcap.so.0.8.3
|
8 |
Provides: libpcap.so.0.8.3()(64bit)
|
9 |
|
10 |
%prep
|
11 |
%setup -n mongodb-src-r%{realversion}
|
12 |
perl -p -i -e 's/-rdynamic//' SConstruct
|
13 |
perl -p -i -e 's/"-mt"/""/' SConstruct
|
14 |
%patch
|
15 |
|
16 |
# scons apparently removes $PATH and $LD_LIBRARY_PATH when invoking
|
17 |
# compiler commands, so force the environment back -- gcc needs it.
|
18 |
# this isn't actually quite enough as scons also forces -L/lib64
|
19 |
# type options straight into command line, with -lstdc++, etc., so
|
20 |
# linking is also likely somewhat broken.
|
21 |
cat > scons-cxx-wrapper << EOFCXX
|
22 |
#!/bin/sh
|
23 |
%if "%{?use_system_gcc:set}" != "set"
|
24 |
. $GCC_ROOT/etc/profile.d/init.sh
|
25 |
%endif
|
26 |
exec c++ \${1+"\$@"}
|
27 |
EOFCXX
|
28 |
chmod 755 scons-cxx-wrapper
|
29 |
|
30 |
cat > scons-cc-wrapper << EOFCC
|
31 |
#!/bin/sh
|
32 |
%if "%{?use_system_gcc:set}" != "set"
|
33 |
. $GCC_ROOT/etc/profile.d/init.sh
|
34 |
%endif
|
35 |
exec cc \${1+"\$@"}
|
36 |
EOFCC
|
37 |
chmod 755 scons-cc-wrapper
|
38 |
|
39 |
%build
|
40 |
case $(uname) in
|
41 |
Darwin ) X64= ;;
|
42 |
* ) X64=--64 ;;
|
43 |
esac
|
44 |
# New mongo2.4.patch enforces scons to use system environment, therefore we
|
45 |
# don't need anymore to pass special wrappers for MongoDB build
|
46 |
#scons %makeprocesses $X64 --cxx=$PWD/scons-cxx-wrapper --cc=$PWD/scons-cc-wrapper --prefix=%i install
|
47 |
|
48 |
scons %makeprocesses $X64 --prefix=%i install
|
49 |
|
50 |
%install
|
51 |
case $(uname) in
|
52 |
Darwin ) X64= ;;
|
53 |
* ) X64=--64 ;;
|
54 |
esac
|
55 |
|
56 |
# Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment.
|
57 |
mkdir -p %i/etc/profile.d
|
58 |
: > %i/etc/profile.d/dependencies-setup.sh
|
59 |
: > %i/etc/profile.d/dependencies-setup.csh
|
60 |
for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do
|
61 |
root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root
|
62 |
if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then
|
63 |
echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
64 |
echo "test X\$$root != X || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
65 |
fi
|
66 |
done
|
67 |
|
68 |
%post
|
69 |
%{relocateConfig}etc/profile.d/dependencies-setup.*sh
|