diff --git a/scripts/package/OpenEuler20.03/codedownload.sh b/scripts/package/OpenEuler20.03/codedownload.sh new file mode 100644 index 0000000000000000000000000000000000000000..216a2398175225e9f9705e57411261ba7ad09a93 --- /dev/null +++ b/scripts/package/OpenEuler20.03/codedownload.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e +CODE_PATH=/home/taishan/hisi_acc +declare -a host_lists=("128.5.160.135" "128.5.160.136" "128.5.160.137" "128.5.160.138" "128.5.160.139" "128.5.160.141" "128.5.160.142" "128.5.160.143" "128.5.160.144") + +function getcode() +{ + if [ -d $CODE_PATH ];then + rm -rf $CODE_PATH + fi + mkdir -p $CODE_PATH + + cd $CODE_PATH + git clone https://gitee.com/kunpengcompute/KAEzip.git + git clone https://gitee.com/kunpengcompute/KAEdriver.git + git clone https://gitee.com/kunpengcompute/KAE.git + +} + +function transcode() +{ + for ((i=0;i<${#host_lists[*]};i++)) + do + scp -r $CODE_PATH root@"${host_lists[i]}":/home/taishan + done +} + +function main() +{ + getcode + if [ $? -ne 0 ];then + exit 1 + fi +# transcode +# if [ $? -ne 0 ];then +# exit 1 +# fi +} + +main $@ +exit $? diff --git a/scripts/package/OpenEuler20.03/kae.spec b/scripts/package/OpenEuler20.03/kae.spec new file mode 100644 index 0000000000000000000000000000000000000000..993ce777c8e0ba481074d2637ee5242983ac8545 --- /dev/null +++ b/scripts/package/OpenEuler20.03/kae.spec @@ -0,0 +1,67 @@ +Name: libkae +Summary: Huawei Kunpeng Accelerator Engine +Version: 1.3.11 +Release: 1%dist +License: Apache-2.0 +Source: %{name}-%{version}.tar.gz +ExclusiveOS: linux +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Prefix: /usr/local/lib/engines-1.1 +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} +Requires: libwd >= %{version} +Autoreq: no +Autoprov: no +Prefix: /usr/local/lib/engines-1.1 + +%description +This package contains the Huawei Kunpeng Accelerator Engine + +%prep +%global debug_package %{nil} +%setup -c -n %{name}-%{version} + +%build +cd KAE +chmod +x configure +./configure +make + +%install +mkdir -p ${RPM_BUILD_ROOT}/usr/local/lib/engines-1.1 +install -b -m -755 KAE/libkae.so.%{version} ${RPM_BUILD_ROOT}/usr/local/lib/engines-1.1 + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(755,root,root) +/usr/local/lib/engines-1.1/libkae.so.%{version} + +%pre +if [ "$1" = "2" ] ; then #2: update + rm -rf $RPM_INSTALL_PREFIX/kae.so > /dev/null 2>&1 || true + rm -rf $RPM_INSTALL_PREFIX/kae.so.0 > /dev/null 2>&1 || true +fi + +%post +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + ln -sf $RPM_INSTALL_PREFIX/libkae.so.%{version} $RPM_INSTALL_PREFIX/kae.so + ln -sf $RPM_INSTALL_PREFIX/libkae.so.%{version} $RPM_INSTALL_PREFIX/kae.so.0 +fi +/sbin/ldconfig + +%preun +if [ "$1" = "0" ] ; then #0: uninstall + rm -rf $RPM_INSTALL_PREFIX/kae.so > /dev/null 2>&1 || true + rm -rf $RPM_INSTALL_PREFIX/kae.so.0 > /dev/null 2>&1 || true + rm -f /var/log/kae.log > /dev/null 2>&1 || true + rm -f /var/log/kae.log.old > /dev/null 2>&1 || true +fi + +%postun +/sbin/ldconfig + +%changelog +* Tue Jan 07 2020 jinbinhua 1.2.7-1 +- First Spec Version Include kunpeng accelerator engine Code diff --git a/scripts/package/OpenEuler20.03/kae_driver.spec b/scripts/package/OpenEuler20.03/kae_driver.spec new file mode 100644 index 0000000000000000000000000000000000000000..54cd98b2da66a68be0b1c2388b62ca54c093e6a6 --- /dev/null +++ b/scripts/package/OpenEuler20.03/kae_driver.spec @@ -0,0 +1,278 @@ +Name: kae_driver +Summary: Kunpeng Accelerator Engine Kernel Driver +Version: 1.3.11 +Release: 1%dist +License: GPL-2.0 +Source: %{name}-%{version}.tar.gz +ExclusiveOS: linux +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} +BuildRequires: gcc, make + +%define kernel_version %(uname -r) +%define kae_driver_path %{_builddir}/%{name}-%{version}/%{name} + +%description +This package contains the Kunpeng Accelerator Engine Kernel Driver + +%package -n uacce +Summary: Unified/User-space-access-intended Accelerator Framework +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} + +%description -n uacce +This package contains the Unified/User-space-access-intended Accelerator Framework. + +%package -n hisi_sec2 +Summary: Huawei Hisilicon SEC Accelerator Driver +Requires: uacce >= %{version}-%{release} +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} + +%description -n hisi_sec2 +This package contains the Huawei Hisilicon SEC Accelerator Driver. + +%package -n hisi_hpre +Summary: Huawei Hisilicon HPRE Accelerator Driver +Requires: uacce >= %{version}-%{release} +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} + +%description -n hisi_hpre +This package contains the Huawei Hisilicon HPRE Accelerator Driver. + +%package -n hisi_zip +Summary: Huawei Hisilicon ZIP Accelerator Driver +Requires: uacce >= %{version}-%{release} +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} + +%description -n hisi_zip +This package contains the Huawei Hisilicon ZIP Accelerator Driver. + +%package -n hisi_rde +Summary: Huawei Hisilicon RDE Accelerator Driver +Requires: uacce >= %{version}-%{release} +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} + +%description -n hisi_rde +This package contains the Huawei Hisilicon RDE Accelerator Driver. + + +%prep +%global debug_package %{nil} + +%setup -c -n %{name}-%{version} + +%build +cd kae_driver +make + +%install +mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +mkdir -p ${RPM_BUILD_ROOT}/etc/modprobe.d +install -b -m -644 %{kae_driver_path}/uacce/uacce.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -b -m -644 %{kae_driver_path}/hisilicon/hisi_qm.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -b -m -644 %{kae_driver_path}/hisilicon/sec2/hisi_sec2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -b -m -644 %{kae_driver_path}/conf/hisi_sec2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_sec2.conf +install -b -m -644 %{kae_driver_path}/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -b -m -644 %{kae_driver_path}/conf/hisi_hpre.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_hpre.conf +install -b -m -644 %{kae_driver_path}/hisilicon/zip/hisi_zip.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -b -m -644 %{kae_driver_path}/conf/hisi_zip.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_zip.conf +install -b -m -644 %{kae_driver_path}/hisilicon/rde/hisi_rde.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -b -m -644 %{kae_driver_path}/conf/hisi_rde.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_rde.conf + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%pre -n uacce +echo "checking installed modules" +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + echo "uacce modules start to install" +fi + +%pre -n hisi_sec2 +echo "checking installed modules" +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + echo "hisi_sec2 modules start to install" +fi + +%pre -n hisi_hpre +echo "checking installed modules" +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + echo "hisi_hpre modules start to install" +fi + +%pre -n hisi_zip +echo "checking installed modules" +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + echo "hisi_zip modules start to install" +fi + +%pre -n hisi_rde +echo "checking installed modules" +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + echo "hisi_rde modules start to install" +fi + +%post -n uacce +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/uacce.ko" | /sbin/weak-modules --add-module --no-initramfs + echo "/lib/modules/%{kernel_version}/extra/hisi_qm.ko" | /sbin/weak-modules --add-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "uacce modules installed" + +%post -n hisi_sec2 +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_sec2.ko" | /sbin/weak-modules --add-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_sec2 modules installed" + +%post -n hisi_hpre +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_hpre.ko" | /sbin/weak-modules --add-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_hpre modules installed" + +%post -n hisi_zip +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_zip.ko" | /sbin/weak-modules --add-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_zip modules installed" + +%post -n hisi_rde +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_rde.ko" | /sbin/weak-modules --add-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_rde modules installed" + +%preun -n uacce +if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/uacce.ko" | /sbin/weak-modules --remove-module --no-initramfs + echo "/lib/modules/%{kernel_version}/extra/hisi_qm.ko" | /sbin/weak-modules --remove-module --no-initramfs +fi +/sbin/depmod -a > /dev/null 2>&1 || true +if [ "$1" = "0" ] ; then #0: uninstall + echo "uacce modules uninstalling" +fi + +%preun -n hisi_sec2 +if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_sec2.ko" | /sbin/weak-modules --remove-module --no-initramfs +fi +if [ "$1" = "0" ] ; then #0: uninstall + echo "hisi_sec2 modules uninstalling" +fi + +%preun -n hisi_hpre +if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_hpre.ko" | /sbin/weak-modules --remove-module --no-initramfs +fi +if [ "$1" = "0" ] ; then #0: uninstall + echo "hisi_hpre modules uninstalling" +fi + +%preun -n hisi_zip +if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_zip.ko" | /sbin/weak-modules --remove-module --no-initramfs +fi +if [ "$1" = "0" ] ; then #0: uninstall + echo "hisi_zip modules uninstalling" +fi + +%preun -n hisi_rde +if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_rde.ko" | /sbin/weak-modules --remove-module --no-initramfs +fi +if [ "$1" = "0" ] ; then #0: uninstall + echo "hisi_rde modules uninstalling" +fi + +%postun -n uacce +if [ "$1" = "0" ] ; then #0: uninstall + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "uacce modules uninstalled" + +%postun -n hisi_sec2 +if [ "$1" = "0" ] ; then #0: uninstall + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_sec2.ko" | /sbin/weak-modules --remove-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_sec2 modules uninstalled" + +%postun -n hisi_hpre +if [ "$1" = "0" ] ; then #0: uninstall + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_hpre.ko" | /sbin/weak-modules --remove-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_hpre modules uninstalled" + +%postun -n hisi_zip +if [ "$1" = "0" ]; then #0: uninstall + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_zip.ko" | /sbin/weak-modules --remove-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_zip modules uninstalled" + +%postun -n hisi_rde +if [ "$1" = "0" ] ; then #0: uninstall + if [ -e /sbin/weak-modules ]; then + echo "/lib/modules/%{kernel_version}/extra/hisi_rde.ko" | /sbin/weak-modules --remove-module --no-initramfs + fi + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "hisi_rde modules uninstalled" + +%files -n uacce +%defattr(644,root,root) +/lib/modules/%{kernel_version}/extra/uacce.ko +/lib/modules/%{kernel_version}/extra/hisi_qm.ko + + +%files -n hisi_sec2 +%defattr(644,root,root) +/lib/modules/%{kernel_version}/extra/hisi_sec2.ko +%config(noreplace) /etc/modprobe.d/hisi_sec2.conf + +%files -n hisi_hpre +%defattr(644,root,root) +/lib/modules/%{kernel_version}/extra/hisi_hpre.ko +%config(noreplace) /etc/modprobe.d/hisi_hpre.conf + +%files -n hisi_zip +%defattr(644,root,root) +/lib/modules/%{kernel_version}/extra/hisi_zip.ko +%config(noreplace) /etc/modprobe.d/hisi_zip.conf + +%files -n hisi_rde +%defattr(644,root,root) +/lib/modules/%{kernel_version}/extra/hisi_rde.ko +%config(noreplace) /etc/modprobe.d/hisi_rde.conf + +%changelog +* Tue Jan 07 2020 jinbinhua 1.2.7-1 +- First Spec Version Include all Kunpeng Accelerator Engine Kernel Driver Code diff --git a/scripts/package/OpenEuler20.03/kaezip.spec b/scripts/package/OpenEuler20.03/kaezip.spec new file mode 100644 index 0000000000000000000000000000000000000000..1f6ec6f47a3a6a7867dbdde8957f156ec1a3bff8 --- /dev/null +++ b/scripts/package/OpenEuler20.03/kaezip.spec @@ -0,0 +1,89 @@ +Name: libkaezip +Summary: Huawei Kunpeng Accelerator Engine Zip +Version: 1.3.11 +Release: 1%dist +License: Apache-2.0 +Source: %{name}-%{version}.tar.gz +ExclusiveOS: linux +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} +Requires: libwd >= %{version} +Autoreq: no +Autoprov: no + +%define zlib_version 1.2.11 + +%description +This package contains the Huawei Hisilicon Zip Accelerator Engine. + +%prep +%global debug_package %{nil} +%setup -c -n %{name}-%{version} + +%build +cd KAEzip +sh setup.sh build + +%install +mkdir -p ${RPM_BUILD_ROOT}/usr/local/kaezip/lib +mkdir -p ${RPM_BUILD_ROOT}/usr/local/kaezip/include +mkdir -p ${RPM_BUILD_ROOT}/usr/local/kaezip/lib/pkgconfig +mkdir -p ${RPM_BUILD_ROOT}/usr/local/kaezip/share/man/man3 +install -b -m -755 KAEzip/libkaezip.so.%{version} ${RPM_BUILD_ROOT}/usr/local/kaezip/lib +install -b -m -755 KAEzip/include/kaezip.h ${RPM_BUILD_ROOT}/usr/local/kaezip/include +install -b -m -755 KAEzip/open_source/zlib-%{zlib_version}/libz.so.%{zlib_version} ${RPM_BUILD_ROOT}/usr/local/kaezip/lib +install -b -m -644 KAEzip/open_source/zlib-%{zlib_version}/libz.a ${RPM_BUILD_ROOT}/usr/local/kaezip/lib +install -b -m -644 KAEzip/open_source/zlib-%{zlib_version}/zlib.pc ${RPM_BUILD_ROOT}/usr/local/kaezip/lib/pkgconfig +install -b -m -644 KAEzip/open_source/zlib-%{zlib_version}/zlib.3 ${RPM_BUILD_ROOT}/usr/local/kaezip/share/man/man3 +install -b -m -644 KAEzip/open_source/zlib-%{zlib_version}/zlib.h ${RPM_BUILD_ROOT}/usr/local/kaezip/include +install -b -m -644 KAEzip/open_source/zlib-%{zlib_version}/zconf.h ${RPM_BUILD_ROOT}/usr/local/kaezip/include + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(755,root,root) +/usr/local/kaezip/lib/libkaezip.so.%{version} +/usr/local/kaezip/include/kaezip.h +/usr/local/kaezip/lib/libz.so.%{zlib_version} +%defattr(644,root,root) +/usr/local/kaezip/lib/libz.a +/usr/local/kaezip/lib/pkgconfig/zlib.pc +/usr/local/kaezip/share/man/man3/zlib.3 +/usr/local/kaezip/include/zlib.h +/usr/local/kaezip/include/zconf.h + +%pre +if [ "$1" = "2" ] ; then #2: update + rm -rf /usr/local/kaezip/lib/libkaezip.so > /dev/null 2>&1 || true + rm -rf /usr/local/kaezip/lib/libkaezip.so.0 > /dev/null 2>&1 || true + rm -rf /usr/local/kaezip/lib/libz.so > /dev/null 2>&1 || true + rm -rf /usr/local/kaezip/lib/libz.so.1 > /dev/null 2>&1 || true +fi + +%post +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + ln -sf /usr/local/kaezip/lib/libkaezip.so.%{version} /usr/local/kaezip/lib/libkaezip.so + ln -sf /usr/local/kaezip/lib/libkaezip.so.%{version} /usr/local/kaezip/lib/libkaezip.so.0 + ln -sf /usr/local/kaezip/lib/libz.so.%{zlib_version} /usr/local/kaezip/lib/libz.so + ln -sf /usr/local/kaezip/lib/libz.so.%{zlib_version} /usr/local/kaezip/lib/libz.so.1 +fi +/sbin/ldconfig + +%preun +if [ "$1" = "0" ] ; then #0: uninstall + rm -rf /usr/local/kaezip/lib/libz.so > /dev/null 2>&1 || true + rm -rf /usr/local/kaezip/lib/libz.so.1 > /dev/null 2>&1 || true + rm -rf /usr/local/kaezip/lib/libkaezip.so > /dev/null 2>&1 || true + rm -rf /usr/local/kaezip/lib/libkaezip.so.0 > /dev/null 2>&1 || true + rm -f /var/log/kaezip.log > /dev/null 2>&1 || true + rm -f /var/log/kaezip.log.old > /dev/null 2>&1 || true +fi + +%postun +/sbin/ldconfig + +%changelog +* Tue Jan 07 2020 jinbinhua 1.2.7-1 +- First Spec Version Include kunpeng accelerator engine Code \ No newline at end of file diff --git a/scripts/package/OpenEuler20.03/libwd.spec b/scripts/package/OpenEuler20.03/libwd.spec new file mode 100644 index 0000000000000000000000000000000000000000..c8341ddae7e0481a3a16605c9f53c1b899f7d3fb --- /dev/null +++ b/scripts/package/OpenEuler20.03/libwd.spec @@ -0,0 +1,85 @@ +Name: libwd +Summary: Huawei Accelerator Library +Version: 1.3.11 +Release: 1%dist +License: Apache-2.0 +Source: %{name}-%{version}.tar.gz +ExclusiveOS: linux +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Conflicts: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} +BuildRequires: automake, autoconf, libtool +BuildRequires: gcc, make + +%description +This package contains the Huawei Accelerator Library + +%prep +%global debug_package %{nil} +%setup -c -n %{name}-%{version} + +%build +cd warpdrive +sh autogen.sh +./configure +make + +%install +mkdir -p ${RPM_BUILD_ROOT}/usr/lib64 +install -b -m -755 warpdrive/.libs/libwd.so.%{version} ${RPM_BUILD_ROOT}/usr/lib64 +mkdir -p ${RPM_BUILD_ROOT}/usr/include/warpdrive +mkdir -p ${RPM_BUILD_ROOT}/usr/include/warpdrive/include +cp warpdrive/wd.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/wd_cipher.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/wd_comp.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/wd_dh.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/wd_digest.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/wd_rsa.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/wd_bmm.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/config.h ${RPM_BUILD_ROOT}/usr/include/warpdrive +cp warpdrive/include/uacce.h ${RPM_BUILD_ROOT}/usr/include/warpdrive/include + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(755,root,root) +/usr/lib64/libwd.so.%{version} +%defattr(644,root,root) +/usr/include/warpdrive/wd.h +/usr/include/warpdrive/wd_cipher.h +/usr/include/warpdrive/wd_comp.h +/usr/include/warpdrive/wd_dh.h +/usr/include/warpdrive/wd_digest.h +/usr/include/warpdrive/wd_rsa.h +/usr/include/warpdrive/wd_bmm.h +/usr/include/warpdrive/config.h +/usr/include/warpdrive/include/uacce.h + + +%pre +if [ "$1" = "2" ] ; then #2: update + rm -rf /usr/lib64/libwd.so > /dev/null 2>&1 || true + rm -rf /usr/lib64/libwd.so.1 > /dev/null 2>&1 || true +fi + +%post +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + cd /usr/lib64 + ln -sf libwd.so.%{version} libwd.so + ln -sf libwd.so.%{version} libwd.so.1 +fi +/sbin/ldconfig + +%preun +if [ "$1" = "0" ] ; then #0: uninstall + rm -rf /usr/lib64/libwd.so > /dev/null 2>&1 || true + rm -rf /usr/lib64/libwd.so.1 > /dev/null 2>&1 || true +fi + +%postun +/sbin/ldconfig + +%changelog +* Tue Jan 07 2020 jinbinhua 1.2.7-1 +- First Spec Version Include Warpdrive Code diff --git a/scripts/package/OpenEuler20.03/taishan_spec/build/build.sh b/scripts/package/OpenEuler20.03/taishan_spec/build/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..bedeca19b84890217cd3834af841b0106977153c --- /dev/null +++ b/scripts/package/OpenEuler20.03/taishan_spec/build/build.sh @@ -0,0 +1,71 @@ +#!/bin/bash +set -e +MAKE_PATH=$(pwd) + +OUTPUT_PATH=$MAKE_PATH/../output +SRC_PATH=$MAKE_PATH/../../hisi_acc +KAE_SPEC_PATH="/home/taishan/kae.spec" +VBUILDVERSION=$(cat $KAE_SPEC_PATH | grep 'Version:' | awk '{print substr($0, 15, 7)}') +BUILDVERSION=$(eval echo $VBUILDVERSION) + +ZLIB_PATH="/home/taishan/zlib-1.2.11.tar.gz" +KAEDRIVER_SPEC_PATH="/home/taishan/kae_driver.spec" +WARPDRIVER_SPEC_PATH="/home/taishan/libwd.spec" +KAEZIP_SPEC_PATH="/home/taishan/kaezip.spec" + +if [ $2 == "sles15.1" ];then + RPM_PATH=/usr/src/packages/RPMS/aarch64 +else + RPM_PATH=/root/rpmbuild/RPMS/aarch64 +fi::: + +function build_targets_hisi() +{ + cd $SRC_PATH/KAEdriver + + cp $KAEDRIVER_SPEC_PATH kae_driver + cp $WARPDRIVER_SPEC_PATH warpdrive + + tar -czf $OUTPUT_PATH/kae_driver-"$BUILDVERSION".tar.gz kae_driver + rpmbuild -tb $OUTPUT_PATH/kae_driver-"$BUILDVERSION".tar.gz + tar -czf $OUTPUT_PATH/libwd-"$BUILDVERSION".tar.gz warpdrive + rpmbuild -tb $OUTPUT_PATH/libwd-"$BUILDVERSION".tar.gz + + local rpm_info=$(rpm -qi libwd | grep "$BUILDVERSION") + if [[ -n $rpm_info ]];then + rpm -e libwd + fi + rpm -ivh $RPM_PATH/libwd-"$BUILDVERSION"* + + cd $SRC_PATH + + cp $KAE_SPEC_PATH KAE + cp $KAEZIP_SPEC_PATH KAEzip + + tar -czf $OUTPUT_PATH/libkae-"$BUILDVERSION".tar.gz KAE + rpmbuild -tb $OUTPUT_PATH/libkae-"$BUILDVERSION".tar.gz + cp $ZLIB_PATH ./KAEzip/open_source + tar -czf $OUTPUT_PATH/libkaezip-"$BUILDVERSION".tar.gz KAEzip + rpmbuild -tb $OUTPUT_PATH/libkaezip-"$BUILDVERSION".tar.gz + + cp -f $RPM_PATH/*.rpm $OUTPUT_PATH + rm -rf $RPM_PATH/*.rpm + cd $RPM_PATH/../../BUILD + rm -rf kae_driver* libwd* libkae* + + rpm_info=$(rpm -qi libwd | grep "$BUILDVERSION") + if [[ -n $rpm_info ]];then + rpm -e libwd + fi +} + +function main() +{ + build_targets_hisi + if [ $? -ne 0 ];then + exit 1 + fi +} + +main $@ +exit $? diff --git a/scripts/package/README.md b/scripts/package/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7f7e0dcaeccd64c7b89e2123686ff1a6619d5ed9 --- /dev/null +++ b/scripts/package/README.md @@ -0,0 +1,15 @@ +## 一、OpenEuler20.03 +#### 1.1 准备目录结构以及所需文件 +1. **进入操作系统,在/home下构建出包目录结构** +- 将scripts/package/OpenEuler文件夹复制到操作系统的/home目录下并重命名为taishan +- .spec后缀的文件为出包文件,执行出包的脚本在build目录下 +- output目录下存放打包完成之后的\*.rpm包 +2. **执行codedownload脚本,自动下载kae源码到hisi_acc目录下;或者也可以手动下载源码复制到hisi_acc目录下即可** +3. **需要单独下载zlib-1.2.11.tar.gz包到taishan目录下,官网下载地址:https://www.zlib.net/zlib.html** + +#### 1.2 编译出包 +1. **taishan_spec/build/下面存放编译脚本,此目录执行build.sh脚本编译代码。** +2. **taishan_spec/output/下面存放编译出来的包。** + +## 二、Centos7.6 +- **注意:Centos7.6的出包脚本和流程与OpenEuler20.03的一致,可以参照OpenEuler20.03的步骤和文件** \ No newline at end of file