summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba1987fc9f0f57aed5615576ec8b23845c57fd07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Maintainer: ALEXPRO100 <alealexpro100@ya.ru>

pkgname=linux_install-git
_reponame=linux_install
pkgver=0.5.2.r0.gad2e1b0
pkgrel=1
pkgdesc="Install various distros from Linux to any architecture."
arch=('any')
url="https://github.com/alealexpro100/$_reponame"
license=('GPL3')
depends=('coreutils' 'util-linux' 'bash' 'wget' 'tar' 'zstd')
makedepends=('git')
optdepends=('debootstrap: debian support'
            'qemu-user-static: foreign architectures support'
            'squashfs-tools: live installer build support')
source=("git+https://github.com/alealexpro100/linux_install.git")
md5sums=('SKIP')

pkgver() {
    cd "$_reponame" || exit 1
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    for file in install_sys profile_gen; do
        echo -e "#!/bin/bash\n/usr/lib/$pkgname/$file.sh \"\$@\"" > "${srcdir}/$file"
    done
}

package() {
    cd "$srcdir/$_reponame" || exit 1
    rm -rf "_config.yml" "bin/debootstrap-debian" "custom" "tests"
    for file in TODO README.md CHANGES.md; do
        install -Dm644 "$file" "$pkgdir/usr/share/doc/$pkgname/$file"
        rm -rf "$file"
    done
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    rm -rf LICENSE
    install -m755 -d "$pkgdir/usr/lib/$pkgname"
    cp -r * "$pkgdir/usr/lib/$pkgname"
    for file in install_sys profile_gen; do
        install -Dm755 "${srcdir}/$file" "$pkgdir/usr/bin/$file"
    done
}