Compare commits

..

14 Commits

Author SHA1 Message Date
e9c9f488f5 fix:lost option 2024-02-17 16:03:44 +08:00
02a70eb0e7 apt clean first 2024-02-17 15:51:34 +08:00
8d5a07277a bwrap 2024-02-17 15:45:25 +08:00
12a2c435be update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-31 04:02:30 +00:00
798554ab22 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-31 04:02:20 +00:00
a284695f80 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:34:38 +00:00
fe19bf6efc update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:34:02 +00:00
4c19bf865a update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:33:39 +00:00
af5594cdcb update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:33:13 +00:00
130ff44a29 add README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:32:26 +00:00
dba6361d29 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:31:54 +00:00
b5f45bbecf 修改: README.md 2024-01-30 19:17:59 +08:00
f3be1f48f6 No more RPM 2024-01-30 18:56:39 +08:00
af04000b02 更新host integration 2024-01-29 23:33:42 +08:00
14 changed files with 178 additions and 104 deletions

View File

@@ -1 +0,0 @@
cd rpmbuild && rpmbuild -ba SPECS/bookworm-compatibility-mode.spec

View File

@@ -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

View File

@@ -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
# [中文](README.zh.md)
Bookworm compatibility mode is a part of `Amber Compatability Environment(ACE)`
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
## Install Guide
### Quick Install (Debian)
https://bbs.spark-app.store/d/1668-xing-huo-ying-yong-shang-dian-on-ace
### Manual InstallDebian/Fedora/Arch)
https://share.shenmo.tech:23333/index.php?share/folder&user=1&sid=kr8z6Fqf
## Build Guide
### Debian
@@ -52,14 +36,14 @@ Here are the details:
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]
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.
### Fedora
See readme in `ACE-rpm` directory
See https://gitee.com/amber-compatability-environment/ace-rpm
### 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
View 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`
---

View File

@@ -1,5 +1,5 @@
Package: cn.flamescion.bookworm-compatibility-mode
Version: 12.4.8
Version: 12.4.9
Section: misc
Priority: optional
Depends: bubblewrap,flatpak,zenity,policykit-1,gcc,systemd

View File

@@ -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 "$@"

View File

@@ -1,5 +1,43 @@
#!/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(){
@@ -25,19 +63,25 @@ local file=$1
chmod +x $file
}
for app_dir in $(ls /opt/apps/); do
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do
do_integrate $file
if [ "${IS_ACE_ENV}" != "" ];then
if [ -e /opt/apps/ ];then
for app_dir in $(ls /opt/apps/); do
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do
do_integrate $file
done
done
done
else
log.warn "No /opt/apps directory. Skip..."
fi
for file in /usr/share/applications/*.desktop; do
do_integrate $file
done
find "/usr/share/applications/" -xtype l -delete
else
log.error "DO NOT run me on host OS"
fi

View File

@@ -104,7 +104,7 @@ else
log.error "Nope we support debian only now"
exit -1
fi
${APT_COMMAND} clean
${APT_COMMAND} update
updatetext=`${APT_COMMAND} update 2>&1`

View File

@@ -0,0 +1,2 @@
#!/bin/bash
host-spawn /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run-bwrap $@

View File

@@ -1 +0,0 @@
../../opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init