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