Refine packaging layout and Arch build paths
* Move Arch-specific ignore rules into `packaging/arch/.gitignore` and simplify top-level `.gitignore`/`.dockerignore`. * Update Arch `PKGBUILD` to sync from the project root and drop `packaging/` from the installed tree. * Fix OS-specific `package.sh` helpers to resolve the new `packaging/*` locations correctly for Arch, Debian/Ubuntu, Fedora, and CentOS.
This commit is contained in:
6
packaging/arch/.gitignore
vendored
Normal file
6
packaging/arch/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# Arch pkg artifacts
|
||||
*.pkg.tar.*
|
||||
*.log
|
||||
package-manager-*
|
||||
src/
|
||||
pkg/
|
||||
@@ -15,7 +15,7 @@ makedepends=('rsync')
|
||||
install=${pkgname}.install
|
||||
|
||||
# Local source checkout — avoids the tarball requirement.
|
||||
# This assumes you build the package from inside the main project repository.
|
||||
# We build from the project root (two levels above packaging/arch/).
|
||||
source=()
|
||||
sha256sums=()
|
||||
|
||||
@@ -24,12 +24,17 @@ _srcdir_name="source"
|
||||
|
||||
prepare() {
|
||||
mkdir -p "$srcdir/$_srcdir_name"
|
||||
|
||||
local project_root
|
||||
project_root="$(cd "$startdir/../.." && pwd)"
|
||||
|
||||
rsync -a \
|
||||
--exclude=".git" \
|
||||
--exclude=".github" \
|
||||
--exclude="pkg" \
|
||||
--exclude="srcpkg" \
|
||||
"$startdir/" "$srcdir/$_srcdir_name/"
|
||||
--exclude="packaging" \
|
||||
"$project_root/" "$srcdir/$_srcdir_name/"
|
||||
}
|
||||
|
||||
build() {
|
||||
@@ -62,7 +67,8 @@ package() {
|
||||
"$pkgdir/usr/lib/package-manager/PKGBUILD" \
|
||||
"$pkgdir/usr/lib/package-manager/Dockerfile" \
|
||||
"$pkgdir/usr/lib/package-manager/debian" \
|
||||
"$pkgdir/usr/lib/package-manager/packaging" \
|
||||
"$pkgdir/usr/lib/package-manager/.gitignore" \
|
||||
"$pkgdir/usr/lib/package-manager/__pycache__" \
|
||||
"$pkgdir/usr/lib/package-manager/.gitkeep"
|
||||
"$pkgdir/usr/lib/package-manager/.gitkeep" || true
|
||||
}
|
||||
|
||||
68
packaging/arch/src/source/PKGBUILD
Normal file
68
packaging/arch/src/source/PKGBUILD
Normal file
@@ -0,0 +1,68 @@
|
||||
# Maintainer: Kevin Veen-Birkenbach <info@veen.world>
|
||||
|
||||
pkgname=package-manager
|
||||
pkgver=0.9.1
|
||||
pkgrel=1
|
||||
pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)."
|
||||
arch=('any')
|
||||
url="https://github.com/kevinveenbirkenbach/package-manager"
|
||||
license=('MIT')
|
||||
|
||||
# Nix is the only runtime dependency; Python is provided by the Nix closure.
|
||||
depends=('nix')
|
||||
makedepends=('rsync')
|
||||
|
||||
install=${pkgname}.install
|
||||
|
||||
# Local source checkout — avoids the tarball requirement.
|
||||
# This assumes you build the package from inside the main project repository.
|
||||
source=()
|
||||
sha256sums=()
|
||||
|
||||
# Local source directory name under $srcdir
|
||||
_srcdir_name="source"
|
||||
|
||||
prepare() {
|
||||
mkdir -p "$srcdir/$_srcdir_name"
|
||||
rsync -a \
|
||||
--exclude=".git" \
|
||||
--exclude=".github" \
|
||||
--exclude="pkg" \
|
||||
--exclude="srcpkg" \
|
||||
"$startdir/" "$srcdir/$_srcdir_name/"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$_srcdir_name"
|
||||
:
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$_srcdir_name"
|
||||
|
||||
# Install the wrapper into /usr/bin
|
||||
install -Dm0755 "scripts/pkgmgr-wrapper.sh" \
|
||||
"$pkgdir/usr/bin/pkgmgr"
|
||||
|
||||
# Install Nix init helper
|
||||
install -Dm0755 "scripts/init-nix.sh" \
|
||||
"$pkgdir/usr/lib/package-manager/init-nix.sh"
|
||||
|
||||
# Install the full repository into /usr/lib/package-manager
|
||||
mkdir -p "$pkgdir/usr/lib/package-manager"
|
||||
|
||||
# Copy entire project tree from our local source checkout
|
||||
cp -a . "$pkgdir/usr/lib/package-manager/"
|
||||
|
||||
# Remove packaging-only and development artefacts from the installed tree
|
||||
rm -rf \
|
||||
"$pkgdir/usr/lib/package-manager/.git" \
|
||||
"$pkgdir/usr/lib/package-manager/.github" \
|
||||
"$pkgdir/usr/lib/package-manager/tests" \
|
||||
"$pkgdir/usr/lib/package-manager/PKGBUILD" \
|
||||
"$pkgdir/usr/lib/package-manager/Dockerfile" \
|
||||
"$pkgdir/usr/lib/package-manager/debian" \
|
||||
"$pkgdir/usr/lib/package-manager/.gitignore" \
|
||||
"$pkgdir/usr/lib/package-manager/__pycache__" \
|
||||
"$pkgdir/usr/lib/package-manager/.gitkeep"
|
||||
}
|
||||
11
packaging/arch/src/source/package-manager.install
Normal file
11
packaging/arch/src/source/package-manager.install
Normal file
@@ -0,0 +1,11 @@
|
||||
post_install() {
|
||||
/usr/lib/package-manager/init-nix.sh || true
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
/usr/lib/package-manager/init-nix.sh || true
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
echo ">>> package-manager removed. Nix itself was not removed."
|
||||
}
|
||||
Reference in New Issue
Block a user