mirror of
https://gitee.com/amber-ce/amber-ce-bookworm.git
synced 2025-12-16 03:52:05 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9c9f488f5 | |||
| 02a70eb0e7 | |||
| 8d5a07277a | |||
| 12a2c435be | |||
| 798554ab22 | |||
| a284695f80 | |||
| fe19bf6efc | |||
| 4c19bf865a | |||
| af5594cdcb | |||
| 130ff44a29 | |||
| dba6361d29 | |||
| b5f45bbecf | |||
| f3be1f48f6 | |||
| af04000b02 |
@@ -1 +0,0 @@
|
|||||||
cd rpmbuild && rpmbuild -ba SPECS/bookworm-compatibility-mode.spec
|
|
||||||
Binary file not shown.
@@ -1,58 +0,0 @@
|
|||||||
Name: cn.flamescion.bookworm-compatibility-mode
|
|
||||||
Version: 12.4.7
|
|
||||||
Release: 1
|
|
||||||
Summary: A container app packaging and distributing solution.
|
|
||||||
License: unknown
|
|
||||||
URL: https://gitee.com/amber-compatability-environment/bookworm-compatibility-mode
|
|
||||||
Source0: bookworm-compatibility-mode-%{version}.tar.gz
|
|
||||||
|
|
||||||
BuildRequires: debootstrap, dpkg, bash, which, systemd-container
|
|
||||||
Requires: bubblewrap, xdg-desktop-portal, flatpak, zenity, gcc
|
|
||||||
|
|
||||||
%description
|
|
||||||
A container app packaging and distributing solution.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%autosetup -p1 -n bookworm-compatibility-mode-%{version}
|
|
||||||
%global debug_package %{nil}
|
|
||||||
|
|
||||||
%post
|
|
||||||
/opt/apps/%{name}/files/bin/bookworm-init
|
|
||||||
|
|
||||||
%postun
|
|
||||||
if [ "$1" = "0" ] || [ "$1" = "1" ]; then
|
|
||||||
echo "清理卸载残留"
|
|
||||||
rm -rf /opt/apps/%{name}
|
|
||||||
else
|
|
||||||
echo "非卸载,跳过清理"
|
|
||||||
fi
|
|
||||||
|
|
||||||
%install
|
|
||||||
cp -r src/opt %{buildroot}
|
|
||||||
cp -r src/etc %{buildroot}
|
|
||||||
cp -r src/usr %{buildroot}
|
|
||||||
|
|
||||||
pushd %{buildroot}/opt/apps/%{name}/files
|
|
||||||
if [ "%{_target_cpu}" = "aarch64" ]; then
|
|
||||||
bash build-container.sh arm64
|
|
||||||
elif [ "%{_target_cpu}" = "x86_64" ]; then
|
|
||||||
bash build-container.sh amd64
|
|
||||||
else
|
|
||||||
echo "Unsupportable arch!"
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
|
|
||||||
%files
|
|
||||||
%dir /opt/apps/%{name}
|
|
||||||
/opt/apps/%{name}/*
|
|
||||||
/etc/X11/Xsession.d/20ACE-Bookworm
|
|
||||||
/etc/profile.d/ACE-Bookworm.sh
|
|
||||||
%{_bindir}/*
|
|
||||||
%attr(755,root,root) /usr/lib/systemd/user-environment-generators/60-ACE-Bookworm
|
|
||||||
%attr(755,root,root) /usr/share/applications/*
|
|
||||||
/usr/share/icons/*
|
|
||||||
/usr/share/polkit-1/actions/cn.flamescion.ace-uninstaller.policy
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Fri Jan 26 2024 懵仙兔兔 <acgm@qq.com> - 12.4.7-1
|
|
||||||
- First pello package
|
|
||||||
50
README.md
50
README.md
@@ -1,38 +1,10 @@
|
|||||||
# 书虫兼容模式
|
|
||||||
书虫兼容模式,是`琥珀兼容环境(ACE)`的一部分
|
|
||||||
|
|
||||||
琥珀兼容环境是一款基于bubblewrap的容器化应用打包和分发方案。
|
|
||||||
|
|
||||||
书虫兼容模式用极为轻量的容器方案让你可以在几乎任何的Linux发行版上运行一个`Debian 12`容器。在`Appimage`应用无法启动或者打包的时候,使用书虫兼容模式来打包可以让你在使用最新的环境的同时在更多的发行版上运行,是一个很好的选择
|
|
||||||
|
|
||||||
书虫兼容模式让你可以在deepin或UOS上使用Debian 12的应用,为你带来更好的使用体验!
|
|
||||||
|
|
||||||
请使用 `git clone --recurse-submodules` 来获取
|
|
||||||
|
|
||||||
## 构建指南
|
|
||||||
|
|
||||||
### Debian
|
|
||||||
|
|
||||||
先构建容器再打包,容器位置在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
|
|
||||||
|
|
||||||
下面是详细步骤:
|
|
||||||
|
|
||||||
1. 安装依赖:sudo apt-get install arch-test debootstrap libnss-mymachines systemd-container
|
|
||||||
2. 在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`位置进入终端,执行`./build-container.sh amd64`[amd架构,其他架构同理]`
|
|
||||||
3. 等待容器打包完成
|
|
||||||
4. 进入`bookworm-compatibility-mode`目录,执行fakeroot dpkg-deb -b src cn.flamescion.bookworm-compatibility-mode.deb
|
|
||||||
5. 等待打包完成
|
|
||||||
|
|
||||||
### Fedora
|
|
||||||
|
|
||||||
`ACE-rpm`目录下有相关的说明
|
|
||||||
|
|
||||||
### Arch
|
|
||||||
|
|
||||||
https://bbs.spark-app.store/d/1668-xing-huo-ying-yong-shang-dian-on-ace
|
|
||||||
|
|
||||||
# Bookworm compatibility mode
|
# Bookworm compatibility mode
|
||||||
|
|
||||||
|
# [中文](README.zh.md)
|
||||||
|
|
||||||
Bookworm compatibility mode is a part of `Amber Compatability Environment(ACE)`
|
Bookworm compatibility mode is a part of `Amber Compatability Environment(ACE)`
|
||||||
|
|
||||||
Amber Compatability Environment is a container app packaging and distributing solution.
|
Amber Compatability Environment is a container app packaging and distributing solution.
|
||||||
@@ -43,6 +15,18 @@ Bookworm compatibility mode allows you to use Debian 12 applications on deepin o
|
|||||||
|
|
||||||
Please use `git clone --recurse-submodules` to obtain the env
|
Please use `git clone --recurse-submodules` to obtain the env
|
||||||
|
|
||||||
|
|
||||||
|
## Install Guide
|
||||||
|
|
||||||
|
|
||||||
|
### Quick Install (Debian)
|
||||||
|
|
||||||
|
https://bbs.spark-app.store/d/1668-xing-huo-ying-yong-shang-dian-on-ace
|
||||||
|
|
||||||
|
### Manual Install(Debian/Fedora/Arch)
|
||||||
|
|
||||||
|
https://share.shenmo.tech:23333/index.php?share/folder&user=1&sid=kr8z6Fqf
|
||||||
|
|
||||||
## Build Guide
|
## Build Guide
|
||||||
|
|
||||||
### Debian
|
### Debian
|
||||||
@@ -52,14 +36,14 @@ Here are the details:
|
|||||||
1. Install dependencies: sudo apt-get install arch-test debootstrap libnss-mymachines systemd-container
|
1. Install dependencies: sudo apt-get install arch-test debootstrap libnss-mymachines systemd-container
|
||||||
2. Enter the terminal at `src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files` and execute `./build-container.sh amd64`.[for amd,other arch please change]
|
2. Enter the terminal at `src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files` and execute `./build-container.sh amd64`.[for amd,other arch please change]
|
||||||
3. Wait for the container to complete.
|
3. Wait for the container to complete.
|
||||||
4.Get in to `bookworm-compatibility-mode` dir,run`fakeroot dpkg-deb -b src cn.flamescion.bookworm-compatibility-mode.deb
|
4.Get in to `bookworm-compatibility-mode` dir,run`fakeroot dpkg-deb -b src .`
|
||||||
5.Wating for complete.
|
5.Wating for complete.
|
||||||
|
|
||||||
|
|
||||||
### Fedora
|
### Fedora
|
||||||
|
|
||||||
See readme in `ACE-rpm` directory
|
See https://gitee.com/amber-compatability-environment/ace-rpm
|
||||||
|
|
||||||
### Arch
|
### Arch
|
||||||
|
|
||||||
https://bbs.spark-app.store/d/1668-xing-huo-ying-yong-shang-dian-on-ace
|
`yay -S cn.flamescion.bookworm-compatibility-mode`
|
||||||
|
|||||||
46
README.zh.md
Normal file
46
README.zh.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# 书虫兼容模式
|
||||||
|
|
||||||
|
# [English](README.md)
|
||||||
|
|
||||||
|
|
||||||
|
琥珀兼容环境是一款基于bubblewrap的容器化应用打包和分发方案。
|
||||||
|
|
||||||
|
书虫兼容模式用极为轻量的容器方案让你可以在几乎任何的Linux发行版上运行一个`Debian 12`容器。在`Appimage`应用无法启动或者打包的时候,使用书虫兼容模式来打包可以让你在使用最新的环境的同时在更多的发行版上运行,是一个很好的选择
|
||||||
|
|
||||||
|
书虫兼容模式让你可以在deepin或UOS上使用Debian 12的应用,为你带来更好的使用体验!
|
||||||
|
|
||||||
|
请使用 `git clone --recurse-submodules` 来获取
|
||||||
|
|
||||||
|
## 安装指南
|
||||||
|
|
||||||
|
### 快捷安装 (Debian)
|
||||||
|
|
||||||
|
https://bbs.spark-app.store/d/1668-xing-huo-ying-yong-shang-dian-on-ace
|
||||||
|
|
||||||
|
### 手动安装(Debian/Fedora/Arch)
|
||||||
|
|
||||||
|
https://share.shenmo.tech:23333/index.php?share/folder&user=1&sid=kr8z6Fqf
|
||||||
|
|
||||||
|
## 构建指南
|
||||||
|
|
||||||
|
### Debian
|
||||||
|
|
||||||
|
先构建容器再打包,容器位置在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
|
||||||
|
|
||||||
|
下面是详细步骤:
|
||||||
|
|
||||||
|
1. 安装依赖:sudo apt-get install arch-test debootstrap libnss-mymachines systemd-container
|
||||||
|
2. 在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`位置进入终端,执行`./build-container.sh amd64`[amd架构,其他架构同理]`
|
||||||
|
3. 等待容器打包完成
|
||||||
|
4. 进入`bookworm-compatibility-mode`目录,执行`fakeroot dpkg-deb -b src .`
|
||||||
|
5. 等待打包完成
|
||||||
|
|
||||||
|
### Fedora
|
||||||
|
|
||||||
|
请前往 https://gitee.com/amber-compatability-environment/ace-rpm
|
||||||
|
|
||||||
|
### Arch
|
||||||
|
|
||||||
|
`yay -S cn.flamescion.bookworm-compatibility-mode`
|
||||||
|
|
||||||
|
---
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
Package: cn.flamescion.bookworm-compatibility-mode
|
Package: cn.flamescion.bookworm-compatibility-mode
|
||||||
Version: 12.4.8
|
Version: 12.4.9
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: bubblewrap,flatpak,zenity,policykit-1,gcc,systemd
|
Depends: bubblewrap,flatpak,zenity,policykit-1,gcc,systemd
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
curdir=`realpath $0`
|
||||||
|
parent_dir=`dirname $curdir`
|
||||||
|
pparent_dir=`dirname $parent_dir`
|
||||||
|
ppparent_dir=`dirname $pparent_dir`
|
||||||
|
PKGNAME=`basename $ppparent_dir`
|
||||||
|
export PACKAGE_NAME=$PKGNAME
|
||||||
|
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -e $chrootEnvPath/finish.flag ];then
|
||||||
|
|
||||||
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
`dirname $chrootEnvPath`/bin/bookworm-init
|
||||||
|
else
|
||||||
|
pkexec `dirname $chrootEnvPath`/bin/bookworm-init
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||||
|
uid=$(id -u $non_root_user)
|
||||||
|
|
||||||
|
|
||||||
|
bwrap --dev-bind / / \
|
||||||
|
bwrap \
|
||||||
|
--setenv LANG "$LANG" \
|
||||||
|
--setenv LC_COLLATE "$LC_COLLATE" \
|
||||||
|
--setenv LC_CTYPE "$LC_CTYPE" \
|
||||||
|
--setenv LC_MONETARY "$LC_MONETARY" \
|
||||||
|
--setenv LC_MESSAGES "$LC_MESSAGES" \
|
||||||
|
--setenv LC_NUMERIC "$LC_NUMERIC" \
|
||||||
|
--setenv LC_TIME "$LC_TIME" \
|
||||||
|
--setenv LC_ALL "$LC_ALL" \
|
||||||
|
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||||
|
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||||
|
--setenv IS_ACE_ENV "1" \
|
||||||
|
--dev-bind $chrootEnvPath/ / \
|
||||||
|
--dev-bind-try /media /media \
|
||||||
|
--dev-bind-try /tmp /tmp \
|
||||||
|
--dev /dev \
|
||||||
|
--dev-bind-try /dev/dri /dev/dri \
|
||||||
|
--proc /proc \
|
||||||
|
--dev-bind /sys /sys \
|
||||||
|
--dev-bind /run /run \
|
||||||
|
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||||
|
--dev-bind / /host \
|
||||||
|
--ro-bind-try /usr/share/themes /usr/local/share/themes \
|
||||||
|
--ro-bind-try /usr/share/icons /usr/local/share/icons \
|
||||||
|
--ro-bind-try /usr/share/fonts /usr/local/share/fonts \
|
||||||
|
--hostname Amber-CE-Bookworm \
|
||||||
|
--unshare-uts \
|
||||||
|
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
|
||||||
|
--dev-bind-try /home /home \
|
||||||
|
/usr/bin/bwrap "$@"
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +1,43 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
ACE_dir="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
|
# ===== Log =====
|
||||||
|
# log.info xxx
|
||||||
|
# log.warn xxx
|
||||||
|
# log.info xxx
|
||||||
|
# log.debug xxx
|
||||||
|
# 带颜色的echo
|
||||||
|
function log.color_output() {
|
||||||
|
local color=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
echo >&2 -e "\033[${color}m$@\033[0m"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Log is named without prefix "utils." for convenience
|
||||||
|
# Usage: log.log <level> ...content
|
||||||
|
function log.log() {
|
||||||
|
if [[ $# < 2 ]]; then
|
||||||
|
return -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local level=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
case $level in
|
||||||
|
error) log.color_output "0;31" "[ERROR] $@" ;;
|
||||||
|
warn) log.color_output "1;33" "[WARN] $@" ;;
|
||||||
|
info) log.color_output "1;37" "[INFO] $@" ;;
|
||||||
|
debug) log.color_output "1;30" "[DEBUG] $@" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function log.error() { log.log "error" "$@"; }
|
||||||
|
function log.warn() { log.log "warn" $@; }
|
||||||
|
function log.info() { log.log "info" $@; }
|
||||||
|
function log.debug() { log.log "debug" $@; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function do_integrate(){
|
function do_integrate(){
|
||||||
@@ -25,19 +63,25 @@ local file=$1
|
|||||||
chmod +x $file
|
chmod +x $file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "${IS_ACE_ENV}" != "" ];then
|
||||||
|
if [ -e /opt/apps/ ];then
|
||||||
for app_dir in $(ls /opt/apps/); do
|
for app_dir in $(ls /opt/apps/); do
|
||||||
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do
|
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do
|
||||||
do_integrate $file
|
do_integrate $file
|
||||||
|
|
||||||
|
|
||||||
|
done
|
||||||
done
|
done
|
||||||
done
|
else
|
||||||
|
log.warn "No /opt/apps directory. Skip..."
|
||||||
|
fi
|
||||||
|
|
||||||
for file in /usr/share/applications/*.desktop; do
|
for file in /usr/share/applications/*.desktop; do
|
||||||
do_integrate $file
|
do_integrate $file
|
||||||
done
|
done
|
||||||
find "/usr/share/applications/" -xtype l -delete
|
find "/usr/share/applications/" -xtype l -delete
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
log.error "DO NOT run me on host OS"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ else
|
|||||||
log.error "Nope we support debian only now"
|
log.error "Nope we support debian only now"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
${APT_COMMAND} clean
|
||||||
${APT_COMMAND} update
|
${APT_COMMAND} update
|
||||||
|
|
||||||
updatetext=`${APT_COMMAND} update 2>&1`
|
updatetext=`${APT_COMMAND} update 2>&1`
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
host-spawn /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run-bwrap $@
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init
|
|
||||||
Reference in New Issue
Block a user