ipmctl/mkSafeC

49 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/bin/bash
[ -r CMakeLists.txt ]
perl -pi.00 -e '
s<(\$\{CMAKE_THREAD_LIBS_INIT\})><PUBLIC $1>;
if (!$f) {
$f=1 if (s<(\$\{LIBSAFEC)(_LIBRARIES)><PRIVATE ${1}_LDFLAGS\} ${1}_STATIC${2}>);
}
s[(CMAKE_INSTALL_)DATAROOT(DIR\})/ipmctl][${1}SYSCONF${2}];
$_ .= " RENAME ipmctl\n" if (m{/logrotate\.d});
' CMakeLists.txt
#diff -u CMakeLists.txt{.00,} || sleep 2
perl -pi.00 -e 's{/usr/share/ipmctl}{/etc}' src/os/ini/ini.c
#diff -u src/os/ini/ini.c{.00,} || sleep 4
CONTRIB=$PWD/contrib
if [ -d $CONTRIB/include ]; then
cd $CONTRIB/src/libsafec*
LSC=${PWD##*/}
cp -p COPYING $CONTRIB/COPYING.$LSC
sleep 2
exit 0
fi
mkdir -p contrib/src/patches/libsafec
mv libsafec* contrib/src
[ -z "$1" ] || tar xvfC "$1" contrib/src/patches/libsafec
cd contrib/src/libsafec*
for p in ../patches/libsafec/*.patch; do
patch -p1 < $p
done
autoreconf -Wall --install
./configure --disable-shared \
--enable-static --enable-strmax=0x8000 \
--prefix=$CONTRIB \
CFLAGS="$RPM_OPT_FLAGS -fPIC -DHAVE_C99"
make $2
make install
LSC=${PWD##*/}
cp -p COPYING $CONTRIB/COPYING.$LSC
[ -d $CONTRIB/include/libsafec ] || exit 1
cd $CONTRIB/..
tar cf /tmp/libsafec-prebuild.tar contrib