Initial commit.
[archnosh.git] / PKGBUILD
blobd91540cd8222d7f8437919fa1c1d4964891f5150
1 # Maintainer:  taca <taca@kadisius.eu>
3 pkgbase=nosh
4 pkgname=(
5     'nosh-common'
6     'nosh-guide'
7     'nosh-zsh-completion'
8     'nosh-exec'
9     'nosh-execline-shims'
10     'nosh-core-shims'
11     'nosh-service-management'
12     'nosh-terminal-management'
13     'nosh-run-system-manager'
14     'nosh-ucspi-tcp-shims'
15     'nosh-terminal-extras'
16     'nosh-systemd-shims'
17     'nosh-systemv-shims'
18     'nosh-upstart-shims'
19     'nosh-debian-shims'
20     'nosh-openbsd-shims'
21     'nosh-bsd-shims'
22     'nosh-kbd-shims'
23     'nosh-bundles'
24     'nosh-run-via-systemd'
25     'nosh-run-kernel-vt'
26     'nosh-run-udev'
27     'nosh-run-busybox-mdev'
28     'nosh-run-suckless-mdev'
29     'nosh-run-vdev'
30     'nosh-run-user-vt'
31     'nosh-run-freedesktop-system-bus'
32     'nosh-run-freedesktop-kits'
33     'nosh-run-virtualbox-guest'
34     'nosh-run-klog'
35     'nosh-run-local-syslog'
36     'nosh-run-debian-server-base'
37     'nosh-run-debian-desktop-base'
38     'nosh-run-openssh-server'
39     )               
40 pkgver=1.33
41 pkgrel=1
42 pkgdesc="A suite of system-level utilities for initializing and running a BSD or Linux system, for managing daemons, for managing terminals, and for managing logging."
43 arch=('x86_64')
44 url="https://jdebp.eu/Softwares/nosh/index.html"
45 license=('custom:MIT Expat' 'custom:FreeBSD' 'custom:ISC' 'custom:Simplified BSD')
46 groups=()
47 depends=()
48 makedepends=('pax' 'docbook-xml' 'docbook-xsl' 'xmlto' 'libtinfo' 'redo-jdebp')
49 checkdepends=()
50 optdepends=()
51 provides=()
52 conflicts=()
53 replaces=()
54 backup=()
55 options=()
56 install=""
57 changelog=""
59 # packages with maintenance scripts
60 _pkginstalls=( 
61         "nosh-bundles"
62         "nosh-run-klog"
63         "nosh-run-user-vt"
64         "nosh-run-local-syslog"
65         "nosh-run-via-systemd"
66         "nosh-run-busybox-mdev"
67         "nosh-run-openssh-server"
68         "nosh-run-via-systemd"
69         "nosh-run-freedesktop-kits"
70         "nosh-run-suckless-mdev"
71         "nosh-run-freedesktop-system-bus"
72         "nosh-run-system-manager"
73         "nosh-run-virtualbox-guest"
74         "nosh-run-kernel-vt"
75         "nosh-run-udev"
76         "nosh-run-debian-server-base"
77         "nosh-run-debian-desktop-base"
78         "nosh-run-openssh-server"
79         )
80         
81 # no point in distributing empty files, create them now, they are filled in later
82 for i in ${_pkginstalls[@]}
84         touch $i.install
85 done
86     
87 source=("https://jdebp.eu/Repository/freebsd/nosh-$pkgver.tar.gz"
88         "nosh-staging.patch"
89         "maintenance.sh"
90         "scriptletbuilder.sh"
91         "nosh-run-udev.post_install.extra"
92         
93         "nosh-bundles.install"
94         "nosh-run-klog.install"
95         "nosh-run-user-vt.install"
96         "nosh-run-local-syslog.install"
97         "nosh-run-via-systemd.install"
98         "nosh-run-busybox-mdev.install"
99         "nosh-run-openssh-server.install"
100         "nosh-run-via-systemd.install"
101         "nosh-run-freedesktop-kits.install"
102         "nosh-run-suckless-mdev.install"
103         "nosh-run-freedesktop-system-bus.install"
104         "nosh-run-system-manager.install"
105         "nosh-run-virtualbox-guest.install"
106         "nosh-run-kernel-vt.install"
107         "nosh-run-udev.install"
108         "nosh-run-debian-server-base.install"
109         "nosh-run-debian-desktop-base.install"
110         "nosh-run-openssh-server.install"
111         )
112 noextract=()
113 sha256sums=('4e57426fb4eb3171400fe735c0e28f0264a7cb61b5626071a8e00738e5eeaa8a'
114             '87ad51a0d21fdadf12daa23309559a2599bd3ab5d658582dd73dc54388452251'
115             '8d2e87fabd5b8597140ec53721be97d74adf44e89fbef45f9a4c295becaf5a00'
116             'd2ee01d6d41caa8015eb74eb37525de3d45c5bb071c8785fe245884aa19f20ac'
117             'f90975c663794c7e87be157e03cdfa9bd835c212200539367e848fbbf9fe6cc9'
118             
119             'SKIP'
120             'SKIP'
121             'SKIP'
122             'SKIP'
123             'SKIP'
124             'SKIP'
125             'SKIP'
126             'SKIP'
127             'SKIP'
128             'SKIP'
129             'SKIP'
130             'SKIP'
131             'SKIP'
132             'SKIP'
133             'SKIP'
134             'SKIP'
135             'SKIP'
136             'SKIP'
137             )
138 validpgpkeys=()
140 prepare() {
141     
142         # ncurses headers different to Debian layout, patch out the ncursesw directory in cpp Includes
143     # taken from https://github.com/atweiden/pkgbuilds/blob/master/nosh/PKGBUILD
144         msg2 "Fix ncurses header import issues"
145     cd "${srcdir}"/source
146     find . -type f -print0 | xargs -0 sed -i 's@ncursesw/curses\.h@curses.h@g'
147     
148     # patch package/stage for Archlinux filesystem layout
149     msg2 "Align staging with Arch FS hierarchy guidelines"
150     cd "${srcdir}"/package
151     patch -i "${srcdir}"/nosh-staging.patch
152     
153     # patch debian maintenance scripts, just one path to fix
154     msg2 "Adapting maintenance scripts"
155     cd "${srcdir}"/package/debian
156     sed -i 's@usr/local/lib@usr/lib@g' nosh-run-via-systemd.postinst.extra 
157     
158     msg2 "Adding nosh-run-udev.post_install.extra"
159     # copy over the nosh-run-udev install file
160     cp -v "${srcdir}"/nosh-run-udev.post_install.extra "${srcdir}"/package/debian/
161     
162     # rename debian maintenance scripts to Archlinux nomenclature
163     msg2 "Renaming maintenance scripts"
164     cd "${srcdir}"/package/debian
165     source "${srcdir}"/maintenance.sh
169 build() {
170           
171     msg2 "Building main source"
172     "${srcdir}"/package/compile
173     
174     msg2 "Generating .install files"
175     source "${srcdir}"/scriptletbuilder.sh
176     for i in ${_pkginstalls[@]}
177     do
178         echo "Bulding $i.install"
179         _buildinstall $i > $i.install
180     done
181     
182     msg2 "Staging packages"
183     # stage packages to 'staging' directory
184     "${srcdir}"/package/stage "${srcdir}" "${srcdir}"/staging
187 check() {
188         # no test available for the moment
189     msg "Checking skipped..."
192 package_nosh-common() {
193     
194     # provide license (can't be done in each package, it creates file conflicts on install)
195     install -Dm 644 "${srcdir}"/source/COPYING "${pkgdir}"/usr/share/licenses/nosh/COPYING
199 # refactor the packaging, need special case for non-conforming package
200 for _pkg in ${pkgname[@]}
202     if test "$_pkg" != "nosh-common"
203     then
204     eval "package_${_pkg}() { _package $_pkg; }"
205     fi
206 done
208 _package() {
210     case "$1" in
211         nosh-zsh-completion)
212             pkgdesc="Z Shell completion functions for the nosh toolset"
213             depends+=( 'nosh-common')
214             optdepends=( 'zsh: for actual ZSH support' )
215             ;;
216         nosh-guide)
217             pkgdesc="User guide for the various nosh-* packages"
218             depends+=( 'nosh-common')
219             ;;
220         nosh-exec)
221             pkgdesc="Minimal non-shell script processor and various chain-load utilities useful for services"
222             depends+=( 'nosh-common')
223             ;;
224         nosh-execline-shims)
225             pkgdesc="Execline utility shims"
226             depends+=( 'nosh-common' 'nosh-exec')
227             conflicts+=( 'execline' )
228             ;;
229         nosh-core-shims)
230             pkgdesc="Core utility shims"
231             depends+=( 'nosh-common' 'nosh-exec')
232             conflicts+=( 'coreutils' 'util-linux' )
233             ;;
234         nosh-service-management)
235             pkgdesc="Service and system management utilities"
236             depends+=( 'nosh-common')
237             conflicts+=( 'nosh-bundles<=1.30')
238             ;;
239         nosh-terminal-management)
240             pkgdesc="Virtual terminal, pseudo-terminal, and TUI login tools"
241             depends+=( 'nosh-common' 'nosh-service-management>=1.14' )
242             conflicts+=( 'nosh-bundles<=1.20')
243             ;;
244         nosh-run-system-manager)
245             pkgdesc="Run the nosh system manager"
246             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'nosh-exec' 'nosh-bundles' 'redo-jdebp')
247             conflicts+=( 'nosh-run-via-systemd' 'upstart' 'sysvinit' 'systemd-sysvcompat') #'systemd' 
248             install="nosh-run-system-manager.install"
249             ;;
250         nosh-ucspi-tcp-shims)
251             pkgdesc="Bernstein UCSPI-TCP shim service utilities"
252             depends+=( 'nosh-common' 'nosh-exec' )
253             conflicts+=( 'ucspi-tcp' 'nosh-exec<=1.32')
254             ;;
255         nosh-terminal-extras)
256             pkgdesc="Extra terminal utilities"
257             depends+=( 'nosh-common' 'nosh-terminal-management' )
258             ;;
259         nosh-systemd-shims)
260             pkgdesc="Systemd shim service and system management utilities"
261             depends+=( 'nosh-common' 'nosh-service-management' )
262             conflicts+=( 'systemd' )
263             ;;
264         nosh-systemv-shims)
265             pkgdesc="BSD and System 5 shim service and system management utilities"
266             depends+=( 'nosh-common' 'nosh-service-management' )
267             conflicts+=( 'systemd-sysvcompat')
268             ;;
269         nosh-upstart-shims)
270             pkgdesc="Upstart shim service and system management utilities"
271             depends+=( 'nosh-common' 'nosh-service-management' )
272             ;;
273         nosh-debian-shims)
274             pkgdesc="Debian shim service and system management utilities"
275             depends+=( 'nosh-common' 'nosh-service-management' )
276             conflicts+=( 'nosh-run-via-systemd' 'upstart' 'sysvinit' 'systemd' )
277             ;;
278         nosh-openbsd-shims)
279             pkgdesc="OpenBSD shim service and system management utilities"
280             depends+=( 'nosh-common' 'nosh-service-management' 'nosh-systemv-shims<=1.28' )
281             conflicts+=( 'nosh-systemv-shims<=1.27')
282             ;;
283         nosh-bsd-shims)
284             pkgdesc="BSD shim service and system management utilities"
285             depends+=( 'nosh-common' 'nosh-service-management' )
286             conflicts+=( 'android-tools' )
287             ;;
288         nosh-kbd-shims)
289             pkgdesc="shim kbd utilities"
290             depends+=( 'nosh-common' 'nosh-terminal-management' )
291             conflicts+=( 'kbd')
292             ;;
293         nosh-bundles)
294             pkgdesc="Service bundles"
295             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'nosh-exec>=1.32' 'nosh-terminal-management>=1.22' 'shadow' )
296             install="nosh-bundles.install"
297             ;;
298         nosh-run-via-systemd)
299             pkgdesc="Run the nosh service manager and daemontools service scanner via systemd"
300             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'systemd' 'nosh-bundles' )
301             install="nosh-run-via-systemd.install"
302             ;;
303         nosh-run-kernel-vt)
304             pkgdesc="Run old-style kernel virtual terminals"
305             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-terminal-management' 'nosh-bundles' )
306             install="nosh-run-kernel-vt.install"
307             ;;
308         nosh-run-udev)
309             pkgdesc="Run udev as the device manager"
310             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.16' 'nosh-bundles' 'systemd')
311             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-vdev')
312             install="nosh-run-udev.install"
313             ;;
314         nosh-run-busybox-mdev)
315             pkgdesc="Run BusyBox mdev as the device manager"
316             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.16' 'nosh-bundles' 'busybox')
317             conflicts+=('nosh-run-udev' 'nosh-run-suckless-mdev' 'nosh-run-vdev')
318             install="nosh-run-busybox-mdev.install"
319             ;;
320         nosh-run-suckless-mdev)
321             pkgdesc="Run SuckLess mdev as the device manager"
322             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.16' 'nosh-bundles' 'smdev')
323             conflicts+=('nosh-run-udev' 'nosh-run-busybox-mdev' 'nosh-run-vdev')
324             install="nosh-run-suckless-mdev.install"
325             ;;
326         nosh-run-vdev)
327             pkgdesc="Run vdev as the device manager"
328             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management' 'nosh-bundles' 'vdev-git')
329             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-udev')
330             # no run script so far
331             # install="nosh-run-vdev.install"
332             ;;
333         nosh-run-user-vt)
334             pkgdesc="Run new-style application-mode virtual terminals"
335             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-terminal-management' 'nosh-bundles' )
336             install="nosh-run-user-vt.install"
337             ;;
338         nosh-run-freedesktop-system-bus)
339             pkgdesc="Run the system-wide message bus from freedesktop.org"
340             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
341             install="nosh-run-freedesktop-system-bus.install"
342             ;;
343         nosh-run-freedesktop-kits)
344             pkgdesc="Run the various "kit" programs from freedesktop.org"
345             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
346             install="nosh-run-freedesktop-kits.install"
347             ;;
348         nosh-run-virtualbox-guest)
349             pkgdesc="Run VirtualBox guest additions"
350             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
351             install="nosh-run-virtualbox-guest.install"
352             ;;
353         nosh-run-klog)
354             pkgdesc="Run the klog service"
355             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
356             #conflicts+=( 'systemd' )
357             install="nosh-run-klog.install"
358             ;;
359         nosh-run-local-syslog)
360             pkgdesc="Run the local syslog service"
361             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
362             #conflicts+=( 'systemd' )
363             install="nosh-run-local-syslog.install"
364             ;;
365         nosh-run-debian-server-base)
366             pkgdesc="Run the local syslog service"
367             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles>=1.33' 'nosh-terminal-management' )
368             conflicts+=( 'nosh-run-desktop-base' 'nosh-bundles<=1.32')
369             install="nosh-run-debian-server-base.install"
370             ;;  
371         nosh-run-debian-desktop-base)
372             pkgdesc="Run the local syslog service"
373             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles>=1.33' 'nosh-terminal-management' )
374             conflicts+=( 'nosh-run-server-base' 'nosh-bundles<=1.32')
375             install="nosh-run-debian-desktop-base.install"
376             ;;  
377         nosh-run-openssh-server)
378             pkgdesc="Run the OpenSSH server"
379             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
380             install="nosh-run-openssh-server.install"
381             ;;  
382     esac
383     
384     # copy over the staging files
385     (cd "${srcdir}"/staging/"${1}"/ && pax -r -w -l -- * "${pkgdir}"/)
386