Refactoring repository...
Some checks are pending
Check Conventional Commit / check-commit-message (push) Waiting to run

This commit is contained in:
CELESTIFYX
2025-01-14 19:02:06 +02:00
parent 876fa0988e
commit 08abac9e7d
33171 changed files with 4677 additions and 761 deletions

View File

@@ -0,0 +1,40 @@
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
# Contributor: [Contributor Name] <[Contributor Email]>
pkgname=snigdhaos-system-installation
org=Snigdha-OS
_pkgname=snigdhaos-system-installation
_destdirs=("/etc/" "/usr/local/bin/" "/usr/lib/systemd/system/")
_licensedir="/usr/share/snigdhaos/licenses/"
pkgver=1
pkgrel=1
pkgdesc="Installation files for Snigdha OS"
arch=('any')
url="https://github.com/${org}/${pkgname}"
license=('MIT')
makedepends=('git')
depends=()
provides=("${pkgname}")
options=(!strip !emptydirs)
source=(${pkgname}::"git+https://github.com/${org}/${_pkgname}")
sha256sums=('SKIP')
install="${pkgname}.install"
pkgver() {
cd "$srcdir/$pkgname" || exit
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
# License installation
install -dm755 "$pkgdir/$_licensedir/$_pkgname"
install -m644 "$srcdir/$pkgname/LICENSE" "$pkgdir/$_licensedir/$_pkgname"
# Install directories and files
for dir in "${_destdirs[@]}"; do
if [ -d "$srcdir/$pkgname/$dir" ]; then
install -dm755 "$pkgdir/$dir"
find "$srcdir/$pkgname/$dir" -type f -exec install -Dm644 {} "$pkgdir/$dir" \;
fi
done
}

View File

@@ -0,0 +1,71 @@
# Function to display a warning message
warn() {
tput setaf 3
echo "[WARNING] $1"
tput sgr0
}
# Function to display an informational message
info() {
tput setaf 2
echo "$1"
tput sgr0
}
# Function to display a success message
success() {
tput setaf 6
echo "$1"
tput sgr0
}
# Function to display an error message
error() {
tput setaf 1
echo "[ERROR] $1"
tput sgr0
}
# Function to handle enabling/disabling a service
manage_service() {
local service=$1
local action=$2
if systemctl $action $service; then
success "Service $service ${action}d successfully."
else
error "Failed to ${action} service $service."
fi
}
# Function to handle starting/stopping a service
manage_service_start() {
local service=$1
local action=$2
if systemctl $action $service; then
success "Service $service ${action}ed successfully."
else
error "Failed to ${action} service $service."
fi
}
# Function to handle post-install tasks
post_install() {
info "Enabling and starting snigdhaos-graphical-target.service..."
manage_service "snigdhaos-graphical-target.service" "enable"
manage_service_start "snigdhaos-graphical-target.service" "start"
}
# Function to handle post-upgrade tasks
post_upgrade() {
info "Enabling and starting snigdhaos-graphical-target.service..."
manage_service "snigdhaos-graphical-target.service" "enable"
manage_service_start "snigdhaos-graphical-target.service" "start"
}
# Function to handle pre-remove tasks
pre_remove() {
info "Disabling snigdhaos-graphical-target.service..."
manage_service "snigdhaos-graphical-target.service" "disable"
}