summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: abe72c0b1b0c3d40cb3bc0525951d3f1c31c9bf2 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Maintainer: honjow
pkgname=sk-chos-addon-git
_basename=sk-chos-tool
_pkgname=sk-chos-addon
_reponame=sk-chos-config
pkgver=1.9.1.r4.gc5655b2
pkgrel=1
pkgdesc="Addon for sk-chimeros"
arch=('any')
url="https://github.com/honjow/sk-chos-config.git"
license=('MIT')
makedepends=('git')
depends=(
    amdgpu-test-scripts-common-git
    amd-s2idle-analysis-script-git
    cage
    expect
    efibootmgr
    fpaste
    fzf
    glow
    gnu-efi
    gum
    just
    libcec
    man-db
    python-systemd
    refind
    wlr-randr
    zram-generator
)
provides=(sk-chos-addon)
conflicts=(sk-chos-addon)
replaces=(sk-chos-addon)
source=("git+$url")
sha256sums=('SKIP')
options=(!strip)
backup=('etc/sk-chos-tool/github_cdn.conf')
install=sk-chos-addon.install

pkgver() {
    cd "$srcdir/$_reponame"
    # printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

prepare() {
    source_dir="${srcdir}/${_reponame}/src/chimeraos-addon"
    cd "${source_dir}/share/sk-chos/completions"
    ./gen.sh
}

package() {
    source_dir="${srcdir}/${_reponame}/src/chimeraos-addon"

    # bin
    install -dm755 "${pkgdir}/usr/bin/"
    install -m755 -t "${pkgdir}/usr/bin/" "${source_dir}/bin"/*

    # conf
    install -dm755 "${pkgdir}/etc/${_basename}"
    install -m644 -t "${pkgdir}/etc/${_basename}" "${source_dir}/etc/${_basename}"/*.conf

    # fonts conf
    install -dm755 "${pkgdir}/etc/fonts/conf.d"
    install -m644 -t "${pkgdir}/etc/fonts/conf.d" "${source_dir}/etc/fonts/conf.d"/*.conf

    # sk-chos
    install -dm755 "${pkgdir}/etc/sk-chos"
    install -m644 -t "${pkgdir}/etc/sk-chos" "${source_dir}/etc/sk-chos"/*

    # sysctl
    install -dm755 "${pkgdir}/etc/sysctl.d"
    install -m644 -t "${pkgdir}/etc/sysctl.d" "${source_dir}/etc/sysctl.d"/*

    # etc systemd
    install -dm755 "${pkgdir}/etc/systemd"
    install -m644 -t "${pkgdir}/etc/systemd" "${source_dir}/etc/systemd"/*.*

    # etc system
    install -dm755 "${pkgdir}/etc/systemd/system"
    install -m644 -t "${pkgdir}/etc/systemd/system" "${source_dir}/etc/systemd/system"/*.*

    # lib service
    install -dm755 "${pkgdir}/usr/lib/systemd/system"
    install -m644 -t "${pkgdir}/usr/lib/systemd/system" "${source_dir}/systemd/system"/*.*

    # user service
    install -dm755 "${pkgdir}/usr/lib/systemd/user"
    install -m644 -t "${pkgdir}/usr/lib/systemd/user" "${source_dir}/systemd/user"/*

    # /usr/libexec/*
    install -dm755 "${pkgdir}/usr/libexec"
    install -m755 -t "${pkgdir}/usr/libexec" "${source_dir}/libexec"/*

    # /etc/default/*
    install -dm755 "${pkgdir}/etc/default"
    install -m644 -t "${pkgdir}/etc/default" "${source_dir}/etc/default"/*

    # etc profile.d
    install -dm755 "${pkgdir}/etc/profile.d"
    install -m644 -t "${pkgdir}/etc/profile.d" "${source_dir}/etc/profile.d"/*

    # /usr/share/sk-chos/just/*
    install -dm755 "${pkgdir}/usr/share/sk-chos/just"
    install -m644 -t "${pkgdir}/usr/share/sk-chos/just" "${source_dir}/share/sk-chos/just"/*.*

    # /usr/share/sk-chos/motd/*
    install -dm755 "${pkgdir}/usr/share/sk-chos/motd"
    install -m644 -t "${pkgdir}/usr/share/sk-chos/motd" "${source_dir}/share/sk-chos/motd"/*

    # /usr/share/sk-chos/*
    install -dm755 "${pkgdir}/usr/share/sk-chos"
    install -m644 -t "${pkgdir}/usr/share/sk-chos" "${source_dir}/share/sk-chos"/justfile

    # /usr/local/share/zsh/site-functions/*
    install -dm755 "${pkgdir}/usr/local/share/zsh/site-functions"
    install -m644 -t "${pkgdir}/usr/local/share/zsh/site-functions" "${source_dir}/share/sk-chos/completions/"_*just

    # /etc/bash_completion.d
    install -dm755 "${pkgdir}/etc/bash_completion.d"
    install -m644 "${source_dir}/share/sk-chos/completions/_just.bash" "${pkgdir}/etc/bash_completion.d/just.bash"

    # /usr/lib/cjust
    install -dm755 "${pkgdir}/usr/lib/cjust"
    install -m755 -t "${pkgdir}/usr/lib/cjust" "${source_dir}/lib/cjust"/*.sh

    # polkit actions
    install -dm755 "${pkgdir}/usr/share/polkit-1/actions"
    install -m644 -t "${pkgdir}/usr/share/polkit-1/actions" "${source_dir}/share/polkit-1/actions"/*

    # polkit rules
    install -dm755 "${pkgdir}/usr/share/polkit-1/rules.d"
    install -m644 -t "${pkgdir}/usr/share/polkit-1/rules.d" "${source_dir}/share/polkit-1/rules.d"/*

    # udev rules
    install -dm755 "${pkgdir}/usr/lib/udev/rules.d"
    install -m644 -t "${pkgdir}/usr/lib/udev/rules.d" "${source_dir}/lib/udev/rules.d"/*

    # /usr/share/plymouth/themes/steamos/*
    install -dm755 "${pkgdir}/usr/share/plymouth/themes/steamos"
    install -m644 -t "${pkgdir}/usr/share/plymouth/themes/steamos" "${source_dir}/share/plymouth/themes/steamos"/*

    # 创建软链接解决重命名兼容
    # bin
    cd "${pkgdir}/usr/bin"
    ln -s sk-first-setup sk-first-run
    ln -s sk-chos-tool-update skt-update

    # systemd/system
    cd "${pkgdir}/usr/lib/systemd/system"
    ln -s sk-setup-kernel-options.service sk-update-boot-entry.service
    ln -s sk-setup-next-boot.service sk-auto-keep-boot-entry.service

    # systemd/user
    cd "${pkgdir}/usr/lib/systemd/user"
    ln -s sk-first-setup-daemon.service sk-first-run-daemon.service
}