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