#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
   exit 1
fi

# no flags not compiled

P=stb
SRC=libstb
USER=`cat /etc/sysconfig/tcuser`
LIST="submitqc git  "
for Z in $LIST 
    do 
    su -c "tce-load -i $Z" $USER
done

cd /tmp
git clone https://github.com/SamP-S/libstb.git
# I copied earlier so fix owner
chown root:root -R $SRC  # it looks like just a set of headers?

# main
######
mkdir -p $P-dev/usr/local/share/doc/$P $P-dev/usr/local/include/$P $P-dev/usr/local/lib/pkgconfig
cp $SRC/LICENSE $P-dev/usr/local/share/doc/$P/COPYING
mv $SRC/*h $P-dev/usr/local/include/$P

echo 'prefix=/usr/local
includedir=${prefix}/include

Name: stb
Description: single headers for cmake
Version: git-2025nov22
Requires: 
Cflags: -I${includedir} ' > $P-dev/usr/local/lib/pkgconfig/$P.pc

# TCZ them
#######
LIST="$P-dev "
for Z in $LIST
do
	mksquashfs $Z $Z.tcz
	md5sum $Z.tcz > $Z.tcz.md5.txt
	cd $Z
	find . -not -type d | cut -c 2- | sort > /tmp/$Z.tcz.list
	cd /tmp
done

ls -hal 

echo 'Title:          stb-dev.tcz
Description:    development files as below
Version:        git-2025nov22
Author:         Sam Pearson-Smith
Original-site:  https://github.com/SamP-S/libstb
Copying-policy: Public Domain as per 
                https://github.com/SamP-S/libstb/blob/master/LICENSE
Size:           524K
Extension_by:   aus9 @linuxquestions.org
Tags:           single header cmake 
Comments:       single-file public domain libraries for C/C++ with cmake

                its a make dep of woodland wayland desktop 
                
Change-log:     2025/11/22 git-2025nov22  on 16x
Current:        2025/11/19  '  > $P-dev.tcz.info

# no submit it stuffs my header perms
# woodland compiles so I must have done something right

