2024-10-02 11:07:28 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-10-06 06:16:22 +08:00
|
|
|
source ../versions.sh
|
2024-10-02 11:07:28 +08:00
|
|
|
|
|
|
|
GLSOURCES="${LFS}/sources"
|
|
|
|
|
|
|
|
if [ "`whoami`" != "lfs" ]; then
|
|
|
|
myfail "Must run this script as lfs user"
|
|
|
|
fi
|
|
|
|
|
2024-10-08 15:33:13 +08:00
|
|
|
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
|
2024-10-02 11:07:28 +08:00
|
|
|
|
2024-10-04 01:04:58 +08:00
|
|
|
[ -d file-${file_version} ] && rm -rf file-${file_version}
|
|
|
|
|
2024-10-02 11:07:28 +08:00
|
|
|
tar -zxf ${file_tarball}
|
|
|
|
|
|
|
|
cd file-${file_version}
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
pushd build
|
|
|
|
|
|
|
|
../configure --disable-bzlib \
|
|
|
|
--disable-libseccomp \
|
|
|
|
--disable-xzlib \
|
|
|
|
--disable-zlib
|
|
|
|
|
|
|
|
make
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
myfail "Failed building file"
|
|
|
|
fi
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
./configure --prefix=/usr \
|
|
|
|
--host=${LFS_TGT} \
|
|
|
|
--build=$(./config.guess)
|
|
|
|
|
|
|
|
make FILE_COMPILE=$(pwd)/build/src/file
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
myfail "Failed building file"
|
|
|
|
fi
|
|
|
|
|
|
|
|
make DESTDIR=${LFS} install
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2024-10-08 15:33:13 +08:00
|
|
|
myfail "Failed installing file"
|
2024-10-02 11:07:28 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f ${LFS}/usr/lib/libmagic.la
|
|
|
|
|
2024-10-08 15:33:13 +08:00
|
|
|
popd
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
|
|
|
|
pushd ${GLSOURCES}
|
|
|
|
|
|
|
|
rm -rf file-${file_version}
|
|
|
|
|
|
|
|
popd
|