Skip to content

Commit

Permalink
[Linux][CI] Fix building DEB and RPM packages.
Browse files Browse the repository at this point in the history
This PR contains the following changes:

- Fix installation of translations.
- Put icons to the correct location.
- Run boinc-client service after package installation.
- Add ca-certificates package dependency.
- Create link to the system ca certificates file during installation.
- Create /etc/boinc-client folder if not exists.
- Set permissions to the data directory. Create configuration files (and symbolic links to them) if not exist.
- Add X11 config file. Fix boinc.conf file installation.
- Add current user to the boinc group.
- Add boinc user to the video and render groups.
- Create boinc user and boinc group when installing the package.
- Put postinst script to the package.
- Add integration tests.

This PR fixes the following issues: BOINC#5324, BOINC#5325, BOINC#5335, BOINC#5431.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
  • Loading branch information
AenBleidd committed Feb 27, 2024
1 parent b612219 commit 00dc490
Show file tree
Hide file tree
Showing 17 changed files with 746 additions and 172 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/debrepo/package_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2023 University of California
# Copyright (C) 2024 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
Expand All @@ -27,25 +27,9 @@ function exit_usage() {
}

case "$1_$2" in
# ubuntu distros
"focal_linux_client")
echo "libc6,libxss1 (>= 1.2.3)"
"focal_linux_client" | "jammy_linux_client" | "buster_linux_client" | "bullseye_linux_client" | "bookworm_linux_client")
echo "libc6,libxss1 (>= 1.2.3),ca-certificates"
;;
"jammy_linux_client")
echo "libc6,libxss1 (>= 1.2.3)"
;;

# debian distros
"buster_linux_client")
echo "libc6,libxss1 (>= 1.2.3)"
;;
"bullseye_linux_client")
echo "libc6,libxss1 (>= 1.2.3)"
;;
"bookworm_linux_client")
echo "libc6,libxss1 (>= 1.2.3)"
;;

*) echo "libc6"
;;

Expand Down
49 changes: 29 additions & 20 deletions .github/workflows/debrepo/package_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2023 University of California
# Copyright (C) 2024 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -33,47 +33,62 @@ function exit_usage() {

function prepare_client() {
# prepare dir structure
mkdir -p usr/bin
mkdir -p usr/local/bin
exit_on_fail
mkdir -p etc/boinc-client etc/default etc/init.d
exit_on_fail
mkdir -p usr/lib/systemd/system
exit_on_fail
mkdir -p var/lib/boinc
exit_on_fail
mkdir -p etc/bash_completion.d/
mkdir -p etc/bash_completion.d/ etc/X11/Xsession.d
exit_on_fail
mkdir -p usr/local/share/locale/
exit_on_fail
mkdir -p DEBIAN
exit_on_fail

# copy files and directories
mv boinc boinccmd usr/bin/
mv postinst DEBIAN/
exit_on_fail
mv boinc boinccmd usr/local/bin/
exit_on_fail
mv boinc-client.service usr/lib/systemd/system/
exit_on_fail
cp boinc-client etc/default/
mv boinc-client.conf etc/default/boinc-client
exit_on_fail
mv boinc-client etc/init.d/
exit_on_fail
mv boinc-client.conf etc/boinc-client/boinc.conf
exit_on_fail
mv boinc.bash etc/bash_completion.d/
exit_on_fail
mv 36x11-common_xhost-boinc etc/X11/Xsession.d/
exit_on_fail
for dir in $(find ./locale -maxdepth 1 -mindepth 1 -type d); do mkdir -p usr/local/share/$dir/LC_MESSAGES; for file in $(find $dir -type f -iname BOINC-Client.mo); do mv $file usr/local/share/$dir/LC_MESSAGES/; done; done
exit_on_fail
rm -rf locale/
}

function prepare_manager() {
# prepare dir structure
mkdir -p usr/bin
mkdir -p usr/local/bin
exit_on_fail
mkdir -p usr/local/share/applications usr/local/share/boinc-manager usr/local/share/icons usr/local/share/locale/
exit_on_fail
mkdir -p usr/share/applications usr/share/boinc-manager usr/share/icons/boinc usr/share/locale/boinc
mkdir -p DEBIAN
exit_on_fail

# copy files and directories
mv boincmgr usr/bin/
mv boincmgr usr/local/bin/
exit_on_fail
mv boinc.desktop usr/share/applications/
mv boinc.desktop usr/local/share/applications/
exit_on_fail
mv skins/ usr/share/boinc-manager/
mv boinc.png usr/local/share/icons/
exit_on_fail
mv locale/* usr/share/locale/boinc/
mv boinc.svg usr/local/share/icons/
exit_on_fail
mv skins/ usr/local/share/boinc-manager/
exit_on_fail
for dir in $(find ./locale -maxdepth 1 -mindepth 1 -type d); do mkdir -p usr/local/share/$dir/LC_MESSAGES; for file in $(find $dir -type f -iname BOINC-Manager.mo); do mv $file usr/local/share/$dir/LC_MESSAGES/; done; done
exit_on_fail
rm -rf locale/
}
Expand All @@ -85,9 +100,7 @@ BASEPKG="$2" # name of the artifact type

# validity check
case "$BASEPKG" in
"linux_client")
;;
"linux_manager")
"linux_client" | "linux_manager")
;;

*) echo "ERROR: Unknown package preparation requested"
Expand All @@ -111,10 +124,6 @@ exit_on_fail

find .

# required for deb package (same for debian and ubuntu)
mkdir -p DEBIAN
exit_on_fail

# specialized prepare
case "$BASEPKG" in
"linux_client")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debrepo/repo_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2023 University of California
# Copyright (C) 2024 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
Expand Down
Loading

0 comments on commit 00dc490

Please sign in to comment.