sentencepiece package init

This commit is contained in:
xiefangqi 2021-09-23 16:34:59 +08:00
parent 2247de301d
commit 7c594b864f
2 changed files with 49 additions and 0 deletions

49
sentencepiece.spec Normal file
View File

@ -0,0 +1,49 @@
Name: sentencepiece
Version: 0.1.92
Release: 1
Summary: An unsupervised text tokenizer and detokenizer
License: Apache-2.0
URL: https://github.com/google/sentencepiece
Source0: https://github.com/google/sentencepiece/archive/v%{version}.tar.gz
BuildRequires: gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf protobuf-devel
BuildRequires: cmake >= 3.14.0
Requires: protobuf-devel protobuf protobuf-compiler
%description
SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation
systems where the vocabulary size is predetermined prior to the neural model training.
%global debug_package %{nil}
%prep
%autosetup -p1 -n %{name}-%{version}
%build
mkdir -p cmake/build
cd cmake/build
cmake ../../ -DCMAKE_CXX_FLAGS="-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-sign-compare"\
-DCMAKE_C_FLAGS="-D_FORTIFY_SOURCE=2"\
-DCMAKE_BUILD_TYPE=Release\
-DSPM_USE_BUILTIN_PROTOBUF=ON\
-DSPM_ENABLE_SHARED=OFF\
-DCMAKE_INSTALL_LIBDIR=%{buildroot}%{_libdir}\
-DCMAKE_INSTALL_BINDIR=%{buildroot}%{_bindir}\
-DCMAKE_INSTALL_INCDIR=%{buildroot}%{_includedir}
make -j24 V=1
cd ../../
%install
cd cmake/build
make install
%files
%defattr(-,root,root)
%{_bindir}/spm_*
%{_libdir}/*.a
%{_libdir}/pkgconfig/*
%{_includedir}/sentencepiece_*.h
%changelog
* Wed Sep 23 2021 xiefangqi <xiefangqi2@huawei.com> - 0.1.92-1
- package init

BIN
v0.1.92.tar.gz Normal file

Binary file not shown.