From a738021b6297c331fb6a9922c893b05d8f689213 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 14 Sep 2023 15:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0nodejs=E7=9A=84=E6=89=93?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bun/package.sh | 4 +- dingtalk/package.sh | 1 + fcitx5-skin-plain/package.sh | 1 + linuxqq/package.sh | 1 + neovim/package.sh | 1 + nodejs/package-current.sh | 94 ++++++++++++++++++++++++++++++++++++ nodejs/package-lts.sh | 94 ++++++++++++++++++++++++++++++++++++ zellij/package.sh | 1 + 8 files changed, 194 insertions(+), 3 deletions(-) create mode 100755 nodejs/package-current.sh create mode 100755 nodejs/package-lts.sh diff --git a/bun/package.sh b/bun/package.sh index d112a1d..a9cebd3 100755 --- a/bun/package.sh +++ b/bun/package.sh @@ -11,9 +11,7 @@ if [ "$1" == "arm" ]; then pkg_arch="aarch64" deb_arch="arm64" fi -echo $1 -echo $pkg_arch, $deb_arch -# exit 0 + deb_url="https://github.com/oven-sh/bun/releases/download/bun-${release}/bun-linux-${pkg_arch}.zip" diff --git a/dingtalk/package.sh b/dingtalk/package.sh index 6482740..2457d27 100755 --- a/dingtalk/package.sh +++ b/dingtalk/package.sh @@ -126,4 +126,5 @@ sudo chown -R root:root unpack dpkg-deb -b ./unpack "./${app_name}_${version}.deb" +sudo rm -rf ./unpack echo "打包完成 :)" diff --git a/fcitx5-skin-plain/package.sh b/fcitx5-skin-plain/package.sh index b731f0d..5db0717 100755 --- a/fcitx5-skin-plain/package.sh +++ b/fcitx5-skin-plain/package.sh @@ -68,4 +68,5 @@ sudo chown -R root:root unpack dpkg-deb -b ./unpack "./${app_name}_${version}.deb" +sudo rm -rf ./unpack echo "打包完成 :)" diff --git a/linuxqq/package.sh b/linuxqq/package.sh index 71a7f27..f2e825e 100755 --- a/linuxqq/package.sh +++ b/linuxqq/package.sh @@ -145,4 +145,5 @@ sudo chown -R root:root unpack dpkg-deb -b ./unpack "./${app_name}_${version}.deb" +sudo rm -rf ./unpack echo "打包完成 :)" diff --git a/neovim/package.sh b/neovim/package.sh index bbc5816..2711837 100755 --- a/neovim/package.sh +++ b/neovim/package.sh @@ -79,4 +79,5 @@ sudo chown -R root:root unpack dpkg-deb -b ./unpack "./${app_name}_${version}.deb" +sudo rm -rf ./unpack echo "打包完成 :)" \ No newline at end of file diff --git a/nodejs/package-current.sh b/nodejs/package-current.sh new file mode 100755 index 0000000..6714144 --- /dev/null +++ b/nodejs/package-current.sh @@ -0,0 +1,94 @@ +#!/bin/bash + +app_name="nodejs-current" +tmp_dir="/tmp/${app_name}_tmp" +version="20.6.1" +release="v${version}" +pkg_arch="x64" +deb_arch="amd64" + +if [ "$1" == "arm" ]; then + pkg_arch="arm64" + deb_arch="arm64" +fi + + +deb_url="http://mirrors.ustc.edu.cn/node/latest-v20.x/node-${release}-linux-${pkg_arch}.tar.xz" + +# 创建临时目录, 用于下载官方包 +if [ -d $tmp_dir ]; then + rm -rf $tmp_dir +fi + +if [ -d "./unpack" ]; then + sudo rm -rf ./unpack +fi + +if [ -f "./${app_name}_${version}.deb" ]; then + rm "./${app_name}_${version}.deb" +fi + +mkdir $tmp_dir + +# 创建临时待打包目录 +echo "创建待打包目录..." +mkdir -p "./unpack/DEBIAN" +mkdir -p "./unpack/usr" + +echo "下载官方原包..." +wget $deb_url -O "${tmp_dir}/${app_name}-${pkg_arch}.tar.xz" + + +echo "下载完成, 解包中..." +tar -xf "${tmp_dir}/${app_name}-${pkg_arch}.tar.xz" -C $tmp_dir + + +echo "解包完成, 复制到待打包目录..." +mv ${tmp_dir}/node-${release}-linux-${pkg_arch}/* "./unpack/usr/" + +rm -rf $tmp_dir + +echo "复制完成, 计算文件md5..." + +cd ./unpack + +find usr/ -type f | xargs md5sum > DEBIAN/md5sums + +IFS=$'\t' read -ra size <<< "$(du -d 0)" + +echo """ +Package: ${app_name} +Version: ${version} +Section: devlop +Installed-Size: ${size[0]} +Architecture: ${deb_arch} +Maintainer: Yutent +Priority: optional +Depends: libc6 (>= 2.28), libgcc1 (>= 1:3.4), libstdc++6 (>= 5.2), python3-minimal, ca-certificates +Breaks: nodejs, nodejs-lts, npm +Replaces: nodejs, nodejs-lts, npm +Provides: nodejs, npm +Homepage: https://nodejs.org +Description: Node.js event-based server-side javascript engine + Node.js is similar in design to and influenced by systems like + Ruby's Event Machine or Python's Twisted. + . + It takes the event model a bit further - it presents the event + loop as a language construct instead of as a library. + . + Node.js is bundled with several useful libraries to handle server tasks : + System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX, + HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings. + + +""" > DEBIAN/control + +echo '计算文件md5完成, 打包中...' + +cd .. +sudo chown -R root:root unpack + +dpkg-deb -b ./unpack "./${app_name}-${deb_arch}_${version}.deb" + +sudo rm -rf ./unpack +echo "打包完成 :)" diff --git a/nodejs/package-lts.sh b/nodejs/package-lts.sh new file mode 100755 index 0000000..63ce86a --- /dev/null +++ b/nodejs/package-lts.sh @@ -0,0 +1,94 @@ +#!/bin/bash + +app_name="nodejs-lts" +tmp_dir="/tmp/${app_name}_tmp" +version="18.17.1" +release="v${version}" +pkg_arch="x64" +deb_arch="amd64" + +if [ "$1" == "arm" ]; then + pkg_arch="arm64" + deb_arch="arm64" +fi + + +deb_url="http://mirrors.ustc.edu.cn/node/latest-v18.x/node-${release}-linux-${pkg_arch}.tar.xz" + +# 创建临时目录, 用于下载官方包 +if [ -d $tmp_dir ]; then + rm -rf $tmp_dir +fi + +if [ -d "./unpack" ]; then + sudo rm -rf ./unpack +fi + +if [ -f "./${app_name}_${version}.deb" ]; then + rm "./${app_name}_${version}.deb" +fi + +mkdir $tmp_dir + +# 创建临时待打包目录 +echo "创建待打包目录..." +mkdir -p "./unpack/DEBIAN" +mkdir -p "./unpack/usr" + +echo "下载官方原包..." +wget $deb_url -O "${tmp_dir}/${app_name}-${pkg_arch}.tar.xz" + + +echo "下载完成, 解包中..." +tar -xf "${tmp_dir}/${app_name}-${pkg_arch}.tar.xz" -C $tmp_dir + + +echo "解包完成, 复制到待打包目录..." +mv ${tmp_dir}/node-${release}-linux-${pkg_arch}/* "./unpack/usr/" + +rm -rf $tmp_dir + +echo "复制完成, 计算文件md5..." + +cd ./unpack + +find usr/ -type f | xargs md5sum > DEBIAN/md5sums + +IFS=$'\t' read -ra size <<< "$(du -d 0)" + +echo """ +Package: ${app_name} +Version: ${version} +Section: devlop +Installed-Size: ${size[0]} +Architecture: ${deb_arch} +Maintainer: Yutent +Priority: optional +Depends: libc6 (>= 2.28), libgcc1 (>= 1:3.4), libstdc++6 (>= 5.2), python3-minimal, ca-certificates +Breaks: nodejs, nodejs-current, npm +Replaces: nodejs, nodejs-current, npm +Provides: nodejs, npm +Homepage: https://nodejs.org +Description: Node.js event-based server-side javascript engine + Node.js is similar in design to and influenced by systems like + Ruby's Event Machine or Python's Twisted. + . + It takes the event model a bit further - it presents the event + loop as a language construct instead of as a library. + . + Node.js is bundled with several useful libraries to handle server tasks : + System, Events, Standard I/O, Modules, Timers, Child Processes, POSIX, + HTTP, Multipart Parsing, TCP, DNS, Assert, Path, URL, Query Strings. + + +""" > DEBIAN/control + +echo '计算文件md5完成, 打包中...' + +cd .. +sudo chown -R root:root unpack + +dpkg-deb -b ./unpack "./${app_name}-${deb_arch}_${version}.deb" + +sudo rm -rf ./unpack +echo "打包完成 :)" diff --git a/zellij/package.sh b/zellij/package.sh index aa34a6a..edeb8ea 100755 --- a/zellij/package.sh +++ b/zellij/package.sh @@ -82,4 +82,5 @@ sudo chown -R root:root unpack dpkg-deb -b ./unpack "./${app_name}_${version}.deb" +sudo rm -rf ./unpack echo "打包完成 :)"