Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions scripts/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,41 @@ build_deb() {
# Create package structure
local pkg_dir="${pkg_name}-${VERSION}-${arch}"
mkdir -p "$pkg_dir/DEBIAN"
mkdir -p "$pkg_dir/usr/lib/aictionary"
mkdir -p "$pkg_dir/usr/bin"
mkdir -p "$pkg_dir/usr/share/applications"
mkdir -p "$pkg_dir/usr/share/pixmaps"

# Copy binary
if [ -f "artifacts/$artifact_dir/Aictionary" ]; then
cp "artifacts/$artifact_dir/Aictionary" "$pkg_dir/usr/bin/"
chmod +x "$pkg_dir/usr/bin/Aictionary"
cp -r "artifacts/$artifact_dir/"* "$pkg_dir/usr/lib/aictionary/"
chmod +x "$pkg_dir/usr/lib/aictionary/Aictionary"
else
echo "Warning: Binary not found in artifacts/$artifact_dir/"
return 1
fi

# Copy additional files for framework-dependent version
if [ "$package_type" = "framework-dependent" ]; then
find "artifacts/$artifact_dir" -name "*.dll" -o -name "*.so" -o -name "*.json" -o -name "*.pdb" | while read file; do
find "artifacts/$artifact_dir" \
-name "*.dll" -o -name "*.so" -o -name "*.json" -o -name "*.pdb" | while read file; do
if [ -f "$file" ]; then
cp "$file" "$pkg_dir/usr/bin/"
cp "$file" "$pkg_dir/usr/lib/aictionary/"
fi
done
# Copy Assets directory if exists
if [ -d "artifacts/$artifact_dir/Assets" ]; then
cp -r "artifacts/$artifact_dir/Assets" "$pkg_dir/usr/bin/"
cp -r "artifacts/$artifact_dir/Assets" "$pkg_dir/usr/lib/aictionary/"
fi
fi

# Create wrapper script
cat > "$pkg_dir/usr/bin/Aictionary" << EOF
#!/bin/bash
DIR=/usr/lib/aictionary
export LD_LIBRARY_PATH=\$DIR:\$LD_LIBRARY_PATH
exec "\$DIR/Aictionary" "\$@"
EOF
chmod +x "$pkg_dir/usr/bin/Aictionary"

# Create control file
{
Expand Down
Loading