Scm's install into /apps, like /apps/leafpad. The main thing that differentiates the scm from the tcz is the scm is self contained and can be mounted and unmounted. The degree of being self contained can vary, as the scm can still have dependencies. The binaries get symlinked into /apps/bin, unless a value is set in the scm's spec file.
Located here:
http://distro.ibiblio.org/tinycorelinux/4.x/x86/scm/The load script scm-load is very similar to tce-load in function. "scm-load -iw audacious-gtk3.scm" will fetch that extension from the repo and load it. "scm-load -r audacious-gtk3" will unmount (unload) the extension. The icon and menu entries get added when the extension is loaded and removed when unloaded. For the user, using the two different extension types will feel about the same.
Here is the basic extension structure of an scm. Lets take leafpad for example. Inside /apps/leafpad you will find the usual directories:
/apps/leafpad/bin
/apps/leafpad/config
/apps/leafpad/etc
/apps/leafpad/lib
/apps/leafpad/share
..and so forth. The config directory is where the install and spec files are located if they are used. install is the startup script, just like /usr/local/tce.installed/leafpad. spec is where variables or flags can be set, the only existing now is the "link_bin=no" if you don't want scm-load to link all the binaries in bin to /apps/bin.
BUILDING
#####
When building an scm, you do not need to use a DESTDIR variable, just use the ./configure flag "--prefix=/apps/l3afpad" and your app will install to that as it's base directory. Certain values need to be set if installing multiple sources that depend on each other into that location. Basically the below would suffice in most cases:
export LDFLAGS="-L/apps/l3afpad/lib -L/apps/gtk3/lib"
export CPPFLAGS="-I/apps/l3afpad/include -I/apps/gtk3/include"
export PATH="/apps/l3afpad/bin:/apps/gtk3/bin:$PATH"
export PKG_CONFIG_PATH="/apps/l3afpad/lib/pkgconfig:/apps/gtk3/lib/pkgconfig:$PKG_CONFIG_PATH"
In the final package, often a wrapper is needed for the binaries so they can find their libraries since the libs are not installed into a path searched by ldconfig. Here is the one for l3afpad, the gtk3 fork of leafpad. Essentially you rename l3afpad to l3afpad-bin and create an executable script named l3afpad:
#!/bin/sh
export LD_LIBRARY_PATH="/apps/gtk3/lib"
export XDG_DATA_DIRS=/apps/gtk3/share
/apps/l3afpad/bin/l3afpad-bin "$@"
L3afpad depends on gtk3.scm, so we have to specify the LD_LIBRARY_PATH to point to the gtk3 libs, and since it is a gtk3 app, also the XDG_DATA_DIRS.
Freedesktop files are located in /apps/PKGNAME/share/applications, and icons in /apps/PKGNAME/share/pixmaps. The scm-load script will link and remove those entries into /usr/local/share/applications and /usr/local/share/pixmaps so all desktops can make use of the desktop and icon files.
send in submissions to scmsubmit@gmail.com
#####