90 lines
2.7 KiB
Bash
Executable File
90 lines
2.7 KiB
Bash
Executable File
#!/bin/bash
|
||
# Special thank to Shiroko, he give me the insight of coding in proper way
|
||
|
||
################################# Here we import our tools
|
||
source /opt/bashimport/sbs-utils.bashimport
|
||
source /opt/bashimport/sbs-build-helper.bashimport
|
||
|
||
if [ "$1" = "amd64" ] || [ "$1" = "x64" ];then
|
||
ARCH="amd64"
|
||
ARCH_ANOTHERWAY="-amd64"
|
||
ARCH_STORE_PATH="amd64-store"
|
||
elif [ "$1" = "arm64" ] || [ "$1" = "arm" ];then
|
||
ARCH="arm64"
|
||
ARCH_ANOTHERWAY="-aarch64"
|
||
ARCH_STORE_PATH="arm64-store"
|
||
elif [ "$1" = "loong64" ];then
|
||
ARCH="loong64"
|
||
ARCH_ANOTHERWAY="-loong64"
|
||
ARCH_STORE_PATH="loong64-store"
|
||
else
|
||
log.error "Err:Invalid Architecture"
|
||
exit 1
|
||
fi
|
||
|
||
################################# Here we set the configs
|
||
REALPATH=`realpath $0`
|
||
HERE_PATH=`dirname $REALPATH`
|
||
REPO_PATH="${REPO_PATH:-/root/store-dir/}"
|
||
WORKDIR=`mktemp -d`
|
||
|
||
PKG_NAME="zotero"
|
||
APP_NAME="Zotero"
|
||
SOURCE_LIST_FILE="zotero.list"
|
||
GITHUB_REPO=""
|
||
VERSION="" #Here we use other way to get version so do not write here
|
||
TAGS="ubuntu;deepin;uos;debian;community"
|
||
CATAGORY="office" #https://gitee.com/deepin-community-store/spark-store/blob/dev/DOCS/spk-doc.md
|
||
DETAIL="Wikipedia:Zotero是一款自由及开放源代码的文献管理软件,管理书目信息(如作者、标题、出版社、摘要、阅读笔记等)及相关材料(如PDF文件等)。其最著名的特性是作为浏览器插件、在线同步、与文档编辑软件如Microsoft Word、LibreOffice、OpenOffice.org Writer、NeoOffice等集成,可生成文内引用。\n\n更新至7.0.15版本,与官网同步。" # This should be written as json format
|
||
MAINTAINER="Emiliano Heyns <emiliano.heyns@iris-advies.com>"
|
||
HOMEPAGE="https://www.zotero.org/"
|
||
|
||
STORE_APP_PATH="${REPO_PATH}/${ARCH_STORE_PATH}/${CATAGORY}/${PKG_NAME}/"
|
||
################################# Fill the variables below only if you use write_control function
|
||
|
||
SECTION=""
|
||
PRIORITY=""
|
||
DEPENDS=""
|
||
DESCRIPTION_SHORT=""
|
||
DESCRIPTION_LONG=""
|
||
PROVIDES=""
|
||
REPLACES=""
|
||
RECOMMENDS=""
|
||
|
||
|
||
|
||
|
||
function prepare(){
|
||
# aptss_get_update
|
||
PKG_VER_APTSS=`get_version_from_source_list_file ${PKG_NAME}:${ARCH} /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore${ARCH_ANOTHERWAY}.list`
|
||
PKG_VER_UPSTREAM=`get_version_from_source_list_file ${PKG_NAME}:${ARCH} /etc/apt/sources.list.d/${SOURCE_LIST_FILE}`
|
||
compare_version ${PKG_VER_APTSS} ${PKG_VER_UPSTREAM}
|
||
# Compare version will also give the value to $VERSION
|
||
# Now we should have the $VERSION
|
||
if [ -e $VERSION ];then
|
||
log.error "VERSION is empty. This should not happen! exit."
|
||
fi
|
||
}
|
||
|
||
|
||
|
||
|
||
function build(){
|
||
|
||
|
||
|
||
pushd $WORKDIR
|
||
apt download ${PKG_NAME}:${ARCH}=${VERSION}
|
||
PKG_FILE="${PKG_NAME}_${VERSION}_${ARCH}.deb"
|
||
mv -v ${PKG_FILE} ${STORE_APP_PATH}
|
||
popd
|
||
|
||
}
|
||
|
||
|
||
prepare
|
||
build
|
||
write_json $STORE_APP_PATH
|
||
|
||
rm -rf $WORKDIR
|