mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-09-20 11:35:00 +02:00
🔧 build: add post installation script for the assistant
This commit is contained in:
@@ -3,35 +3,39 @@
|
||||
|
||||
pkgname=snigdhaos-assistant
|
||||
pkgver=r251.f2df36f4
|
||||
_pkgver=$(curl -s https://api.github.com/repos/Snigdha-OS/snigdhaos-assistant/releases/latest | jq -r .tag_name)
|
||||
_pkgver=$(curl -fsSL https://api.github.com/repos/Snigdha-OS/snigdhaos-assistant/releases/latest | jq -r .tag_name)
|
||||
pkgrel=1
|
||||
pkgdesc="A setup utility for Snigdha OS which helps setting up & installing applications"
|
||||
arch=('any')
|
||||
url="https://gitlab.com/snigdhaos/snigdhaos-assistant/"
|
||||
license=('MIT')
|
||||
depends=('yad' 'wget' 'qt5-base' 'curl' 'jq')
|
||||
optdepends=('pamac')
|
||||
optdepends=('pamac: For managing packages')
|
||||
makedepends=('git' 'cmake')
|
||||
groups=()
|
||||
source=("https://github.com/Snigdha-OS/${pkgname}/archive/refs/tags/${_pkgver}.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
install=${pkgname}.install
|
||||
|
||||
pkgver() {
|
||||
# Print package version as 'rX.XXXX'
|
||||
# Extract the version from the tag name, removing the 'v' prefix if present.
|
||||
printf "%s" "${_pkgver#v}"
|
||||
}
|
||||
|
||||
build() {
|
||||
# Ensure the build directory exists
|
||||
cmake -B build -S "$pkgname-$_pkgver" \
|
||||
-DCMAKE_BUILD_TYPE='Release' \
|
||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-Wno-dev
|
||||
make -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
# Install built files to the package directory
|
||||
make -C build DESTDIR="$pkgdir" install
|
||||
|
||||
install -d "$pkgdir"/usr
|
||||
cp -rf "$srcdir"/$pkgname-$_pkgver/usr "$pkgdir"
|
||||
}
|
||||
# Ensure proper directory structure
|
||||
install -d "$pkgdir/usr"
|
||||
cp -rf "$srcdir/$pkgname-$_pkgver/usr" "$pkgdir"
|
||||
}
|
33
snigdhaos-assistant/snigdhaos-assistant.readme
Normal file
33
snigdhaos-assistant/snigdhaos-assistant.readme
Normal file
@@ -0,0 +1,33 @@
|
||||
post_install() {
|
||||
echo "\n[INFO] Snigdha OS Assistant successfully installed!\n"
|
||||
echo "\n[INFO] Post-installation steps are being executed...\n"
|
||||
|
||||
# Ensure necessary directories are created
|
||||
echo "[INFO] Verifying required directories..."
|
||||
mkdir -p "$HOME/.snigdhaos" && echo "[OK] Directory $HOME/.snigdhaos created." || echo "[WARNING] Could not create $HOME/.snigdhaos."
|
||||
|
||||
# Generate a default configuration file if it does not exist
|
||||
CONFIG_FILE="$HOME/.snigdhaos/assistant-config.json"
|
||||
if [[ ! -f "$CONFIG_FILE" ]]; then
|
||||
echo "[INFO] Creating a default configuration file at $CONFIG_FILE..."
|
||||
cat <<EOL > "$CONFIG_FILE"
|
||||
{
|
||||
"default_applications": [
|
||||
"firefox",
|
||||
"code",
|
||||
"vlc"
|
||||
],
|
||||
"auto_update": true
|
||||
}
|
||||
EOL
|
||||
echo "[OK] Default configuration file created."
|
||||
else
|
||||
echo "[INFO] Configuration file already exists at $CONFIG_FILE. Skipping creation."
|
||||
fi
|
||||
|
||||
# Inform the user of the next steps
|
||||
echo "\n[INFO] Post-installation completed. You can now launch Snigdha OS Assistant using the command 'snigdhaos-assistant'."
|
||||
echo "\n[INFO] For configuration, edit the file at $CONFIG_FILE."
|
||||
}
|
||||
|
||||
post_install
|
Reference in New Issue
Block a user