Fixed patch directory and checksum.
[archnosh.git] / PKGBUILD
blob5ac92c80befb2ae32f03a2995d2e50fa9e530ec8
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         "staging.patch"
89         "maintenance-scripts.patch"
90         "maintenance.sh"
91         "scriptletbuilder.sh"
92         "nosh-run-udev.post_install.extra"
93         
94         "nosh-bundles.install"
95         "nosh-run-klog.install"
96         "nosh-run-user-vt.install"
97         "nosh-run-local-syslog.install"
98         "nosh-run-via-systemd.install"
99         "nosh-run-busybox-mdev.install"
100         "nosh-run-openssh-server.install"
101         "nosh-run-via-systemd.install"
102         "nosh-run-freedesktop-kits.install"
103         "nosh-run-suckless-mdev.install"
104         "nosh-run-freedesktop-system-bus.install"
105         "nosh-run-system-manager.install"
106         "nosh-run-virtualbox-guest.install"
107         "nosh-run-kernel-vt.install"
108         "nosh-run-udev.install"
109         "nosh-run-debian-server-base.install"
110         "nosh-run-debian-desktop-base.install"
111         "nosh-run-openssh-server.install"
112         )
113 noextract=()
114 sha256sums=('4d8417de969e708c5d6010804981514479e465e73fb5a20444147ef0bcbbead1'
115             '87ad51a0d21fdadf12daa23309559a2599bd3ab5d658582dd73dc54388452251'
116             '305fd4cd53b2cad248d0e452bbcc3a858ff22fccd7ecbf9d117eeb1d2a432f6b'
117             'a196ede02e8ba88708ab111d25b1c1d60e163ac09fc9be3c1783daea2cfc102e'
118             'd2ee01d6d41caa8015eb74eb37525de3d45c5bb071c8785fe245884aa19f20ac'
119             'f90975c663794c7e87be157e03cdfa9bd835c212200539367e848fbbf9fe6cc9'
121             
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             'SKIP'
138             'SKIP'
139             'SKIP'
140             )
141 validpgpkeys=()
143 prepare() {
144     
145         # ncurses headers different to Debian layout, patch out the ncursesw directory in cpp Includes
146     # taken from https://github.com/atweiden/pkgbuilds/blob/master/nosh/PKGBUILD
147         msg2 "Fix ncurses header import issues"
148     cd "${srcdir}"/source
149     find . -type f -print0 | xargs -0 sed -i 's@ncursesw/curses\.h@curses.h@g'
150     
151     # patch package/stage for Archlinux filesystem layout
152     msg2 "Align staging with Arch FS hierarchy guidelines"
153     cd "${srcdir}"/package
154     patch -i "${srcdir}"/staging.patch
155     
156     # patch debian maintenance scripts
157     msg2 "Adapting maintenance scripts"
158     cd "${srcdir}"/package/debian
159     sed -i 's@usr/local/lib@usr/lib@g' nosh-run-via-systemd.postinst.extra
160     cd "${srcdir}"/package
161     patch -p1 -i "${srcdir}"/maintenance-scripts.patch
162     
163     
164     msg2 "Adding extra install scripts"
165     # copy over the nosh-run-udev install files
166     cp -v "${srcdir}"/nosh-run-udev.post_install.extra "${srcdir}"/package/debian/
167     
168     # rename debian maintenance scripts to Archlinux nomenclature
169     msg2 "Renaming maintenance scripts"
170     cd "${srcdir}"/package/debian
171     source "${srcdir}"/maintenance.sh
175 build() {
176           
177     msg2 "Building main source"
178     "${srcdir}"/package/compile
179     
180     msg2 "Generating .install files"
181     source "${srcdir}"/scriptletbuilder.sh
182     for i in ${_pkginstalls[@]}
183     do
184         echo "Bulding $i.install"
185         _buildinstall $i > $i.install
186     done
187     
188     msg2 "Staging packages"
189     # stage packages to 'staging' directory
190     "${srcdir}"/package/stage "${srcdir}" "${srcdir}"/staging
193 check() {
194         # no test available for the moment
195     msg "Checking skipped..."
198 package_nosh-common() {
199     
200     # provide license (can't be done in each package, it creates file conflicts on install)
201     install -Dm 644 "${srcdir}"/source/COPYING "${pkgdir}"/usr/share/licenses/nosh/COPYING
205 # refactor the packaging, need special case for non-conforming package
206 for _pkg in ${pkgname[@]}
208     if test "$_pkg" != "nosh-common"
209     then
210     eval "package_${_pkg}() { _package $_pkg; }"
211     fi
212 done
214 _package() {
216     case "$1" in
217         nosh-zsh-completion)
218             pkgdesc="Z Shell completion functions for the nosh toolset"
219             depends+=( 'nosh-common')
220             optdepends=( 'zsh: for actual ZSH support' )
221             ;;
222         nosh-guide)
223             pkgdesc="User guide for the various nosh-* packages"
224             depends+=( 'nosh-common')
225             ;;
226         nosh-exec)
227             pkgdesc="Minimal non-shell script processor and various chain-load utilities useful for services"
228             depends+=( 'nosh-common')
229             ;;
230         nosh-execline-shims)
231             pkgdesc="Execline utility shims"
232             depends+=( 'nosh-common' 'nosh-exec')
233             conflicts+=( 'execline' )
234             ;;
235         nosh-core-shims)
236             pkgdesc="Core utility shims"
237             depends+=( 'nosh-common' 'nosh-exec')
238             conflicts+=( 'coreutils' 'util-linux' )
239             ;;
240         nosh-service-management)
241             pkgdesc="Service and system management utilities"
242             depends+=( 'nosh-common')
243             conflicts+=( 'nosh-bundles<=1.30')
244             ;;
245         nosh-terminal-management)
246             pkgdesc="Virtual terminal, pseudo-terminal, and TUI login tools"
247             depends+=( 'nosh-common' 'nosh-service-management>=1.14' )
248             conflicts+=( 'nosh-bundles<=1.20')
249             ;;
250         nosh-run-system-manager)
251             pkgdesc="Run the nosh system manager"
252             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'nosh-exec' 'nosh-bundles' 'redo-jdebp')
253             conflicts+=( 'nosh-run-via-systemd' 'upstart' 'sysvinit' 'systemd-sysvcompat') #'systemd' 
254             install="nosh-run-system-manager.install"
255             ;;
256         nosh-ucspi-tcp-shims)
257             pkgdesc="Bernstein UCSPI-TCP shim service utilities"
258             depends+=( 'nosh-common' 'nosh-exec' )
259             conflicts+=( 'ucspi-tcp' 'nosh-exec<=1.32')
260             ;;
261         nosh-terminal-extras)
262             pkgdesc="Extra terminal utilities"
263             depends+=( 'nosh-common' 'nosh-terminal-management' )
264             ;;
265         nosh-systemd-shims)
266             pkgdesc="Systemd shim service and system management utilities"
267             depends+=( 'nosh-common' 'nosh-service-management' )
268             conflicts+=( 'systemd' )
269             ;;
270         nosh-systemv-shims)
271             pkgdesc="BSD and System 5 shim service and system management utilities"
272             depends+=( 'nosh-common' 'nosh-service-management' )
273             conflicts+=( 'systemd-sysvcompat')
274             ;;
275         nosh-upstart-shims)
276             pkgdesc="Upstart shim service and system management utilities"
277             depends+=( 'nosh-common' 'nosh-service-management' )
278             ;;
279         nosh-debian-shims)
280             pkgdesc="Debian shim service and system management utilities"
281             depends+=( 'nosh-common' 'nosh-service-management' )
282             conflicts+=( 'nosh-run-via-systemd' 'upstart' 'sysvinit' 'systemd' )
283             ;;
284         nosh-openbsd-shims)
285             pkgdesc="OpenBSD shim service and system management utilities"
286             depends+=( 'nosh-common' 'nosh-service-management' 'nosh-systemv-shims<=1.28' )
287             conflicts+=( 'nosh-systemv-shims<=1.27')
288             ;;
289         nosh-bsd-shims)
290             pkgdesc="BSD shim service and system management utilities"
291             depends+=( 'nosh-common' 'nosh-service-management' )
292             conflicts+=( 'android-tools' )
293             ;;
294         nosh-kbd-shims)
295             pkgdesc="shim kbd utilities"
296             depends+=( 'nosh-common' 'nosh-terminal-management' )
297             conflicts+=( 'kbd')
298             ;;
299         nosh-bundles)
300             pkgdesc="Service bundles"
301             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'nosh-exec>=1.32' 'nosh-terminal-management>=1.22' 'shadow' )
302             install="nosh-bundles.install"
303             ;;
304         nosh-run-via-systemd)
305             pkgdesc="Run the nosh service manager and daemontools service scanner via systemd"
306             depends+=( 'nosh-common' 'nosh-service-management>=1.33' 'systemd' 'nosh-bundles' )
307             install="nosh-run-via-systemd.install"
308             ;;
309         nosh-run-kernel-vt)
310             pkgdesc="Run old-style kernel virtual terminals"
311             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-terminal-management' 'nosh-bundles' )
312             install="nosh-run-kernel-vt.install"
313             ;;
314         nosh-run-udev)
315             pkgdesc="Run udev as the device manager"
316             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.16' 'nosh-bundles' 'systemd')
317             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-vdev')
318             install="nosh-run-udev.install"
319             ;;
320         nosh-run-busybox-mdev)
321             pkgdesc="Run BusyBox mdev as the device manager"
322             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.16' 'nosh-bundles' 'busybox')
323             conflicts+=('nosh-run-udev' 'nosh-run-suckless-mdev' 'nosh-run-vdev')
324             install="nosh-run-busybox-mdev.install"
325             ;;
326         nosh-run-suckless-mdev)
327             pkgdesc="Run SuckLess mdev as the device manager"
328             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.16' 'nosh-bundles' 'smdev')
329             conflicts+=('nosh-run-udev' 'nosh-run-busybox-mdev' 'nosh-run-vdev')
330             install="nosh-run-suckless-mdev.install"
331             ;;
332         nosh-run-vdev)
333             pkgdesc="Run vdev as the device manager"
334             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management' 'nosh-bundles' 'vdev-git')
335             conflicts+=('nosh-run-busybox-mdev' 'nosh-run-suckless-mdev' 'nosh-run-udev')
336             # no run script so far
337             # install="nosh-run-vdev.install"
338             ;;
339         nosh-run-user-vt)
340             pkgdesc="Run new-style application-mode virtual terminals"
341             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-terminal-management' 'nosh-bundles' )
342             install="nosh-run-user-vt.install"
343             ;;
344         nosh-run-freedesktop-system-bus)
345             pkgdesc="Run the system-wide message bus from freedesktop.org"
346             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
347             install="nosh-run-freedesktop-system-bus.install"
348             ;;
349         nosh-run-freedesktop-kits)
350             pkgdesc="Run the various "kit" programs from freedesktop.org"
351             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
352             install="nosh-run-freedesktop-kits.install"
353             ;;
354         nosh-run-virtualbox-guest)
355             pkgdesc="Run VirtualBox guest additions"
356             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
357             install="nosh-run-virtualbox-guest.install"
358             ;;
359         nosh-run-klog)
360             pkgdesc="Run the klog service"
361             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
362             #conflicts+=( 'systemd' )
363             install="nosh-run-klog.install"
364             ;;
365         nosh-run-local-syslog)
366             pkgdesc="Run the local syslog service"
367             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
368             #conflicts+=( 'systemd' )
369             install="nosh-run-local-syslog.install"
370             ;;
371         nosh-run-debian-server-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-desktop-base' 'nosh-bundles<=1.32')
375             install="nosh-run-debian-server-base.install"
376             ;;  
377         nosh-run-debian-desktop-base)
378             pkgdesc="Run the local syslog service"
379             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles>=1.33' 'nosh-terminal-management' )
380             conflicts+=( 'nosh-run-server-base' 'nosh-bundles<=1.32')
381             install="nosh-run-debian-desktop-base.install"
382             ;;  
383         nosh-run-openssh-server)
384             pkgdesc="Run the OpenSSH server"
385             depends+=( 'nosh-common' 'nosh-exec' 'nosh-service-management>=1.33' 'nosh-bundles' )
386             install="nosh-run-openssh-server.install"
387             ;;  
388     esac
389     
390     # copy over the staging files
391     (cd "${srcdir}"/staging/"${1}"/ && pax -r -w -l -- * "${pkgdir}"/)
392