Multiple updates
[archnosh.git] / PKGBUILD
blob6933cd906bfc2a3f70b9d059b12193b4fd480c17
1 # Maintainer:  taca <taca@kadisius.eu>
3 pkgbase=nosh
4 pkgname=(
5     'nosh-common'
6     'nosh-guide'
7     'nosh-exec'
8     'nosh-service-management'
9     'nosh-terminal-management'
10     'nosh-terminal-extras'
11     'nosh-zsh-completion'
12     'nosh-systemv-shims'
13     'nosh-systemd-shims'
14     'nosh-upstart-shims'
15     'nosh-execline-shims'
16     'nosh-core-shims'
17     'nosh-service-command-shim'
18     'nosh-debian-shims'
19     'nosh-openbsd-shims'
20     'nosh-freebsd-shims'
21     'nosh-bsd-shims'
22     'nosh-ucspi-tcp-shims'
23     'nosh-kbd-shims'
24      #'nosh-logrotate-shims'
25     'nosh-bundles'
26     'nosh-run-system-manager'
27     'nosh-run-debian-desktop-base'
28     'nosh-run-debian-server-base'
29     'nosh-run-kernel-vt'
30     'nosh-run-user-vt'
31     'nosh-run-via-systemd'
32     'nosh-run-virtualbox-guest'
33     'nosh-run-freedesktop-system-bus'
34     'nosh-run-freedesktop-kits'
35     'nosh-run-openssh-server'
36     'nosh-run-appletalk'
37     'nosh-run-udev'
38     'nosh-run-systemd-udev'
39     'nosh-run-busybox-mdev'
40     'nosh-run-suckless-mdev'
41     'nosh-run-vdev'
42     'nosh-run-local-syslog'
43     'nosh-run-klog'
44     )               
45 pkgver=1.37
46 pkgrel=1
47 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."
48 arch=('x86_64')
49 url="https://jdebp.eu/Softwares/nosh/index.html"
50 license=('custom:MIT Expat' 'custom:FreeBSD' 'custom:ISC' 'custom:Simplified BSD')
51 groups=()
52 depends=()
53 makedepends=('pax' 'docbook-xml' 'docbook-xsl' 'xmlto' 'redo-jdebp')
54 checkdepends=()
55 optdepends=()
56 provides=()
57 conflicts=()
58 replaces=()
59 backup=()
60 options=()
61 install=""
62 changelog="archnosh.changelog"
64 # packages with maintenance scripts
65 _pkginstalls=( 
66         "nosh-bundles"
67         "nosh-run-busybox-mdev"
68         "nosh-run-debian-desktop-base"
69         "nosh-run-debian-server-base"
70         "nosh-run-freedesktop-kits"
71         "nosh-run-freedesktop-system-bus"
72         "nosh-run-kernel-vt"
73         "nosh-run-klog"
74         "nosh-run-local-syslog"
75         "nosh-run-openssh-server"
76         "nosh-run-suckless-mdev"
77         "nosh-run-systemd-udev"
78         "nosh-run-system-manager"
79         "nosh-run-udev"
80         "nosh-run-user-vt"
81         "nosh-run-via-systemd"
82         "nosh-run-virtualbox-guest"
83         "nosh-service-management"
84         )
85         
86 # no point in distributing empty files, create them now, they are filled in later
87 for i in ${_pkginstalls[@]}
89         touch $i.install
90 done
91     
92 source=("https://jdebp.eu/Repository/freebsd/nosh-$pkgver.tar.gz"
93         "staging.patch"
94         "maintenance-scripts.patch"
95         "scriptletbuilder.sh"
96         "per-user-exec.patch"
97         
98         "nosh-bundles.install"
99         "nosh-run-busybox-mdev.install"
100         "nosh-run-debian-desktop-base.install"
101         "nosh-run-debian-server-base.install"
102         "nosh-run-freedesktop-kits.install"
103         "nosh-run-freedesktop-system-bus.install"
104         "nosh-run-kernel-vt.install"
105         "nosh-run-klog.install"
106         "nosh-run-local-syslog.install"
107         "nosh-run-openssh-server.install"
108         "nosh-run-suckless-mdev.install"
109         "nosh-run-systemd-udev.install"
110         "nosh-run-system-manager.install"
111         "nosh-run-udev.install"
112         "nosh-run-user-vt.install"
113         "nosh-run-via-systemd.install"
114         "nosh-run-virtualbox-guest.install"
115         "nosh-service-management.install"
116         )
117 noextract=()
118 sha256sums=(
119             'a8bfe55b9f3e61097c1dfaa23c8d5ea0c39e1dc1ddf0b669133c1d7723911c93' # nosh-1.37.tar.gz
120             'e7fc3022780a179a0da293b0da4094deef770cb6f4572b39c6bec4e38752f0d5' # staging.patch
121             '8f2a1ba80ac5a6a912579a70454bc843d551db22bd1ef7e6dda9124167a7fa00' # maintenance-scripts.patch
122             '907d92546845ab087be38515fcbd04bec68b68a250534063695e73646241454c' # scriptletbuilder.sh
123             '7d52bb895ecffb721712fe76c6a57351c744f9ef96a5fa2521133e609f52c942' # per-user-exec.patch
125             'SKIP' # nosh-bundles.install
126             'SKIP' # nosh-run-busybox-mdev.install
127             'SKIP' # nosh-run-debian-desktop-base.install
128             'SKIP' # nosh-run-debian-server-base.install
129             'SKIP' # nosh-run-freedesktop-kits.install
130             'SKIP' # nosh-run-freedesktop-system-bus.install
131             'SKIP' # nosh-run-kernel-vt.install
132             'SKIP' # nosh-run-klog.install
133             'SKIP' # nosh-run-local-syslog.install
134             'SKIP' # nosh-run-openssh-server.install
135             'SKIP' # nosh-run-suckless-mdev.install
136             'SKIP' # nosh-run-systemd-udev.install
137             'SKIP' # nosh-run-system-manager.install
138             'SKIP' # nosh-run-udev.install
139             'SKIP' # nosh-run-user-vt.install
140             'SKIP' # nosh-run-via-systemd.install
141             'SKIP' # nosh-run-virtualbox-guest.install
142             'SKIP' # nosh-service-management.install
143             )
144 validpgpkeys=()
146 prepare() {
147     
148     # ncurses headers different to Debian layout, patch out the ncursesw directory in cpp Includes
149     # taken from https://github.com/atweiden/pkgbuilds/blob/master/nosh/PKGBUILD
150         msg2 "Fix ncurses header import issues"
151     cd "${srcdir}"/source
152     find . -type f -print0 | xargs -0 sed -i 's@ncursesw/curses\.h@curses.h@g'
153     
154     # patch package/stage for Archlinux filesystem layout
155     msg2 "Align staging with Arch FS hierarchy guidelines"
156     cd "${srcdir}"
157     patch -p1 -i "${srcdir}"/staging.patch
158     
159     # patch debian maintenance scripts
160     msg2 "Adapting maintenance scripts"
161     cd "${srcdir}"/package/debian
162     sed -i 's@usr/local/lib@usr/lib@g' nosh-run-via-systemd.post_install.extra nosh-run-via-systemd.post_upgrade.extra
163     cd "${srcdir}"
164     patch -p1 -i "${srcdir}"/maintenance-scripts.patch
165     patch -p1 -i "${srcdir}"/per-user-exec.patch
168 build() {
169           
170     msg2 "Building main source"
171     "${srcdir}"/package/compile
172     
173     msg2 "Generating .install files"
174     source "${srcdir}"/scriptletbuilder.sh
175     for i in ${_pkginstalls[@]}
176     do
177         echo "Bulding $i.install"
178         _buildinstall $i > $i.install
179     done
180     
181     msg2 "Staging packages"
182     # stage packages to 'staging' directory
183     "${srcdir}"/package/stage "${srcdir}" "${srcdir}"/staging
186 check() {
187     # no test available for the moment
188     msg "Checking skipped..."
191 package_nosh-common() {
192     
193     # provide license (can't be done in each package, it creates file conflicts on install)
194     install -Dm 644 "${srcdir}"/source/COPYING "${pkgdir}"/usr/share/licenses/nosh/COPYING
198 # refactor the packaging, need special case for non-conforming package
199 for _pkg in ${pkgname[@]}
201     if test "$_pkg" != "nosh-common"
202     then
203     eval "package_${_pkg}() { _package $_pkg; }"
204     fi
205 done
207 _package() {
209     case "$1" in
210         nosh-guide)
211             pkgdesc="User guide for the various nosh-* packages"
212             depends+=( 'nosh-common')
213             ;;
214         nosh-exec)
215             pkgdesc="Minimal non-shell script processor and various chain-load utilities useful for services"
216             depends+=( 'nosh-common')
217             conflicts+=( 'daemontools' 'daemontools-encore' 'nosh-bundles<=1.33')
218             ;;
219         nosh-service-management)
220             pkgdesc="Service and system management utilities"
221             depends+=( 'nosh-common' 'glibc>=2.13')
222             conflicts+=( 'nosh-bundles<=1.30' 'daemontools' 'daemontools-encore' )
223             install="nosh-service-management.install"
224             ;;
225         nosh-terminal-management)
226             pkgdesc="Virtual terminal, pseudo-terminal, and TUI login tools"
227             depends+=( 'nosh-common' 'nosh-service-management>=1.14' )
228             conflicts+=( 'nosh-bundles<=1.20')
229             ;;
230         nosh-terminal-extras)
231             pkgdesc="Extra terminal utilities"
232             depends+=( 'nosh-common' 'nosh-terminal-management' )
233             ;;
234         nosh-zsh-completion)
235             pkgdesc="Z Shell completion functions for the nosh toolset"
236             depends+=( 'nosh-common')
237             optdepends=( 'zsh: for actual ZSH support' )
238             ;;
239         nosh-systemv-shims)
240             pkgdesc="BSD and System 5 shim service and system management utilities"
241             depends+=( 'nosh-common' 'nosh-service-management' )
242             conflicts+=( 'systemd-sysvcompat')
243             ;;
244         nosh-systemd-shims)
245             pkgdesc="Systemd shim service and system management utilities"
246             depends+=( 'nosh-common' 'nosh-service-management' )
247             conflicts+=( 'systemd' )
248             ;;
249         nosh-upstart-shims)
250             pkgdesc="Upstart shim service and system management utilities"
251             depends+=( 'nosh-common' 'nosh-service-management' )
252             ;;
253         nosh-execline-shims)
254             pkgdesc="Execline utility shims"
255             depends+=( 'nosh-common' 'nosh-exec' )
256             conflicts+=( 'execline' )
257             ;;
258         nosh-core-shims)
259             pkgdesc="Core utility shims"
260             depends+=( 'nosh-common' 'nosh-exec' )
261             conflicts+=( 'coreutils' 'util-linux' )
262             ;;
263         nosh-service-command-shim)
264             pkgdesc="Shim for the old BSD and System 5 service command"
265             depends+=( 'nosh-common' 'nosh-service-management' 'nosh-systemv-shims' )
266             conflicts+=( 'systemd-sysvcompat' 'sysvinit' 'nosh-systemv-shims<=1.36')
267             ;;
268         nosh-debian-shims)
269             pkgdesc="Debian shim service and system management utilities"
270             depends+=( 'nosh-common' 'nosh-service-management' )
271             conflicts+=( 'nosh-run-via-systemd' 'upstart' 'sysvinit' 'systemd' )
272             ;;
273         nosh-openbsd-shims)
274             pkgdesc="OpenBSD shim service and system management utilities"
275             depends+=( 'nosh-common' 'nosh-service-management' 'nosh-systemv-shims>=1.28' )
276             conflicts+=( 'nosh-systemv-shims<=1.27')
277             ;;
278         nosh-freebsd-shims)
279             pkgdesc="FreeBSD shim service and system management utilities"
280             depends+=( 'nosh-terminal-management' )
281             conflicts+=( 'nosh-sistemv-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-ucspi-tcp-shims)
289             pkgdesc="Bernstein UCSPI-TCP shim service utilities"
290             depends+=( 'nosh-common' 'nosh-exec' )
291             conflicts+=( 'ucspi-tcp' 'nosh-exec<=1.32')
292             ;;
293         nosh-kbd-shims)
294             pkgdesc="Shim kbd utilities"
295             depends+=( 'nosh-common' 'nosh-terminal-management' )
296             conflicts+=( 'kbd')
297             ;;
298         #nosh-logrotate-shims)
299         #    pkgdesc="Shim for the logrotate package"
300         #    depends+=( 'nosh-common' 'nosh-bundles' )
301         #    ;;
302         nosh-bundles)
303             pkgdesc="Service bundles"
304             depends+=( 'nosh-common' 'nosh-service-management>=1.37' 'nosh-exec>=1.37' 'nosh-terminal-management>=1.22' 'shadow' )
305             install="nosh-bundles.install"
306             ;;
307         nosh-run-system-manager)
308             pkgdesc="Run the nosh system manager"
309             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'nosh-exec' 'nosh-bundles' 'redo-jdebp' )
310             conflicts+=( 'nosh-run-via-systemd' 'upstart' 'sysvinit' 'systemd-sysvcompat') #'systemd' 
311             install="nosh-run-system-manager.install"
312             ;;
313         nosh-run-debian-desktop-base)
314             pkgdesc="Run the local syslog service"
315             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles>=1.33' 'nosh-terminal-management' )
316             conflicts+=( 'nosh-run-debian-server-base' 'nosh-bundles<=1.32')
317             install="nosh-run-debian-desktop-base.install"
318             backup=( 'usr/share/system-control/presets/90-linux-static-networking.preset'
319                      'usr/share/system-control/presets/50-Debian-Server-Basic.preset'
320                      'usr/share/system-control/presets/50-Debian-Desktop-Basic.preset'
321                      'usr/share/system-control/presets/90-linux-boot-essentials.preset'
322                      'usr/share/system-control/presets/90-common-boot-essentials.preset'
323                      )
324             ;;
325         nosh-run-debian-server-base)
326             pkgdesc="Run the local syslog service"
327             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles>=1.33' 'nosh-terminal-management' )
328             conflicts+=( 'nosh-run-debian-desktop-base' 'nosh-bundles<=1.32')
329             install="nosh-run-debian-server-base.install"
330             backup=( 'usr/share/system-control/presets/90-linux-static-networking.preset'
331                      'usr/share/system-control/presets/50-Debian-Server-Basic.preset'
332                      'usr/share/system-control/presets/90-linux-boot-essentials.preset'
333                      'usr/share/system-control/presets/90-common-boot-essentials.preset'
334                      )
335             ;;
336         nosh-run-kernel-vt)
337             pkgdesc="Run old-style kernel virtual terminals"
338             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-terminal-management' 'nosh-bundles' )
339             install="nosh-run-kernel-vt.install"
340             backup=( 'usr/share/system-control/presets/80-linux-ttylogin-tty.preset'
341                      'usr/share/system-control/presets/80-enable-kernel-vt.preset'
342                      )
343             ;;
344         nosh-run-user-vt)
345             pkgdesc="Run new-style application-mode virtual terminals"
346             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-terminal-management' 'nosh-bundles' )
347             install="nosh-run-user-vt.install"
348             backup=( 'usr/share/system-control/presets/80-enable-user-vt.preset'
349                      'usr/share/system-control/presets/80-linux-ttylogin-vc.preset'
350                      )
351             ;;
352         nosh-run-via-systemd)
353             pkgdesc="Run the nosh service manager and daemontools service scanner via systemd"
354             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'systemd' 'nosh-bundles' )
355             install="nosh-run-via-systemd.install"
356             backup=( 'usr/share/system-control/presets/80-disable-sysinit.preset'
357                      'usr/share/system-control/presets/80-disable-dbus.preset'
358                      'usr/share/system-control/presets/80-disable-local-syslog.preset'
359                      'usr/share/system-control/presets/80-disable-remote-fs.preset'
360                      'usr/share/system-control/presets/80-disable-networking.preset'
361                      'usr/lib/systemd/system/service-manager-svscan.path'
362                      'usr/lib/systemd/system/system-control-normal.service'
363                      'usr/lib/systemd/system/service-manager.socket'
364                      'usr/lib/systemd/system/service-manager-svscan.service'
365                      'usr/lib/systemd/system/vc-getty@.service'
366                      'usr/lib/systemd/system/service-manager.service'
367                      'usr/lib/tmpfiles.d/terminal-emulator.conf'
368                      'usr/lib/tmpfiles.d/service-manager.conf'
369                      'usr/lib/tmpfiles.d/system-manager.conf'
370                      )
371             ;;
372         nosh-run-virtualbox-guest)
373             pkgdesc="Run VirtualBox guest additions"
374             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
375             install="nosh-run-virtualbox-guest.install"
376             backup=( 'usr/share/system-control/presets/80-virtualbox-guest.preset' )
377             ;;
378         nosh-run-freedesktop-system-bus)
379             pkgdesc="Run the system-wide message bus from freedesktop.org"
380             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
381             install="nosh-run-freedesktop-system-bus.install"
382             backup=('usr/share/system-control/presets/80-enable-freedesktop-system-bus.preset' )
383             ;;
384         nosh-run-freedesktop-kits)
385             pkgdesc="Run the various "kit" programs from freedesktop.org"
386             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
387             install="nosh-run-freedesktop-kits.install"
388             backup=( 'usr/share/system-control/presets/40-PackageKit.preset'
389                      'usr/share/system-control/presets/40-PolicyKit.preset'
390                      'usr/share/system-control/presets/40-UPower.preset'
391                      'usr/share/system-control/presets/40-ColourManager.preset'
392                      'usr/share/system-control/presets/40-ConsoleKit.preset'
393                      'usr/share/system-control/presets/40-UDisks.preset'
394                      'usr/share/system-control/presets/40-NetworkManager.preset'
395                      'usr/share/system-control/presets/40-ModemManager.preset'
396                      'usr/share/system-control/presets/40-Avahi.preset'
397                      )
398             ;;
399         nosh-run-openssh-server)
400             pkgdesc="Run the OpenSSH server"
401             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
402             install="nosh-run-openssh-server.install"
403             backup=( 'usr/share/system-control/presets/40-OpenSSHServer.preset' )
404             ;;
405         nosh-run-appletalk)
406             pkgdesc="Run the various AppleTalk service"
407             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
408             backup=( 'usr/share/system-control/presets/40-AppleTalk.preset' )
409             ;;
410         nosh-run-udev)
411             pkgdesc="Run udev as the device manager"
412             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
413             optdepends+=( 'eudev: alternative udev implementation' )
414             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-vdev' 'nosh-run-systemd-udev')
415             install="nosh-run-udev.install"
416             backup=( 'usr/share/system-control/presets/80-enable-udev.preset' )
417             ;;
418         nosh-run-systemd-udev)
419             pkgdesc="Run systemd-udev as the device manager"
420             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles>=1.34' 'systemd')
421             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-vdev' 'nosh-run-udev')
422             install="nosh-run-systemd-udev.install"
423             backup=( 'usr/share/system-control/presets/80-enable-systemd-udev.preset' )
424             ;;
425         nosh-run-busybox-mdev)
426             pkgdesc="Run BusyBox mdev as the device manager"
427             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' 'busybox')
428             conflicts+=('nosh-run-udev' 'nosh-run-suckless-mdev' 'nosh-run-vdev' 'nosh-run-systemd-udev')
429             install="nosh-run-busybox-mdev.install"
430             backup=( 'usr/share/system-control/presets/80-enable-busybox-mdev.preset' )
431             ;;
432         nosh-run-suckless-mdev)
433             pkgdesc="Run SuckLess mdev as the device manager"
434             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' 'smdev')
435             conflicts+=('nosh-run-udev' 'nosh-run-busybox-mdev' 'nosh-run-vdev' 'nosh-run-systemd-udev')
436             install="nosh-run-suckless-mdev.install"
437             backup=( 'usr/share/system-control/presets/80-enable-suckless-mdev.preset' )
438             ;;
439         nosh-run-vdev)
440             pkgdesc="Run vdev as the device manager"
441             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management' 'nosh-bundles' 'vdev-git')
442             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-udev' 'nosh-run-systemd-udev')
443             # no run script so far
444             # install="nosh-run-vdev.install"
445             backup=( 'usr/share/system-control/presets/80-enable-vdev.preset' )
446             ;;
447         nosh-run-local-syslog)
448             pkgdesc="Run the local syslog service"
449             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
450             #conflicts+=( 'systemd' )
451             install="nosh-run-local-syslog.install"
452             backup=( 'usr/share/system-control/presets/80-enable-local-syslog.preset' )
453             ;;
454         nosh-run-klog)
455             pkgdesc="Run the klog service"
456             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
457             #conflicts+=( 'systemd' )
458             install="nosh-run-klog.install"
459             backup=( 'usr/share/system-control/presets/80-enable-klog.preset' )
460             ;;
461     esac
462     
463     # copy over the staging files
464     (cd "${srcdir}"/staging/"${1}"/ && pax -r -w -l -- * "${pkgdir}"/)
465