forked from TermuxArch/TermuxArch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archlinuxconfig.bash
2354 lines (2203 loc) · 126 KB
/
archlinuxconfig.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
## https://sdrausty.github.io/TermuxArch/README has info about this project.
## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
################################################################################
_DPTCHHLP_() { printf "%s\\n%s\\n" "[ -e $INSTALLDIR$TMXRCHBNDR/am ] || cp -f $PREFIX/bin/am $INSTALLDIR$TMXRCHBNDR/am" "[ -e $INSTALLDIR$TMXRCHBNDR/patch ] || cp -f $PREFIX/bin/patch $INSTALLDIR$TMXRCHBNDR/patch" >> "$1" ; }
_PRTPATCHHELP_() { printf "%s\\n" "[ -e $TMXRCHBNDR/patch ] || printf \"\\e[1;30m%s\\e[0;40m%s\\e[1;30m%s\\e[0;40m%s\\e[1;30m%s\\e[0;40m%s\\e[1;30m%s\\e[0;40m%s\\e[1;30m%s\\e[0m\\n\" \"This command \" \"'ln -s $PREFIX/bin/patch $INSTALLDIR$TMXRCHBNDR/patch'\" \" should resolve a \" \"'patch: setting attribute security.selinux for security.selinux: Permission denied'\" \" error. This workaround seems to work equally well in Termux PRoot with QEMU architecture emulation as well. Issues \" \"“Building xrdp from AUR fails mentioning selinux #293”\" \" at https://github.com/SDRausty/TermuxArch/issues/293 and \" \"“patch: setting attribute security.selinux for security.selinux: Permission denied #182”\" \" at https://github.com/termux/proot/issues/182 have more information about this error.\"" >> "$1" ; }
_PRTRTHLP_() {
printf "%s\\n" "if [ \"\$EUID\" = 0 ] || [ \"\$UID\" = 0 ]
then
printf \"\\e[1;31m%s\\e[1;37m%s\\e[1;31mExiting... \\e[0m\" \"TermuxArch \${SRPTNM^^} SIGNAL:\" \" Command '\$SRPTNM' should not be used by the root user account. The command 'addauser' creates user accounts in Arch Linux in Termux PRoot QEMU and configures these user accounts for the Arch Linux 'sudo' command. The 'addauser' command can be run by the Arch Linux in Termux PRoot root and user accounts. This command can be run '$STARTBIN command 'addauser user'' directly from Termux to create this account in Arch Linux Termux PRoot QEMU. The command '$STARTBIN help' has more information about how to use '$STARTBIN'. \"
exit 101
fi" >> "$1"
}
_ADDREADME_() {
_CFLHDR_ "$TMXRCHBNDS"/README.md
printf "%s\\n" "The $TMXRCHBNDR directory contains TermuxArch shortcut commands that automate and make using the command line easier. Some of these commands are listed here:
* Command 'addauser' creates Arch Linux user accounts in Termux PRoot QEMU and configures them for use with the Arch Linux 'sudo' command,
* Command 'cams' records from device cameras,
* Command 'csystemctl' replaces systemctl with https://github.com/TermuxArch/docker-systemctl-replacement,
* Command 'em' is a 'uemacs' editor shortcut command that builds and installs and then runs the uemacs editor.
* Command 'keys' installs Arch Linux keys,
* Command 'gcl https://github.com/indigo-dc/udocker' will clone 'udocker', a basic user tool to execute simple docker containers in user space without requiring root privileges,
* Command 'makeaurhelpers' attempts to build and install AUR helper package installer commands,
* Command 'patchmakepkg' patches the Arch Linux 'makepkg' command for use in Termux PRoot QEMU,
* Command 'pc' is a pacman shortcut command; 'cw pc' in order to learn more,
* Command 'pci' is a pacman shortcut command; 'cw pci' in order to learn more,
* Command 'tour' runs a short tour of the TermuxArch Linux system,
* Command 'trim' moves the downloaded packages from the Arch Linux system directories into a cache directory,
* Command 'yt' is a youtube shortcut command that installs and runs the command 'youtube-dl',
* Command 'v' is a 'vim' editor shortcut command that installs and runs the vim editor.
This command 'ls $TMXRCHBNDR && cat ~/.bashrc' issued in a Termux PRoot QEMU environment will show installed TermuxArch commands. This README.md file can be expanded so a beginning user can get to know the *nix experience easier. Would you like to create an issue along with a pull request to add information to this file so that a beginning user can get to know the Arch Linux in Termux PRoot experience much easier? If you would like to expand this README.md file to encapsulate and enhance the newbie *nix experience, then please visit these links:
* Comments are welcome at https://github.com/TermuxArch/TermuxArch/issues ✍
* Pull requests are welcome at https://github.com/TermuxArch/TermuxArch/pulls ✍
<!-- $INSTALLDIR$TMXRCHBNDR/README.md FE -->" > "$TMXRCHBNDS"/README.md
}
_ADDae_() {
_CFLHDR_ "$TMXRCHBNDS"/ae "# Developed at [pacman-key --populate archlinux hangs](https://github.com/SDRausty/TermuxArch/issues/33) Contributor cb125"
printf "%s\\n" "watch cat /proc/sys/kernel/random/entropy_avail
## $INSTALLDIR$TMXRCHBNDR/ae FE" >> "$TMXRCHBNDS"/ae
chmod 755 "$TMXRCHBNDS"/ae
}
_ADDbash_logout_() {
printf "%s\\n" "[ ! -f \"\$HOME\"/.hushlogout ] && [ ! -f \"\$HOME\"/.chushlogout ] && . /etc/moto
h
## .bash_logout FE" > root/.bash_logout
}
_ADDbash_profile_() {
[ -e root/.bash_profile ] && _DOTHRF_ "root/.bash_profile"
printf "%s\\n%s\\n%s\\n%s\\n" "PPATH=\"\$PATH\"" "# [ -d /system/xbin ] && PATH=\"/system/xbin\"" "# [ -d /system/sbin ] && PATH=\"/system/sbin:\$PATH\"" "# [ -d /system/bin ] && PATH=\"/system/bin:\$PATH\"" > root/.bash_profile
if [ -d "$INSTALLDIR"/usr/local/texlive ]
then
TEXLIVEPATH="$(find "$INSTALLDIR"/usr/local/texlive/*/bin/ -maxdepth 1 | tail -n 1)"
TEXLIVEPATH="${TEXLIVEPATH#*"${INSTALLDIR##*/}"}"
TEXDIR="${TEXLIVEPATH%/*}"
TEXDIR="${TEXDIR%/*}"
printf "%s\\n" "PATH=\"\$HOME/bin:$TMXRCHBNDR:$TEXLIVEPATH:\$PPATH\"" >> root/.bash_profile
else
printf "%s\\n" "PATH=\"\$HOME/bin:$TMXRCHBNDR:\$PPATH\"" >> root/.bash_profile
fi
printf "%s\\n" "[ -f \"\$HOME\"/.bashrc ] && . \"\$HOME\"/.bashrc" >> root/.bash_profile
printf "%s\\n" "[ -f \"\$HOME\"/.profile ] && . \"\$HOME\"/.profile" >> root/.bash_profile
printf "%s\\n" "if [ ! -e \"\$HOME\"/.hushlogin ] && [ ! -e \"\$HOME\"/.chushlogin ]
then
[ -e /etc/mota ] && . /etc/mota
fi
if [ -e \"\$HOME\"/.chushlogin ]
then
rm -f \"\$HOME\"/.chushlogin
fi
PS1=\"\\[\\e[38;5;148m\\]\\u\\[\\e[1;0m\\]\\A\\[\\e[1;38;5;112m\\]\\W\\[\\e[0m\\]$ \"" >> root/.bash_profile
[[ ! -f "$HOME"/.bash_profile ]] || grep proxy "$HOME"/.bash_profile | grep -s "export" >> root/.bash_profile ||:
[[ ! -f "$HOME"/.bash_profile ]] || grep EDITOR "$HOME"/.bash_profile | grep -s "export" >> root/.bash_profile ||:
SHELVARS=" ANDROID_ART_ROOT ANDROID_DATA ANDROID_I18N_ROOT ANDROID_ROOT ANDROID_RUNTIME_ROOT ANDROID_TZDATA_ROOT BOOTCLASSPATH DEX2OATBOOTCLASSPATH"
for SHELVAR in ${SHELVARS[@]}
do
ISHELVAR="$(export | grep "$SHELVAR" || printf '%s\n' 1)"
if [[ "$ISHELVAR" != 1 ]]
then
printf "export %s\\n" "${ISHELVAR/declare -x }" >> root/.bash_profile
fi
done
printf "%s\\n" "export GPG_TTY=\"\$(tty)\"" >> root/.bash_profile
printf "%s\\n" "export MOZ_FAKE_NO_SANDBOX=1" >> root/.bash_profile
printf "%s\\n" "export PULSE_SERVER=127.0.0.1" >> root/.bash_profile
if [ -d "$INSTALLDIR"/usr/local/texlive ]
then
printf "%s\\n" "[ -d \"$TEXDIR\" ] && export TEXDIR=\"$TEXDIR\"" >> root/.bash_profile
printf "%s\\n" "[ -d \"\$HOME\"/.texlive2021/texmf-config ] && export TEXMFCONFIG=\"\$HOME/.texlive2021/texmf-config\"" >> root/.bash_profile
printf "%s\\n" "[ -d \"\$HOME\"/texmf ] && export TEXMFHOME=\"\$HOME/texmf\"" >> root/.bash_profile
printf "%s\\n" "[ -d /usr/local/texlive/texmf-local ] && export TEXMFLOCAL=\"/usr/local/texlive/texmf-local\"" >> root/.bash_profile
printf "%s\\n" "[ -d $TEXDIR/texmf-config ] && export TEXMFSYSCONFIG=\"$TEXDIR/texmf-config\"" >> root/.bash_profile
printf "%s\\n" "[ -d $TEXDIR/texmf-var ] && export TEXMFSYSVAR=\"$TEXDIR/texmf-var\"" >> root/.bash_profile
printf "%s\\n" "[ -d \"\$HOME\"/.texlive2021/texmf-var ] && export TEXMFVAR=\"\$HOME/.texlive2021/texmf-var\"" >> root/.bash_profile
fi
printf "%s\\n" "export TZ=\"$(getprop persist.sys.timezone)\"
## .bash_profile FE" >> root/.bash_profile
}
_ADDbashrc_() {
[ -e root/.bashrc ] && _DOTHRF_ "root/.bashrc"
cat > root/.bashrc <<- EOM
function _AM_() {
command -v am 1>/dev/null || cp "$PREFIX"/bin/am "$TMXRCHBNDR"
}
function _PWD_() {
printf '%s\n' "\$PWD"
}
function git-branch() {
if [ -d .git ]
then
printf "%s" "(\$(git branch | awk '/\*/{print \$2}'))";
fi
}
function em() {
[ -x /usr/bin/make ] || { pc base base-devel || pci base base-devel ; }
{ [ -x $TMXRCHBNDR/uemacs ] && $TMXRCHBNDR/uemacs "\$@" ; } || { { { cd || exit 69 ; } && [ -d uemacs ] || gcl https://github.com/torvalds/uemacs ; } && { [ -d uemacs ] && { cd uemacs || exit 69 ; } ; } && printf '%s\\n' "making uemacs" && make && cp -f em $TMXRCHBNDR/uemacs && make clean && $TMXRCHBNDR/uemacs emacs.hlp ; }
}
alias ..='cd ../.. && _PWD_'
alias ...='cd ../../.. && _PWD_'
alias ....='cd ../../../.. && _PWD_'
alias .....='cd ../../../../.. && _PWD_'
alias aiabrowser='_AM_ && am start -a android.intent.action.VIEW -d "content://com.android.externalstorage.documents/root/primary"' ## Reference [Android 11 (with Termux storage permission denied) question; What's the source for the shortcut to the file manager of the settings app?](https://www.reddit.com/r/termux/comments/msq7lm/android_11_with_termux_storage_permission_denied/) Contributors u/DutchOfBurdock u/xeffyr
alias aiachrome='_AM_ && am start --user 0 -n com.android.chrome/com.google.android.apps.chrome.Main' ## Reference [Can I start an app from Termux's command line? How?](https://www.reddit.com/r/termux/comments/62zi71/can_i_start_an_app_from_termuxs_command_line_how/) Contributors u/u/fornwall u/Kramshet
alias aiadial='_AM_ && am start -a android.intent.action.DIAL'
alias aiafilemanager='_AM_ && am start -a android.intent.action.VIEW -d "content://com.android.externalstorage.documents/root/primary"'
alias aiasearch='_AM_ && am start -a android.intent.action.SEARCH'
alias aiaview='_AM_ && am start -a android.intent.action.VIEW'
alias aiaviewd='_AM_ && am start -a android.intent.action.VIEW -d '
alias aiawebsearch='_AM_ && am start -a android.intent.action.WEB_SEARCH'
alias C='cd .. && _PWD_'
alias c='cd .. && _PWD_'
alias CN='cat -n \$(command -v' # use a close parenthesis ) to complete this alias
alias Cn='cat -n \$(command -v' # use a close parenthesis ) to complete this alias
alias cn='cat -n \$(command -v' # use a close parenthesis ) to complete this alias
alias CW='cat \$(command -v' # use a close parenthesis ) to complete this alias
alias Cw='cat \$(command -v' # use a close parenthesis ) to complete this alias
alias cw='cat \$(command -v' # use a close parenthesis ) to complete this alias
alias CR='cp -r'
alias Cr='cp -r'
alias cr='cp -r'
alias CUO='curl -C - --fail --retry 4 -O'
alias Cuo='curl -C - --fail --retry 4 -O'
alias cuo='curl -C - --fail --retry 4 -O'
alias CUOL='curl -C - --fail --retry 4 -OL'
alias Cuol='curl -C - --fail --retry 4 -OL'
alias cuol='curl -C - --fail --retry 4 -OL'
alias D='nice -n 20 du -hs'
alias d='nice -n 20 du -hs'
alias DFA='df | grep storage\/emulated'
alias Dfa='df | grep storage\/emulated'
alias dfa='df | grep storage\/emulated'
alias DFT='df | grep storage\/'
alias Dft='df | grep storage\/'
alias dft='df | grep storage\/'
alias E='exit'
alias e='exit'
alias F='nice -n 20 grep -n --color=always'
alias f='nice -n 20 grep -n --color=always'
alias G='ga ; gcm ; gp'
alias g='ga ; gcm ; gp'
alias GITS='git show'
alias Gits='git show'
alias gits='git show'
alias GCA='git commit -a -S'
alias Gca='git commit -a -S'
alias gca='git commit -a -S'
alias GCAM='git commit -a -S -m'
alias Gcam='git commit -a -S -m'
alias gcam='git commit -a -S -m'
alias H='history >> \$HOME/.historyfile'
alias h='history >> \$HOME/.historyfile'
alias HW='head \$(command -v' # use a close parenthesis ) to complete this alias
alias Hw='head \$(command -v' # use a close parenthesis ) to complete this alias
alias hw='head \$(command -v' # use a close parenthesis ) to complete this alias
alias J='jobs'
alias j='jobs'
alias I='whoami'
alias i='whoami'
alias L='ls -al --color=always'
alias l='ls -al --color=always'
alias LA='ls -alR --color=always'
alias La='ls -alR --color=always'
alias la='ls -alR --color=always'
alias LS='ls --color=always'
alias Ls='ls --color=always'
alias ls='ls --color=always'
alias LR='ls -alR --color=always'
alias Lr='ls -alR --color=always'
alias lr='ls -alR --color=always'
alias MEMAV='grep -i available /proc/meminfo'
alias Memav='grep -i available /proc/meminfo'
alias MEMFREE='grep -i free /proc/meminfo'
alias Memfree='grep -i free /proc/meminfo'
alias MEMINFO='cat /proc/meminfo'
alias Meminfo='cat /proc/meminfo'
alias MEMTOT='grep -i total /proc/meminfo'
alias Memtot='grep -i total /proc/meminfo'
alias MKDIP='mkdir -p'
alias Mkdip='mkdir -p'
alias mkdip='mkdir -p'
alias N2='nice -n -20'
alias n2='nice -n -20'
alias P='_PWD_'
alias p='_PWD_'
alias PCS='pacman -S'
alias Pcs='pacman -S'
alias pcs='pacman -S'
alias PCSS='pacman -Ss'
alias Pcss='pacman -Ss'
alias pcss='pacman -Ss'
alias PF='printf "%s\n"'
alias Pf='printf "%s\n"'
alias pf='printf "%s\n"'
alias PX='ps aux'
alias Px='ps aux'
alias px='ps aux'
alias Q='exit'
alias q='exit'
alias RMD='rmdir -p'
alias Rmd='rmdir -p'
alias rmd='rmdir -p'
alias TO='termux-open'
alias To='termux-open'
alias to='termux-open'
alias TW='tail \$(command -v' # use a close parenthesis ) to complete this alias
alias Tw='tail \$(command -v' # use a close parenthesis ) to complete this alias
alias tw='tail \$(command -v' # use a close parenthesis ) to complete this alias
alias V='v'
alias v='v'
alias UM='uname -m'
alias Um='uname -m'
alias um='uname -m'
EOM
[ ! -f "$HOME"/.bashrc ] ||grep -s EDITOR "$HOME"/.bashrc | grep -s "export" >> root/.bashrc ||:
[ ! -f "$HOME"/.bashrc ] || grep -s proxy "$HOME"/.bashrc | grep -s "export" >> root/.bashrc ||:
printf "%s\\n" "## .bashrc FE" >> root/.bashrc
}
_ADDcams_() {
_CFLHDR_ "$TMXRCHBNDS"/cams "### Example usage: 'cams 0 255 16 2048 r 90 2'
### Loop example: 'while true ; do cams ; done'
### Semantics: [camid [totalframes+1 [framespersecond [threshold [r[otate] [degrees [exitwait]]]]]]]
### Please run 'au ffmpeg imagemagick termux-api' before running this script. Also ensure that Termux-api is installed, which is available at this https://github.com/termux/termux-api/actions/workflows/debug_build.yml webpage.
### VLC media player APK can be downloaded from these https://www.videolan.org/vlc/download-android.html and https://get.videolan.org/vlc-android/3.3.4/ webpages.
### More options in addition to image checking and rotation can be added by editing this file at the magick rotation command; The command line options for magick are listed at this https://imagemagick.org/script/command-line-options.php webpage.
### Seven arguments are listed below, including their default values; If run with no arguments, the default values will be used:"
cat >> "$TMXRCHBNDS"/cams <<- EOM
[[ -n "\${1:-}" ]] && { [[ "\${1//-}" = [\/]* ]] || [[ "\${1//-}" = [?]* ]] || [[ "\${1//-}" = [Hh]* ]] ; } && { printf '\e[1;32m%s\n' "Help for '\${0##*/}':" && TSFILE="(\$(grep '##\ ' "\$0"))" && printf '\e[0;32m%s\e[1;32m\n%s\n' "\$(for HL in "\${TSFILE[@]}" ; do cut -d\) -f1 <<< "\${HL//###/ }" | cut -f 2 ; done )" "Help for '\${0##*/}': DONE" ; exit ; }
[[ -n "\${1:-}" ]] && { [[ "\${1//-}" = [Pp]* ]] && POCKET=0 && CAMID=2 && printf '%s\\n' pocket || CAMID=\${1:-2} ; }
[[ -z "\${1:-}" ]] && CAMID=2 ### [1] default 2: One camera 0 1 2 3 4 5 6 7 id,
FRAMECTOT=\${2:-11} ### [2] default 11: Total frame count + 1,
FRAMERATE=\${3:-1} ### [3] default 1: Video 0.5 1 2 4 8 16 32 frames per second rendered in the mpg file,
THRESHOLDSET=\${4:-256} ### [4] default 256: Byte difference 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 between last two picture frames taken; Can be used for motion detection. The greater the number, the lesser the sensitivity. Camera resolution also affects this argument,
_CAMS_ () {
while [ "\$FRAMECOUNT" -le "\$FRAMECTOT" ]
do
LTSENSOR="\$(termux-sensor -n 1 -s "LIGHT" | grep -A 1 -w values | tail -n 1 || printf 1)"
LTSENSOR="\${LTSENSOR//\,/}"
LTSENSOR="\${LTSENSOR//\./}"
LTSENSOR="\${LTSENSOR#"\${LTSENSOR%%[!0]*}"}"
LTSENSOR="\$((LTSENSOR))"
if [ "\$LTSENSOR" -eq 0 ] || [ "\$LTSENSOR" -eq 1 ]
then
printf '\e[0;36m%s\e[0m\n' "IM light sensor wait; sleeping 4 seconds."
sleep 4
else
{ [[ "\${POCKET:-}" == 0 ]] && _CAMSSENSORS_ "\$@" ; } || _CAMSCORE_ "\$@"
fi
done
}
_CAMSSENSORS_ () {
ITSENSOR="\$(termux-sensor -n 1 -s "IN_POCKET" | grep 1|| printf 0)"
PYSENSOR="\$(termux-sensor -n 1 -s "PROXIMITY" | grep 1|| printf 0)"
if [ "\${ITSENSOR//,}" -eq 1 ] || [ "\$PYSENSOR" -eq 1 ]
then
_CAMSCORE_ "\$@"
else
printf '\e[0;36m%s\e[0m\n' "IM sensors wait; sleeping."
sleep 4
fi
}
_CAMSCORE_ () {
FRAMENAME="camid\$(printf '%s.%04d.jpg' "\$CAMID" "\$FRAMECOUNT")"
printf '\e[0;32m%s\e[1;32m%s\e[0;32m%s\e[1;32m%s\e[0;32m%s\n\e[0;32m%s' "IT " "\$((FRAMECOUNT + 1))/\$((FRAMECTOT + 1))" " frame count: " "\${THRESHOLDSET:-} threshold" " set" "IP camid \$CAMID taking picture \$FRAMENAME: "
:>"\$PWD/\$FRAMENAME"
sleep 0.42 # Adjust for device being used; This sleep may be unnecessary.
"\${PREFIX:-/data/data/com.termux/files/usr}"/libexec/termux-api CameraPhoto --es camera "\$CAMID" --es file "\$PWD/\$FRAMENAME"
_CAM1_ () { FRAMENAME1="camid\$(printf '%s.%04d.jpg' "1" "\$FRAMECOUNT")" && [ -e "\$PWD/\$FRAMENAME1" ] || "\${PREFIX:-/data/data/com.termux/files/usr}"/libexec/termux-api CameraPhoto --es camera "1" --es file "\$PWD/\$FRAMENAME1" ; } && _CAM1_
printf '\e[0;32m%s\n' "DONE"
_ISZERO_ "\$@"
}
_CHECKMOTIONDIFF_() {
if [ "\$FRAMECOUNT" -ne 0 ]
then
THRESHOLD="\$((LASTZERO - ISZERO))"
THRESHOLD="\${THRESHOLD//-}"
if [ "\$THRESHOLD" -le "\$THRESHOLDSET" ]
then
printf '\e[0;2m%s\n' "ID \$THRESHOLD/\$THRESHOLDSET threshold: deleting file \$FRAMENAME"
rm -f "\$FRAMENAME"
OLDISZERO="\$ISZERO"
fi
fi
}
_ISZERO_ () {
if [ -n "\${ISZERO:-}" ]
then
LASTZERO="\$ISZERO"
fi
ISZERO="\$(find . -type f -name "\$FRAMENAME" -printf "%s")"
printf '\e[0;36m%s\e[1;36m%s\n' "IS framename \$FRAMENAME size: " "\$ISZERO"
if [ "\$ISZERO" -eq 0 ]
then
ISZERO="\${OLDISZERO:-}"
printf '\e[0;33m%s' "E0 deleting zero size file \$FRAMENAME: "
rm -f "\$FRAMENAME"
printf '\e[0;32m%s\n' "DONE"
E0VAR=1
fi
if [[ \${E0VAR:-} == 0 ]]
then
_CHECKMOTIONDIFF_
_MAGICKCK_ "\$@"
else
E0VAR=0
fi
}
_MAKEDIRS_ () {
CAMD="camid\$CAMID"
[ -e "output/\$CAMD/\$CAMD\$TIMESTAMP" ] || { printf '\e[0;36m%s' "IM mkdir -p output/\$CAMD/\$CAMD\$TIMESTAMP: " && mkdir -p output/"\$CAMD/\$CAMD\$TIMESTAMP" && printf '\e[0;32m%s\n' "DONE"; }
[ -e output/gifs/"\$CAMD" ] || { printf '\e[0;36m%s' "IM mkdir -p output/gifs/\$CAMD: " && mkdir -p output/gifs/"\$CAMD" && printf '\e[0;32m%s\n' "DONE"; }
[ -e output/webms/"\$CAMD" ] || { printf '\e[0;36m%s' "IM mkdir -p output/webms/\$CAMD: " && mkdir -p output/webms/"\$CAMD" && printf '\e[0;32m%s\n' "DONE"; }
printf '\e[0;36m%s' "IM cd output/\$CAMD/\$CAMD\$TIMESTAMP: " && { cd output/"\$CAMD/\$CAMD\$TIMESTAMP" || exit 69 ; } && printf '\e[0;32m%s\n' "DONE"
}
_MAGICKCK_ () {
if [ -e "\$FRAMENAME" ]
then
printf '\e[0;36m%s' "IC checking file \$FRAMENAME for errors: "
MAGICKCK="\$(nice -n 20 magick identify "\$FRAMENAME" 2>&1 ||:)"
if grep -i error <<< "\$MAGICKCK"
then
printf '\e[0;31m%s\e[0m\n' "ERROR"
rm -f "\$FRAMENAME"
printf '\e[0;31m%s\n\e[0;36m%s\n' "ED deleted file \$FRAMENAME: ERROR" "IR redoing file \$FRAMENAME..."
else
printf '\e[0;32m%s\n' "DONE"
FRAMECOUNT="\$((FRAMECOUNT + 1))"
printf '\e[0;32m%s\e[1;32m%s\e[0;32m%s\n' "IF " "file \$FRAMENAME added" " to que."
if [ -n "\${5:-}" ]
then
if [[ "\${5//-}" = [Rr]* ]] ### [5] default no rotation: R|r[otate]: useful for portrait orientation. You can use R or r to activate rotation which is preset to 90° rotation. The sixth argument can be used to enter a rotation angle to change the preset 90° rotation,
then
printf '\e[0;36m%s' "IR rotating file \$FRAMENAME by \${6:-90}°: " ### [6] default 90°: Enter desired picture rotation angle in digits if you want to use 180° and 270° degree rotation. Other rotation angles can also be used,
nice -n 20 magick "\$FRAMENAME" -rotate "\${6:-90}" "\$FRAMENAME".jpg
mv "\$FRAMENAME".jpg "\$FRAMENAME"
printf '\e[0;32m%s\n' "DONE"
fi
fi
fi
fi
}
_MECONVERT_ () {
printf '\e[0;36m%s\e[0m\n' "IM making camid\$CAMID.\$TIMESTAMP.gif: This job will complete in the background..." && nice -n 20 convert -delay "\$((FRAMERATE * 100))" -loop 0 "\$CAMD."*.jpg "\$CAMD.\$TIMESTAMP".gif && { ls -al "\$CAMD.\$TIMESTAMP".gif && printf '\e[0;32m%s\e[0m\n' "IM making camid\$CAMID.\$TIMESTAMP.gif: DONE" ; } || printf '\e[1;31m%s\e[0m\n' "EM creating camid\$CAMID.\$TIMESTAMP.gif: ERROR"
printf '\e[0;36m%s' "IM mv camid\$CAMID.\$TIMESTAMP.gif ../../gifs/\$CAMD: " && mv "\$CAMD.\$TIMESTAMP".gif ../../gifs/\$CAMD && printf '\e[0;32m%s\e[0m\n' "DONE"
}
_MEFFMPEG_ () {
# To start at frame 20 and finish at frame 420: ffmpeg -start_number 20 -i filename%04d.jpg -vframes 400 video.webm
printf '\e[0;36m%s\e[0m\n' "IM making camid\$CAMID.\$TIMESTAMP.webm: This job will complete in the background..." && nice -n 20 ffmpeg -framerate "\$FRAMERATE" -i "\$CAMD."%04d.jpg -movflags +faststart -c:v libvpx-vp9 -g 1 "\$CAMD.\$TIMESTAMP".webm && { ls -al "\$CAMD.\$TIMESTAMP".webm && printf '\e[0;32m%s\e[0m\n' "IM making camid\$CAMID.\$TIMESTAMP.webm: DONE" ; } || printf '\e[1;31m%s\e[0m\n' "EM creating camid\$CAMID.\$TIMESTAMP.webm: ERROR"
printf '\e[0;36m%s' "IM mv camid\$CAMID.\$TIMESTAMP.webm ../../webm/\$CAMD; " && mv "\$CAMD.\$TIMESTAMP".webm ../../webms/\$CAMD && printf '\e[0;32m%s\e[0m\n' "DONE"
}
printf '\e[0;34m%s\e[1;36m%s\e[0;34m%s' "Starting command " "termux-wake-lock" ": "
am startservice --user 0 -a com.termux.service_wake_lock com.termux/com.termux.app.TermuxService 1>/dev/null && printf '\e[0;32m%s\n\e[0;34m%s\e[1;36m%s\e[0;34m%s\n' "DONE" "Command " "termux-wake-unlock" " stops the wake lock." || printf '\e[0;33m%s\e[0m\n' "UTP am startservice: Continuing..."
E0VAR=0 # used to process zero size files
FRAMECOUNT=0 # initial frame count
TIMESTAMP="\$(date +%Y%m%d%H%M%S)"
_MAKEDIRS_ "\${1:-2}"
_CAMS_ "\$@"
_MECONVERT_ &
_MEFFMPEG_ &
PSAUX="(\$(ps aux))"
PSAUX="\$(grep -e convert -e ffmpeg <<< "\${PSAUX[@]}" | cut -d":" -f 2-9999 | cut -d " " -f 2-9999 ||:)"
printf '\e[0;34m%s\e[1;36m%s\n\e[1;32m%s\n' "IM " "running these background jobs:" "\${PSAUX[@]}"
printf '\e[0;34m%s\e[1;36m%s\e[0;34m%s\n' "IM " "ps aux" " shows processes running."
printf '\e[0;34m%s\e[1;36m%s\e[0;34m%s\e[0m\n' "The command " "termux-wake-unlock" " stops the wake lock."
sleep "\${7:-4}" ### [7] default of four seconds: Time before exit; Programs 'convert' and 'ffmpeg' will continue to run in the background until their jobs of producing animated gif and webm files end.
## $INSTALLDIR$TMXRCHBNDR/cams FE
EOM
chmod 755 "$TMXRCHBNDS"/cams
}
_ADDcdtd_() {
_CFLHD_ "$TMXRCHBNDS"/cdtd "# Usage: \`. cdtd\` the dot sources \`cdtd\` which makes this shortcut script work."
printf "%s\\n" "#!/usr/bin/env bash
cd $HOME/storage/downloads && pwd
## $INSTALLDIR$TMXRCHBNDR/cdtd FE" >> "$TMXRCHBNDS"/cdtd
chmod 755 "$TMXRCHBNDS"/cdtd
}
_ADDcdth_() {
_CFLHD_ "$TMXRCHBNDS"/cdth "# Usage: \`. cdth\` the dot sources \`cdth\` which makes this shortcut script work."
printf "%s\\n" "#!/usr/bin/env bash
cd $HOME && pwd
## $INSTALLDIR$TMXRCHBNDR/cdth FE" > "$TMXRCHBNDS"/cdth
chmod 755 "$TMXRCHBNDS"/cdth
}
_ADDcdtmp_() {
_CFLHD_ "$TMXRCHBNDS"/cdtmp "# Usage: \`. cdtmp\` the dot sources \`cdtmp\` which makes this shortcut script work."
printf "%s\\n" "#!/usr/bin/env bash
cd $TMPDIR && pwd || exit 69
## $INSTALLDIR$TMXRCHBNDR/cdtmp FE" > "$TMXRCHBNDS"/cdtmp
chmod 755 "$TMXRCHBNDS"/cdtmp
}
_ADDch_() {
_CFLHDR_ "$TMXRCHBNDS"/ch "# This script creates and deletes the .hushlogin and .hushlogout files."
cat >> "$TMXRCHBNDS"/ch <<- EOM
declare -a ARGS
_TRPET_() {
printf "\\e[?25h\\e[0m"
set +Eeuo pipefail
_PRINTTAIL_ "\${ARGS[@]}"
}
_PRINTTAIL_() {
printf "\\e[0m%s \\e[1;32m%s \\e[0;32m%s\\e[1;34m: \\e[1;32m%s\\e[0m 🏁 \\n\\e[0m" "TermuxArch command" "\$STRNRG" "version \$VERSIONID" "DONE 📱"
printf '\033]2; 🔑 TermuxArch %s:DONE 📱 \007' "\$STRNRG"
}
## ch begin ####################################################################
if [[ -z "\${1:-}" ]]
then
ARGS=""
else
ARGS="\$@"
fi
if [[ -f "\$HOME"/.hushlogin ]] && [[ -f "\$HOME"/.hushlogout ]]
then
rm -f "\$HOME"/.hushlogin "\$HOME"/.hushlogout
printf "%s\\n" "Hushed login and logout: OFF"
elif [[ -f "\$HOME"/.hushlogin ]] || [[ -f "\$HOME"/.hushlogout ]]
then
touch "\$HOME"/.hushlogin "\$HOME"/.hushlogout
printf "%s\\n" "Hushed login and logout: ON"
else
touch "\$HOME"/.hushlogin "\$HOME"/.hushlogout
printf "%s\\n" "Hushed login and logout: ON"
fi
## $INSTALLDIR$TMXRCHBNDR/ch FE
EOM
chmod 755 "$TMXRCHBNDS"/ch
}
_ADDchperms.cache+gnupg_() {
_CFLHDR_ "$TMXRCHBNDS"/chperms.cache+gnupg
cat >> "$TMXRCHBNDS"/chperms.cache+gnupg <<- EOM
set -x
[[ -d "\$HOME"/.cache ]] && find "\$HOME"/.cache -type d -exec chmod 777 {} \; && find "\$HOME"/.cache -type f -exec chmod 666 {} \;
[[ -d "\$HOME/".gnupg ]] && find "\$HOME/".gnupg -type d -exec chmod 777 {} \; && find "\$HOME/".gnupg -type f -exec chmod 666 {} \;
set +x
## $INSTALLDIR$TMXRCHBNDR/chperms.cache+gnupg FE
EOM
chmod 755 "$TMXRCHBNDS"/chperms.cache+gnupg
}
_ADDcsystemctl_() {
_CFLHDR_ "$TMXRCHBNDS"/csystemctl "# Contributor https://github.com/petkar"
cat >> "$TMXRCHBNDS"/csystemctl <<- EOM
INSTALLDIR="$INSTALLDIR"
printf "\\e[38;5;148m%s\\e[0m\\n" "Installing /usr/bin/systemctl replacement: "
[ -f "/run/lock/${INSTALLDIR##*/}/csystemctl.lock" ] && printf "%s\\n" "Already installed $TMXRCHBNDR/systemctl replacement: DONE 🏁" && exit
declare COMMANDP
COMMANDP="\$(command -v python3)" || printf "%s\\n" "Command python3 can not be found: continuing..."
[[ "\${COMMANDP:-}" == *python3* ]] || { pc python3 || pci python3 ; }
SDATE="\$(date +%s)"
# path is $TMXRCHBNDR because updates overwrite /usr/bin/systemctl and may make systemctl-replacement obsolete
# backup original binary
mv -f /usr/bin/systemctl $INSTALLDIR/var/backups/${INSTALLDIR##*/}/systemctl.\$SDATE.bkp
printf "\\e[38;5;148m%s\\n\\e[0m" "Moved /usr/bin/systemctl to $INSTALLDIR/var/backups/${INSTALLDIR##*/}/systemctl.\$SDATE.bkp"
printf "%s\\n" "Getting replacement systemctl from https://raw.githubusercontent.com/TermuxArch/docker-systemctl-replacement/master/files/docker/systemctl3.py"
# Arch Linux package 'systemctl' updates will mot halt functioning as $TMXRCHBNDR precedes /usr/bin in the PATH
# download and copy to both directories $TMXRCHBNDR and /usr/bin
curl --fail --retry 2 https://raw.githubusercontent.com/TermuxArch/docker-systemctl-replacement/master/files/docker/systemctl3.py | tee /usr/bin/systemctl $TMXRCHBNDR/systemctl >/dev/null
chmod 755 /usr/bin/systemctl $TMXRCHBNDR/systemctl
:>"/run/lock/${INSTALLDIR##*/}/csystemctl.lock"
printf "\\e[38;5;148m%s\\e[1;32m%s\\e[0m\\n" "Installing systemctl replacement in $TMXRCHBNDR and /usr/bin: " "DONE 🏁"
## $INSTALLDIR$TMXRCHBNDR/csystemctl FE
EOM
chmod 755 "$TMXRCHBNDS"/csystemctl
}
_ADDcolorizebashrc_() {
_CFLHDR_ "$TMXRCHBNDS"/colorizebashrc "# Change always to never and vica versa in file '.bashrc'."
cat >> "$TMXRCHBNDS"/colorizebashrc <<- EOM
grep always "\$HOME"/.bashrc 1>/dev/null && sed -i 's/always/never/g' "\$HOME"/.bashrc || sed -i 's/never/always/g' "\$HOME"/.bashrc
grep always "\$HOME"/.bashrc || grep never "\$HOME"/.bashrc
## $INSTALLDIR$TMXRCHBNDR/colorizebashrc FE
EOM
chmod 755 "$TMXRCHBNDS"/colorizebashrc
}
_ADDes_() {
_CFLHDR_ "$TMXRCHBNDS"/es
cat >> "$TMXRCHBNDS"/es <<- EOM
if [[ -z "\${1:-}" ]]
then
ARGS=(".")
else
ARGS=("\$@")
fi
EOM
printf "%s\\n%s\\n%s\\n" "[ \"\$UID\" = 0 ] && printf \"\\e[1;31m%s\\e[1;37m%s\\e[1;31mExiting...\\n\" \"Cannot run '\${0##*/}' as root user;\" \" the command 'addauser username' creates user accounts in $INSTALLDIR; the command '$STARTBIN command addauser username' can create user accounts in $INSTALLDIR from Termux; a default user account is created during setup; the default username 'user' can be used to access the PRoot system employing a user account; command '$STARTBIN help' has more information; \" && exit" "[ ! -x \"\$(command -v emacs)\" ] && { pc emacs || pci emacs ; } && emacs \"\${ARGS[@]}\" || emacs \"\${ARGS[@]}\"" "## $INSTALLDIR$TMXRCHBNDR/es FE" >> "$TMXRCHBNDS"/es
chmod 755 "$TMXRCHBNDS"/es
}
_ADDexd_() {
_CFLHDR_ "$TMXRCHBNDS"/exd "# Usage: \`. exd\` the dot sources \`exd\` which makes this shortcut script work. Reference https://github.com/SDRausty/TermuxArch/issues/59#issuecomment-381285151_"
cat >> "$TMXRCHBNDS"/exd <<- EOM
export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712
## $INSTALLDIR$TMXRCHBNDR/exd FE
EOM
chmod 755 "$TMXRCHBNDS"/exd
}
_ADDfibs_() {
_CFLHDR_ "$TMXRCHBNDS"/fibs
cat >> "$TMXRCHBNDS"/fibs <<- EOM
find /proc/ -name maps 2>/dev/null | xargs awk '{print \$6}' | grep '\.so' | sort | uniq && exit
## $INSTALLDIR$TMXRCHBNDR/fibs FE
EOM
chmod 755 "$TMXRCHBNDS"/fibs
}
_ADDga_() {
_CFLHDR_ "$TMXRCHBNDS"/ga
cat >> "$TMXRCHBNDS"/ga <<- EOM
if [ -x "\$(command -v git)" ]
then
git add .
else
{ pc git || pci git ; }
git add .
fi
## $INSTALLDIR$TMXRCHBNDR/ga FE
EOM
chmod 755 "$TMXRCHBNDS"/ga
}
_ADDgcl_() {
_CFLHDR_ "$TMXRCHBNDS"/gcl "# Contributor reddit.com/u/ElectricalUnion"
printf "%s\\n" "{ [ \"\$UID\" = 0 ] && printf \"\\e[1;31m%s\\e[1;37m%s\\e[1;31mExiting...\\e[0m\\n\" \"TermuxArch \${SRPTNM^^} SIGNAL:\" \" Script '\${0##*/}' should not be used as root: The command 'addauser' creates user accounts in Arch Linux in Termux PRoot and configures these user accounts for the Arch Linux 'sudo' command: The 'addauser' command is intended to be run by the Arch Linux in Termux PRoot root user: To use 'addauser' directly from Termux you can run '$STARTBIN command 'addauser user'' in native Termux to create this account in Arch Linux Termux PRoot: The command '$STARTBIN help' has more information about using '$STARTBIN': \" ; } && exit 101
{ [ \"\$#\" = 0 ] && printf \"\\e[1;31m%s\\e[1;37m%s\\e[1;31mExiting...\\e[0m\\n\" \"Example usage: \" \"'\${0##*/} https://github.com/TermuxArch/TermuxArch' \" ; } && exit 101
_GITCLONE_() {
git clone --depth 1 \"\$@\" --single-branch || git clone --depth 1 \"\$@\" --single-branch || printf \"\\n\\e[1m%s\\n\" \"This command 'sudo pacman -Rdd ca-certificates-utils ; sudo pacman -S ca-certificates-utils ; sudo pacman -Syu' might resolve an 'error setting certificate verify locations: CAfile:' error.\"
}
BASENAME=\"\${@#*//}\" # strip before double slash
BASENAME=\"\${BASENAME##*/}\" # strip before last slash
if [ -d \"\$BASENAME\" ]
then
printf 'Directory '%s' exists; EXITING...\\n' \"\$BASENAME\"
exit
fi
[ -x \"\$(command -v git)\" ] || pc git || pci git
_GITCLONE_ \"\$@\"
## $INSTALLDIR$TMXRCHBNDR/gcl FE" >> "$TMXRCHBNDS"/gcl
chmod 755 "$TMXRCHBNDS"/gcl
}
_ADDgclone_() {
_CFLHDR_ "$TMXRCHBNDS"/gclone "# Usefull for cloning over very slow and sketchy Internet connections."
_PRTRTHLP_ "$TMXRCHBNDS"/gclone
_DPTCHHLP_ "$TMXRCHBNDS"/gclone
cat >> "$TMXRCHBNDS"/gclone <<- EOM
{ [ "\$#" = 0 ] && printf "\\e[1;31m%s\\e[1;37m%s\\e[1;31mExiting...s\\e[0m\\n" "Example usage: " "'\${0##*/} https://github.com/TermuxArch/TermuxArch' " ; } && exit 101
_GCLONEMAIN_() {
BASENAME="\${@%/}" # strip trailing slash
BASENAME="\${BASENAME#*//}" # strip before double slash
REPONAME="\${BASENAME##*/}" # strip before last slash
{ [ -e "\$REPONAME-master" ] && { cd "\$REPONAME-master" || exit 69 ; } ; } || { [ -e "\$REPONAME-main" ] || { wget -c -O "\$REPONAME.zip" "\$*"/archive/main.zip && unzip "\$REPONAME.zip" ; } && { cd "\$REPONAME-main" || exit 69 ; } ; } || { [ -e "\$REPONAME-master" ] || { wget -c -O "\$REPONAME.zip" "\$*"/archive/master.zip && unzip "\$REPONAME.zip" ; } && { cd "\$REPONAME-master" || exit 69 ; } ; }
git init
git remote add origin "\$@" ||:
git checkout -b main || git checkout main
git add .
git pull --no-rebase --depth 1 "\$@" master || git pull --no-rebase --depth 1 "\$@" main
git add .
}
if [[ ! -x "\$(command -v wget)" ]] && [[ ! -x "\$(command -v unzip)" ]]
then
{ pc wget unzip || pci wget unzip || au wget unzip ; }
_GCLONEMAIN_ "\$@"
else
_GCLONEMAIN_ "\$@"
fi
## $INSTALLDIR$TMXRCHBNDR/gclone FE
EOM
chmod 755 "$TMXRCHBNDS"/gclone
}
_ADDgcm_() {
_CFLHDR_ "$TMXRCHBNDS"/gcm
cat >> "$TMXRCHBNDS"/gcm <<- EOM
if [ -x "\$(command -v git)" ]
then
git commit
else
{ pc git || pci git ; }
git commit
fi
## $INSTALLDIR$TMXRCHBNDR/gcm FE
EOM
chmod 755 "$TMXRCHBNDS"/gcm
}
_ADDgitconfig_() {
if [[ -f "$HOME/.gitconfig" ]]
then
if [[ -f "$INSTALLDIR/root/.gitconfig" ]]
then
_DOTHRF_ "root/.gitconfig"
cp "$HOME/.gitconfig" "$INSTALLDIR/root/.gitconfig"
else
cp "$HOME/.gitconfig" "$INSTALLDIR/root/.gitconfig"
fi
else
:>"$INSTALLDIR/root/.gitconfig"
fi
}
_ADDgmu_() {
_CFLHDR_ "$TMXRCHBNDS"/gmu
cat >> "$TMXRCHBNDS"/gmu <<- EOM
if [ -x "\$(command -v git)" ]
then
git submodule update --init --recursive --remote || git submodule update --init --recursive --remote --verbose
else
{ pc git || pci git ; }
git submodule update --init --recursive --remote || git submodule update --init --recursive --remote --verbose
fi
## $INSTALLDIR$TMXRCHBNDR/gmu FE
EOM
chmod 755 "$TMXRCHBNDS"/gmu
}
_ADDgp_() {
_CFLHDR_ "$TMXRCHBNDS"/gp "# git push https://username:[email protected]/username/repository.git"
cat >> "$TMXRCHBNDS"/gp <<- EOM
if [ -x "\$(command -v git)" ]
then
git push
else
{ pc git || pci git ; }
git push
fi
## $INSTALLDIR$TMXRCHBNDR/gp FE
EOM
chmod 755 "$TMXRCHBNDS"/gp
}
_ADDgpl_() {
_CFLHDR_ "$TMXRCHBNDS"/gpl
cat >> "$TMXRCHBNDS"/gpl <<- EOM
if [ -x "\$(command -v git)" ]
then
git pull || git pull --verbose
else
{ pc git || pci git ; }
git pull || git pull --verbose
fi
## $INSTALLDIR$TMXRCHBNDR/gpl FE
EOM
chmod 755 "$TMXRCHBNDS"/gpl
}
_ADDgsu_() {
_CFLHDR_ "$TMXRCHBNDS"/gsu
cat >> "$TMXRCHBNDS"/gsu <<- EOM
if [ -x "\$(command -v git)" ]
then
git submodule update --init --recursive --remote || git submodule update --init --recursive --remote --verbose
else
{ pc git || pci git ; }
git submodule update --init --recursive --remote || git submodule update --init --recursive --remote --verbose
fi
## $INSTALLDIR$TMXRCHBNDR/gsu FE
EOM
chmod 755 "$TMXRCHBNDS"/gsu
}
_ADDhunf_ () {
_CFLHDR_ "$TMXRCHBNDS"/hunf
_PRTRTHLP_ "$TMXRCHBNDS"/hunf
printf "%s\\n%s\\n" "{ [ -x \"/usr/bin/hunspell\" ] || { pc hunspell hunspell-en_US || pci hunspell hunspell-en_US ; } ; } && /usr/bin/hunspell -p en_US \"\$@\" || /usr/bin/hunspell -p en_US \"\$@\"" "## $INSTALLDIR$TMXRCHBNDR/hunf FE" >> "$TMXRCHBNDS"/hunf
chmod 755 "$TMXRCHBNDS"/hunf
}
_ADDhunw_ () {
_CFLHDR_ "$TMXRCHBNDS"/hunw
_PRTRTHLP_ "$TMXRCHBNDS"/hunw
printf "%s\\n%s\\n" "{ [ -x \"/usr/bin/hunspell\" ] || { pc hunspell hunspell-en_US || pci hunspell hunspell-en_US ; } ; } && /usr/bin/hunspell -p en_US <<< \"\$@\" || /usr/bin/hunspell -p en_US <<< \"\$@\"" "## $INSTALLDIR$TMXRCHBNDR/hunw FE" >> "$TMXRCHBNDS"/hunw
chmod 755 "$TMXRCHBNDS"/hunw
}
_ADDinfo_ () {
_CFLHDR_ "$TMXRCHBNDS"/info
_PRTRTHLP_ "$TMXRCHBNDS"/info
printf "%s\\n%s\\n" "{ [ -x \"/usr/bin/info\" ] || { pc texinfo || pci texinfo ; } ; } && /usr/bin/info \"\$@\" || /usr/bin/info \"\$@\"" "## $INSTALLDIR$TMXRCHBNDR/info FE" >> "$TMXRCHBNDS"/info
chmod 755 "$TMXRCHBNDS"/info
}
_ADDmakelibguestfs_() {
_CFLHDR_ "$TMXRCHBNDS"/makelibguestfs "# Developed around [userspace mount #74](https://github.com/SDRausty/termux-archlinux/issues/74) contributor gordol and [Feature Request: mount loopback device #376](https://github.com/termux/termux-app/issues/376) contributor SDRausty, and at [make[2]: *** No rule to make target 'guestfs_protocol.c', needed by 'all'. Stop. #82](https://github.com/libguestfs/libguestfs/issues/82, et. al.) contributor rwmjones, et. al. Reference https://libguestfs.org/guestfs-building.1.html#building-from-git"
_PRTRTHLP_ "$TMXRCHBNDS"/makelibguestfs
_DPTCHHLP_ "$TMXRCHBNDS"/makelibguestfs
cat >> "$TMXRCHBNDS"/makelibguestfs <<- EOM
# builtin help string variables begin
NMCMND="\$(uname -m)"
PSCMMT="(please quote multiple words)"
XLCD00="'\$SRPTNM f 'machine virtual'' \$PSCMMT"
XLCD0L="'\$SRPTNM find 'machine virtual'' \$PSCMMT"
XLCD01="'\$SRPTNM b libguestfs'"
XLCD02="'\$SRPTNM s libguestfs'"
XLCD03="'\$SRPTNM g 'guestfish --help'' \$PSCMMT"
XLCD04="'\$SRPTNM l 'guestfish --help'' \$PSCMMT"
# builtin help string variables end
HLPSTG="One and two letter arguments are good; i.e. Command \$XLCD00 is an equivalent of \$XLCD0L. Command \$SRPTNM accepts these arguments:
b[uild] build libguestfs. Useful for building 'libguestfs' again. This argument is a synonym for option 'make',
f[ind packages]★ find default 'machine virtual' search or find AUR packages with search terms, EXAMPLE: \$XLCD00,
g[uestfish 'cmd cmd'] run either guestfish shell (default) or run command commands if they are built. This argument is a synonym for option 'libguestfs', EXAMPLE: \$XLCD03,
h[elp] print this help screen,
he[lp building]★ present this https://libguestfs.org/guestfs-building.1.html webpage,
hel[p faq]★ present this https://libguestfs.org/guestfs-faq.1.html webpage,
l[ibguestfs 'cmd cmd'] run either guestfish shell (default) or run commands if they are built. This argument is a synonym for option 'guestfish', EXAMPLE: \$XLCD04,
m[ake] make libguestfs. Useful for making 'libguestfs' again. This argument is a synonym for option 'build',
s[how PKGBUILD]★ show the libguestfs PKGBUILD file or show a PKGBUILD file for a particular package, EXAMPLE: \$XLCD02,
v[irt-inspector 'cmd cmd'] run either virt-inspector (default) or run command 'virt-inspector 'cmd cmd'' if they are built,
★open and use an Android web browser to find Arch Linux AUR packages matching search term(s) or view a particular PKGBUILD package file. "
[ -n "\${1:-}" ] && { [[ "\${1//-}" = [Ff]* ]] && { printf '\\e[0;32m%s' "Finding '\${2:-machine virtual}' AUR packages... " && am start -a android.intent.action.VIEW -d "https://aur.archlinux.org/packages?O=0&K=\${2:-machine virtual}" ; exit ; } ; }
[ -n "\${1:-}" ] && { { [[ "\${1//-}" = [Gg]* ]] || [[ "\${1//-}" = [Ll]* ]] ; } && { [ -d "\$HOME"/libguestfs ] && cd "\$HOME"/libguestfs && printf '%s\n' "Running command '\$HOME/libguestfs/run \$HOME/libguestfs/fish/guestfish \${2:-}' in directory '\$PWD'..." && \$HOME/libguestfs/run "\$HOME/libguestfs/fish/guestfish \${2:-}" && exit || { printf '\\e[0;32m%s' "\$HLPSTG" ; exit ; } ; } ; }
[ -n "\${1:-}" ] && { [[ "\${1//-}" = [Hh][Ee][Ll]* ]] && { printf '\\e[0;32m%s' "Presenting this 'https://libguestfs.org/guestfs-faq.1.html' webpage... " && am start -a android.intent.action.VIEW -d "https://libguestfs.org/guestfs-faq.1.html" ; exit ; } ; }
[ -n "\${1:-}" ] && { [[ "\${1//-}" = [Hh][Ee]* ]] && { printf '\\e[0;32m%s' "Presenting this 'https://libguestfs.org/guestfs-building.1.html' webpage... " && am start -a android.intent.action.VIEW -d "https://libguestfs.org/guestfs-building.1.html" ; exit ; } ; }
[ -n "\${1:-}" ] && [[ "\${1//-}" = [Ss]* ]] && { printf '\\e[0;32m%s' "Showing PKGBUILD file for '\${2:-libguestfs}'... " && am start -a android.intent.action.VIEW -d "https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=\${2:-libguestfs}" && exit ; }
[ -n "\${1:-}" ] && [[ "\${1//-}" = [Vv]* ]] && { [ -d "\$HOME"/libguestfs ] && cd "\$HOME"/libguestfs && printf '%s\n' "Running command '\$HOME/libguestfs/run \$HOME/libguestfs/fish/virt-inspector \${2:-}' in directory '\$PWD'..." && \$HOME/libguestfs/run "\$HOME/libguestfs/fish/guestfish \${2:-}" && exit || { printf '\\e[0;32m%s' "\$HLPSTG" ; exit ; } ; }
[ -n "\${1:-}" ] && { for ARG1 in '/' '?' {0..9} Aa Cc Dd Ee Hh Ii Jj Kk Oo Qq Rr Tt Uu Ww Xx Yy Zz ; do [[ "\${1//-}" = ["\$ARG1"]* ]] && { printf '\\e[0;32m%s' "\$HLPSTG" ; exit ; } ; done ; }
# makelibguestfs begin
[ -z "\${1:-}" ] && { { [ -f "\$HOME"/libguestfs/fish/guestfish.1 ] && { [ -x /usr/bin/man ] || { pc man || pci man ; } ; } && TMRCMDVL="man \$HOME/libguestfs/fish/guestfish.1" && printf '%s\n' "Running command '\$TMRCMDVL' in directory '\$PWD'..." && \$TMRCMDVL && exit ; } || printf "\\e[48;5;22m%s\\n" "Command \$SRPTNM is attempting to build and install 'libguestfs' for computer architecture '\$NMCMND'..." ; }
# libguestfs dependencies
GTFSDPND=(
acl
attr
augeas
autoconf
automake
bash
binutils
bison
btrfs-progs
bzip2
cdrtools
clang
coreutils
cpio
cryptsetup
curl
debootstrap
dhclient
dhcpcd
diffutils
dosfstools
e2fsprogs
exfatprogs
f2fs-tools
file
findutils
flex
gawk
gdb
gdisk
gettext
glibc
gperf
gptfdisk
grep
groff
grub
gzip
hivex
iproute2
iputils
jansson
jfsutils
kmod
less
libcap
libconfig
libtirpc
libtool
libxml2
linux
lrzip
lsof
lsscsi
lvm2
lzop
m4
make
man
mdadm
module-init-tools
mtools
multipath-tools
netpbm
nilfs-utils
ntfs-3g
ocaml
ocaml-findlib
pacman
parted
patch
pciutils
pcre2
perl
perl-module-build
perl-pod-parser
pkgconf
popt
procps
procps-ng
psmisc
python
python-pycodestyle
reiserfsprogs
rpcsvc-proto
rpm-tools
rsync
sed
squashfs-tools
strace
sudo
supermin
systemd
systemd-libs
tar
texinfo
udev
util-linux
valgrind
virt-install
vim
wget
which
xfsprogs
xorriso
xz
yara
)
NBRFCMDS=19
NMCMND="\$(uname -m)"
_SLCTRHPR_() {
_RCSNPTC0_() { printf "\\e[48;5;112m%s\\e[48;5;28m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]C0" " Running complementary command '\${3:-}' for command '\${2:-}' in directory '\$PWD'... " && { { \${3:-:} || _RCSRPTA1_ "\${1:-}" "\${2:-}" "\${3:-}" "\${4:-}" ; } ; printf "\\e[48;5;119m%s\\e[48;5;34m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]C0" " Finished running complementary command '\${3:-}' for command '\${2:-}'." ; } ; }
_RCSRPTA0_() { printf "\\e[48;5;112m%s\\e[48;5;28m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]A0" " Running alternate command '\${3:-}' for command '\${2:-}' in directory '\$PWD'... " && { { \${3:-:} || _RCSRPTA1_ "\${1:-}" "\${2:-}" "\${3:-}" "\${4:-}" ; } ; printf "\\e[48;5;119m%s\\e[48;5;34m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]A0" " Finished running alternate command '\${3:-}' for command '\${2:-}'." ; } ; }
_RCSRPTA1_() { printf "\\e[48;5;112m%s\\e[48;5;28m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]A1" " Running alternate command '\${4:-}' for commands '\${2:-}' then '\${3:-}' in directory '\$PWD'... " && { { \${4:-:} || : ; } ; printf "\\e[48;5;119m%s\\e[48;5;34m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]A1" " Finished running alternate command '\${4:-}' for commands '\${2:-}' then '\${3:-}''." ; } ; }
_RCSNPTNM_() { printf "\\e[48;5;112m%s\\e[48;5;28m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]" " Running command '\$2' in directory '\$PWD'... " && { { { \$2 && _RCSNPTC0_ "\${1:-}" "\${2:-}" "\${3:-}" "\${4:-}" ; } || printf '%s\n' "\${SRPTNM^^} SIGNAL: \$2" ; } ; printf "\\e[48;5;119m%s\\e[48;5;34m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]" " Finished running command '\$2'." ; } ; }
_RCSRPTNM_() { printf "\\e[48;5;112m%s\\e[48;5;28m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]" " Running command '\$2' in directory '\$PWD'... " && { { \$2 || _RCSRPTA0_ "\${1:-}" "\${2:-}" "\${3:-}" "\${4:-}" ; } ; printf "\\e[48;5;119m%s\\e[48;5;34m%s\\e[0;0;0m\\n" "[\$1/\$NBRFCMDS]" " Finished running command '\$2'." ; } ; }
_PRPCLANG_() { command -v clang 1>/dev/null && export CC=clang || { { pc clang || pci clang ; } && export CC=clang ; } ; }
_BULDQEMU_() { { QEMUPKGI=(acpica brltty capstone glusterfs libcacard libepoxy libiscsi libnfs liblouis libpulse libslirp libusb liburing libvirt libxkbcommon make ninja pkgconf pcsc-tools pixman python-sphinx spice spice-protocol virglrenderer sdl2 sdl2_image) && pc "\${QEMUPKGI[@]}" || pci "\${QEMUPKGI[@]}" ; } && { cd || exit 69 ; }
if [ -d qemu ]
then
cd qemu || exit 69
gpl
else
gcl https://gitlab.com/qemu-project/qemu.git
cd qemu || exit 69
fi
git pull --depth 1
if [ -d build ]
then
rm -rf build
mkdir -p build && { cd build || exit 69 ; }
else
mkdir -p build && { cd build || exit 69 ; }
fi
for TMRCMD in "../configure" "make" "sudo make install"
do
{ TMRCMDVL="\$TMRCMD" && printf '\\e[48;5;22m%s\\e[0m\n' "Running command '\$TMRCMDVL' in directory '\$PWD'..." && \$TMRCMDVL ; } || { TMRCMDVL="git pull --depth 1" && printf '\\e[48;5;22m%s\\e[0m\n' "Running command '\$TMRCMDVL' in directory '\$PWD' and exiting..." && \$TMRCMDVL ; exit 169 ; }
done
}
_CHECKFORQEMU_() {
_PACMANCKQEMU_() {
if [[ "\$NMCMND" = "$CPUABI8" ]] || [[ "\$NMCMND" = "aarch64" ]]
then
command -v qemu-system-aarch64 && command -v qemu-img
elif [[ "\$NMCMND" == "$CPUABI7" ]] || [[ "\$NMCMND" == "armv7" ]]
then
command -v qemu-system-arm && command -v qemu-img
elif [[ "\$NMCMND" == "$CPUABIX86" ]] || [[ "\$NMCMND" == i686 ]]
then
command -v qemu-system-i386 && command -v qemu-img
elif [[ "\$NMCMND" == "$CPUABIX8664" ]]
then
command -v qemu-system-x86_64 && command -v qemu-img
else
command -v qemu && command -v qemu-img
fi
}
_PACMANINQEMU_() {
if [[ "\$NMCMND" == "$CPUABI7" ]] || [[ "\$NMCMND" == "armv7" ]] || [[ "\$NMCMND" = "$CPUABI8" ]] || [[ "\$NMCMND" = "aarch64" ]] || [[ "\$NMCMND" == "$CPUABIX8664" ]]
then
{ pc qemu qemu-img qemu-tools || pci qemu qemu-img qemu-tools ; } || { printf "\\e[48;5;22m%s\\n" "\${SRPTNM^^} SIGNAL: Missing qemu command(s) found: Command '\$SRPTNM' is attempting to build and install 'qemu' a 'libguestfs' prerequisite for computer architecture '\$NMCMND'. If you find a better and simpler resolution for command '\$SRPTNM', please open an issue and pull request at GitHub." && _BULDQEMU_ ; } || makeaurhelpers build qemu-git
elif [[ "\$NMCMND" == "$CPUABIX86" ]] || [[ "\$NMCMND" == i686 ]]
then
{ pc qemu || pci qemu ; } || { printf "\\e[48;5;22m%s\\n" "\${SRPTNM^^} SIGNAL: Missing qemu command(s) found: Command '\$SRPTNM' is attempting to build and install 'qemu' a 'libguestfs' prerequisite for computer architecture '\$NMCMND'. If you find a better and simpler resolution for command '\$SRPTNM', please open an issue and pull request at GitHub." && _BULDQEMU_ ; } || makeaurhelpers build qemu-git
else
{ pc qemu qemu-img || pci qemu qemu-img ; } || { printf "\\e[48;5;22m%s\\n" "\${SRPTNM^^} SIGNAL: Missing qemu command(s) found: Command '\$SRPTNM' is attempting to build and install 'qemu' a 'libguestfs' prerequisite for computer architecture '\$NMCMND'. If you find a better and simpler resolution for command '\$SRPTNM', please open an issue and pull request at GitHub." && _BULDQEMU_ ; } || makeaurhelpers build qemu-git
fi
}
_PACMANCKQEMU_ || { printf "\\e[48;5;22m%s\\n" "Command '\$SRPTNM' is attempting to install 'qemu' a 'libguestfs' prerequisite for computer architecture '\$NMCMND'. If you find a better and simpler resolution for command '\$SRPTNM', please open an issue and pull request at GitHub..." && _PACMANINQEMU_ ; }
}
_CHCKFRPRREQUSTS_() { [ -f /usr/share/licenses/python-pycodestyle/LICENSE ] && [ -x /usr/bin/bison ] && [ -x /usr/bin/gdb ] && [ -x /usr/bin/libtool ] && [ -x /usr/bin/ocaml ] ; }
_INSTLLPRREQUSTS_() { pc \${GTFSDPND[@]} || pci \${GTFSDPND[@]} ; }
TMRCMDVL="_PRPCLANG_" && _RCSRPTNM_ 1 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
TMRCMDVL="_CHECKFORQEMU_" && _RCSRPTNM_ 2 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
_RCSRPTNM_ 3 "_CHCKFRPRREQUSTS_" "_INSTLLPRREQUSTS_" "echo \${SRPTNM^^} SIGNAL: _CHCKFRPRREQUSTS_"
{ [ -f /run/lock/${INSTALLDIR##*/}/\$UID.libguestfs.cpan.lock ] && _RCSRPTNM_ 4 "echo file /run/lock/${INSTALLDIR##*/}/\$UID.libguestfs.cpan.lock exists" ; } || { _RCSNPTNM_ 4 "cpan -i Locale::TextDomain Module::Build Pod::Man Pod::Simple Test::More" "touch /run/lock/${INSTALLDIR##*/}/\$UID.libguestfs.cpan.lock" ; }
_RCSRPTNM_ 5 "cd \$HOME" "exit 69"
TMRCMDVL="gcl https://github.com/libguestfs/libguestfs" && _RCSRPTNM_ 6 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
_RCSRPTNM_ 7 "cd libguestfs" "exit 69"
TMRCMDVL="gpl" && _RCSRPTNM_ 8 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
TMRCMDVL="gsu" && _RCSRPTNM_ 9 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
# using patches is optional:
_PHLBGSTFS1_(){ [ -f /etc/os-release ] && TMRCMDVL="\$(grep -w ID /etc/os-release | cut -d"=" -f 2)" && sed -Ei "s/ARCH\ \|\ MANJARO\ \|/\${TMRCMDVL^^}\ \|\ MANJARO\ \|/g" m4/guestfs-appliance.m4 ; }
_PHLBGSTFS2_(){
if [ -f "\$HOME"/libguestfs/m4/patchfile ]
then
cd "\$HOME"/libguestfs/m4 && patch guestfs-appliance.m4 patchfile ; cd "\$HOME"/libguestfs
else
printf '%s\n' "Patch file \$HOME/libguestfs/m4/patchfile is available at this https://listman.redhat.com/archives/libguestfs/2022-May/028941.html webpage. No patch file found. Exiting..." && exit 101
fi
}
if [ -n "\${1:-}" ] && [[ "\${1//-}" = [Pp]*[1]* ]]
then
TMRCMDVL="_PHLBGSTFS1_" && _RCSRPTNM_ 10 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
elif [ -n "\${1:-}" ] && [[ "\${1//-}" = [Pp]*[Ii][Dd]* ]]
then
TMRCMDVL="_PHLBGSTFS2_" && _RCSRPTNM_ 10 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
else
TMRCMDVL="echo \${SRPTNM^^} SIGNAL: no patch" && _RCSRPTNM_ 10 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
fi
# using patches end
TMRCMDVL="make -C appliance clean-supermin-appliance" && _RCSRPTNM_ 11 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
TMRCMDVL="make clean" && _RCSRPTNM_ 12 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
TMRCMDVL="autoupdate -f" && _RCSRPTNM_ 13 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
TMRCMDVL="autoreconf -i" && _RCSRPTNM_ 14 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
{ [ -f ./localconfigure ] && TMRCMDVL="./localconfigure" && _RCSRPTNM_ 15 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL" ; } || { TMRCMDVL="./configure CFLAGS=-fPIC --with-supermin-extra-options=\"--use-installed\"" && _RCSRPTNM_ 15 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL" ; }
TMRCMDVL="make"
_RCSRPTNM_ 16 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
TMRCMDVL="make quickcheck" && _RCSRPTNM_ 17 "\$TMRCMDVL" "echo \${SRPTNM^^} SIGNAL: \$TMRCMDVL"
_RCSRPTNM_ 18 "\$HOME/libguestfs/run guestfish --help" "\${0##*/} h" "echo \${SRPTNM^^} SIGNAL: \${0##*/} h"
printf "\\e[48;5;119m%s\\e[48;5;34m%s\\e[0;0;0m\\n" "[\$NBRFCMDS/\$NBRFCMDS]" " Please do NOT run 'make install' in directory '\$HOME/libguestfs' as this may create conflicting versions. Use the '\$HOME/libguestfs/run' command instead. Webpage https://libguestfs.org/guestfs-building.1.html#the-.-run-script has more information. "
}
_SLCTRHPR_ \$@ || { printf '\\e[0;32m%s' "\$HLPSTG" ; exit ; }
## $INSTALLDIR$TMXRCHBNDR/makelibguestfs FE
EOM
chmod 755 "$TMXRCHBNDS"/makelibguestfs
}
_ADDmakeaurhelpers_() {
_CFLHDR_ "$TMXRCHBNDS"/makeaurhelpers "# add Arch Linux AUR helpers https://wiki.archlinux.org/index.php/AUR_helpers"
_PRTRTHLP_ "$TMXRCHBNDS"/makeaurhelpers
_DPTCHHLP_ "$TMXRCHBNDS"/makeaurhelpers
cat >> "$TMXRCHBNDS"/makeaurhelpers <<- EOM
NMKPKC="nice -n 20 makepkg -ACcfis --check --needed"
NMKPKN="nice -n 20 makepkg -ACcfis --check --needed --noconfirm"
NMKPKR="nice -n 20 makepkg -ACcfirs --check --needed --noconfirm"
{ [ -z "\${1:-}" ] && NMKPKG="\$NMKPKC" ; } || { { [[ "\${1//-}" = [Aa]* ]] || [[ "\${1//-}" = [Nn]* ]] || [[ "\${1//-}" = [Rr]* ]] || [[ "\${1//-}" = [Ss][Bb]* ]] || [[ "\${1//-}" = [Tt][Ss]* ]] ; } && NMKPKG="\$NMKPKN" ; } || { { [[ "\${1//-}" = [Ee]* ]] || [[ "\${1//-}" = [Gg]* ]] ; } && NMKPKG="\$NMKPKR" ; } || NMKPKG="\$NMKPKC"
# builtin help string variables begin
NMCMND="\$(uname -m)"