#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
echo "run as root now exitting"
exit 1
fi
P=jwm
V=2.4.3
SRC=$P-$V
SRC2=squashfs-root/usr/local
USER=`cat /etc/sysconfig/tcuser`
LIST="compiletc squashfs-tools wget libjpeg-turbo-dev libXinerama-dev \
libXpm-dev libtool gettext-dev libXrender-dev libpng-dev libXft-dev "
for Z in $LIST
do
su -c "tce-load -i $Z" $USER
done
# list may be larger than loaded
cd /usr/local/lib
rm -rf *.la
rm -rf gcc/aarch64-unknown-linux-gnu/12.2.0/plugin/*.la
rm -rf gcc/aarch64-unknown-linux-gnu/12.2.0/*.la
rm -rf gprofng/*.la
rm -rf python3.8/site-packages/*.la
rm -rf pkcs11/*.la
rm -rf cairo/*.la
rm -rf gtk-2.0/modules/*.la
rm -rf gtk-2.0/2.10.0/printbackends/*.la
rm -rf gtk-2.0/2.10.0/immodules/*.la
rm -rf gtk-2.0/2.10.0/engines/*.la
rm -rf imlib2/loaders/*.la
rm -rf imlib2/filters/*.la
rm -rf gdk-pixbuf-2.0/2.10.0/loaders/*.la
rm -rf gcc/armv7l-unknown-linux-gnueabihf/12.2.0/plugin/libcp1plugin.la
rm -rf gcc/armv7l-unknown-linux-gnueabihf/12.2.0/plugin/libcc1plugin.la
rm -rf gcc/armv7l-unknown-linux-gnueabihf/12.2.0/liblto_plugin.la
rm -rf pulseaudio/libpulsedsp.la
rm -rf pulseaudio/libpulsecore-13.0.la
rm -rf pulseaudio/libpulsecommon-13.0.la
rm -rf libv4l/v4l2convert.la
rm -rf libv4l/v4l1compat.la
rm -rf libv4l/plugins/libv4l-mplane.la
rm -rf vala-0.46/libvalaccodegen.la
cd /tmp
rm -rf /usr/lib/*.la
find / -name *.la
# failed to use URL=http://tinycorelinux.net/12.x/aarch64/tcz/src/jwm/jwm-files with some files
su -c "/usr/local/bin/wget -nc --no-check-certificate \
https://github.com/joewing/$P/releases/download/v$V/$SRC.tar.xz \
http://tinycorelinux.net/12.x/aarch64/tcz/jwm.tcz " $USER
unsquashfs $P.tcz
rm -rf $P.tcz
# due to a glitch where if I attempt to delete jwm_ondemand it deletes entire bin dir we try
mv squashfs-root/usr/local/bin squashfs-root/usr/local/z
rm -rf $SRC2/z/jwm
mv squashfs-root/usr/local/z/jwm_ondemand squashfs-root/usr/local/
# now we are good for below to work $ jwm -p showed an error for ondemand so not installed
tar xvf $P*xz
cd $SRC
# not used pango has an issue according to web search CFLAGS="-I/usr/local/include/pango-1.0"
./configure --prefix=/usr/local --disable-pango --disable-rsvg --disable-shape --disable-xmu \
CFLAGS="-I/usr/local/include/freetype2"
# Confirm: yes
# Icon: yes
# Cairo: no
# RSVG: no
# PNG: yes
# JPEG: yes
# XBM: yes
# XPM: yes
# XFT: yes
# XRender: yes
# Pango: no
# Shape: no
# Xmu: no
# Xinerama: yes
# Debug: no
make -j4 # 10s
make install DESTDIR=/tmp/$P
cd /tmp
# locale
#########
mkdir -p $P-locale/usr/local/share
mv $P/usr/local/share/locale $P-locale/usr/local/share
# main
#####
rm -rf $P/usr/local/share/man
rm -rf $P/usr/local/share/$P/*.svg
mkdir -p $P/usr/local/share/doc/$P
cp $SRC/LICENSE $P/usr/local/share/doc/$P/
strip --strip-unneeded $P/usr/local/bin/$P
cp $SRC2/z/* $P/usr/local/bin/
# tce.install
#############
mkdir -p $P/usr/local/tce.installed
cat >> $P/usr/local/tce.installed/$P <<'EOF'
#!/bin/sh
echo 'jwm' > /etc/sysconfig/desktop
EOF
chown -R root:staff $P/usr/local/tce.installed
chmod -R 775 $P/usr/local/tce.installed
# TC menu fix and adjust other roberts work
###########################################
cp -R $SRC2/share/$P/tce $P/usr/local/share/$P
# XML Parsing Error: not well-formed Location: file:///home/tc/.jwmrc-theme Line Number 40, Column 13:
# but its the line above
THEME=$P/usr/local/share/jwm/tce/.jwmrc-theme
sed 's|2e3a67|' -i $THEME
# make changes to roberts configs for personal reasons
CONFIG=$P/usr/local/share/$P/tce
sed 's|./.jwmrc-ondemand||' -i $CONFIG/.jwmrc
sed -i 's|CA|A|g' -i $CONFIG/.jwmrc-keys
sed -i 's|aterm|xterm|g' -i $CONFIG/.jwmrc-keys
sed -i '39aexec:apps' $CONFIG/.jwmrc-keys
sed -i '40aexec:beaver' $CONFIG/.jwmrc-keys
sed -i '41aexec:cpanel' $CONFIG/.jwmrc-keys
sed -i '42aexec:exittc' $CONFIG/.jwmrc-keys
sed -i '43aexec:firefox' $CONFIG/.jwmrc-keys
sed -i '44aexec:leafpad' $CONFIG/.jwmrc-keys
sed -i '45aexec:mnttool' $CONFIG/.jwmrc-keys
sed -i '46aexec:pcmanfm' $CONFIG/.jwmrc-keys
sed -i '47aexec:update-desktops' $CONFIG/.jwmrc-keys
sed -i '48aexec:aterm -fn 12x24' $CONFIG/.jwmrc-keys
sed 's|aterm|xterm|' -i $CONFIG/.jwmrc-tray
sed -i '11aexec:apps' $CONFIG/.jwmrc-tray
sed -i '12aexec:firefox' $CONFIG/.jwmrc-tray
sed -i '13aexec:mnttool' $CONFIG/.jwmrc-tray
# bin fixes
##########
sed 's|jwm_ondemand||' -i jwm/usr/local/bin/jwm_initmenu
sed 's|aterm|xterm|' -i jwm/usr/local/bin/jwm_menu_common
# TCZ them
###########
LIST2="$P $P-locale "
for Z in $LIST2
do
mksquashfs $Z $Z.tcz
md5sum $Z.tcz > $Z.tcz.md5.txt
cd $Z
find usr -not -type d > /tmp/$Z.tcz.list
sed 's|usr|/usr|g' -i /tmp/$Z.tcz.list
cd /tmp
done
ls -hal
echo 'Title: jwm-locale.tcz
Description: jwm locales
Version: 2.4.3
Author: Joe Wingbermuelhle
Original-site: http://joewing.net/projects/jwm/
Copying-policy: accompanied
Size: 52K
Extension_by: aus9
Tags: window manager wm
Comments: untested by me
Change-log: 2015/06/20 v 2.2.2 on 6.x (bmarkus)
2020/09/10 v 2.3.7 12.xx (aus9)
Current: 2023/08/07 v 2.4.3 14.x ' > $P-locale.tcz.info
echo 'jwm.tcz' > $P-locale.tcz.dep
echo "Title: jwm.tcz
Description: Xorg Stacking Window Manager
Version: 2.4.3
Author: Joe Wingbermuelhle for main source
Robert Shingledecker (roberts) for TC stuff
Original-site: http://joewing.net/projects/jwm/
Copying-policy: accompanied
Size: 132K
Extension_by: aus9
Tags: window manager wm
Comments: Joe's Window Manager
(update) Move your current configs somewhere
safe and compare changes to
~/.jwmrc no ondemand due to $ jwm -p error
~/.jwm-tray more buttons
~/.jwm-keys changes CA now A and more TCE keys
Untouched /usr/local/etc/system.jwmrc
Online guide http://joewing.net/projects/jwm/guide.html
If you make changes please run $ jwm -p
- if ok restart jwm with Alt + r
Change-log: 2015/06/20 v 2.2.2 on 6.x (bmarkus)
2020/09/10 v 2.3.7 12.xx (aus9)
Current: 2023/08/07 v 2.4.3 14.x " > $P.tcz.info
readelf -d $P/usr/local/bin/$P | grep 'NEEDED'
#[libX11.so.6] libX11
#[libpng16.so.16] libpng
#[libjpeg.so.62] libjpeg-turbo
#[libXft.so.2] libXft
#[libXrender.so.1] libXrender libXft
#[libXpm.so.4] libXpm
#[libXinerama.so.1] libXinerama Xorg
# I named it a Xorg desktop but libXcursor not a dep of Xorg at this stage and I need it for my mouse
echo 'libX11.tcz
libpng.tcz
libjpeg-turbo.tcz
libXft.tcz
libXpm.tcz
libXinerama.tcz
Xorg.tcz
libXcursor.tcz ' > $P.tcz.dep