5 Star 0 Fork 1

OpenCloudOS Stream/file

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
file.spec 4.34 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2023-09-19 11:52 . Rebuilt for python 3.11
%define __python3 /usr/bin/python3
%define py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
%define python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
Summary: A command-line tool that tells you in words what kind of data a file contains
Name: file
Version: 5.45
Release: 3%{?dist}
License: BSD
URL: https://www.darwinsys.com/file/
Source0: http://ftp.astron.com/pub/file/file-%{version}.tar.gz
# support local-magic in /etc/magic
Patch3000: file-localmagic.patch
BuildRequires: zlib-devel autoconf automake libtool make python3-devel python3-setuptools
Requires: file-libs = %{version}-%{release}
%description
The file command is a standard program of Unix and Unix-like operating
systems for recognizing the type of data contained in a computer file.
%package libs
Summary: Libraries for applications using libmagic
License: BSD
%description libs
Libraries for applications using libmagic.
%package devel
Summary: Libraries and header files for file development
Requires: file-libs = %{version}-%{release}
%description devel
The file-devel package contains the header files and libmagic library
necessary for developing programs using libmagic.
%package static
Summary: Static library for file development
Requires: file-devel = %{version}-%{release}
%description static
The file-static package contains the static version of the libmagic library.
%package -n python3-file-magic
Summary: Python 3 bindings for the libmagic API
BuildArch: noarch
Requires: file-libs = %{version}-%{release}
Provides: python3-magic = %{version}-%{release}
Obsoletes: python3-magic < %{version}-%{release}
Conflicts: python3-magic < %{version}-%{release}
%description -n python3-file-magic
This package contains the Python 3 bindings to allow access to the
libmagic API. The libmagic library is also used by the familiar
file(1) command.
%prep
%autosetup -p1
rm -rf %{py3dir}
cp -a python %{py3dir}
%build
autoreconf -fi
CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \
%configure --enable-fsect-man5 --disable-rpath --enable-static
# remove hardcoded library paths from local libtool
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
export LD_LIBRARY_PATH=$PWD/src/.libs
make -O %{?_smp_mflags} V=1 VERBOSE=1
cd %{py3dir}
CFLAGS="%{optflags}" %{__python3} setup.py build
%install
cd ${RPM_BUILD_ROOT}
mkdir -p .%{_bindir} .%{_mandir}/man1 .%{_mandir}/man5 .%{_datadir}/misc .%{_datadir}/file .%{_sysconfdir}
cd -
%make_install
rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
# local magic in /etc/magic
cp -a ./magic/magic.local ${RPM_BUILD_ROOT}%{_sysconfdir}/magic
cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
cd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%check
export LD_LIBRARY_PATH=$PWD/src/.libs
make -C tests check
%files
%license COPYING
%doc ChangeLog
%{_bindir}/*
%{_mandir}/man1/*
%config(noreplace) %{_sysconfdir}/magic
%files libs
%license COPYING
%doc ChangeLog
%{_libdir}/*so.*
%{_datadir}/magic*
%{_mandir}/man5/*
%{_datadir}/file
%{_datadir}/misc/*
%files devel
%{_libdir}/*.so
%{_includedir}/magic.h
%{_mandir}/man3/*
%{_libdir}/pkgconfig/libmagic.pc
%files static
%{_libdir}/libmagic.a
%files -n python3-file-magic
%license COPYING
%doc python/README.md python/example.py
%{python3_sitelib}/magic.py
%{python3_sitelib}/*egg-info
%{python3_sitelib}/__pycache__/*
%changelog
* Tue Sep 19 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 5.45-3
- Rebuilt for python 3.11
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 5.45-2
- Rebuilt for OpenCloudOS Stream 23.09
* Thu Aug 03 2023 Xiaojie Chen <jackxjchen@tencent.com> - 5.45-1
- Upgrade to upstream version 5.45
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 5.41-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 5.41-2
- Rebuilt for OpenCloudOS Stream 23
* Tue Apr 12 2022 Xun Zhong <victorzhong@tencent.com> - 5.41-1
- Initial build
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/file.git
git@gitee.com:opencloudos-stream/file.git
opencloudos-stream
file
file
master

搜索帮助

Cb406eda 1850385 E526c682 1850385