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