Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:creating_extensions [2014/01/22 00:03] – [Installing] correction: generic applies to mtune, not march; add cite Juanito/forum for add'l flags dentonltwiki:creating_extensions [2024/08/25 13:09] (current) – [Adding Custom Startup Scripts] rhermsen
Line 1: Line 1:
-======Creating an Extension ======  +===== Creating an Extension =====
  
 This article assumes the user is comfortable at the command line. Using these instructions, the user will:  This article assumes the user is comfortable at the command line. Using these instructions, the user will: 
-  * create temporary files and directories  +  * create temporary files and directories 
-  * output the final files to a temp directory  +  * output the final files to a temp directory 
-  * use make and squash file tools +  * use make and squash file tools
  
-Required:  +Required: 
-  * Your source code and all dependencies  +  * Your source code and all dependencies 
-  * compiletc extension  +  * compiletc extension 
-  * squash file tools extension   +  * squash file tools extension
  
-======Choosing an Extension name======  +===== Choosing an Extension name ===== 
 +Please take care while choosing extension names. eg: Be aware of those using FAT filesystem (see [[http://forum.tinycorelinux.net/index.php/topic,13428.msg84490.html#msg84490|this forum link]]).
  
-Please take care with choosing extension names. eg Be aware of those using FAT filesystem see http://forum.tinycorelinux.net/index.php/topic,13428.msg84490.html#msg84490  
  
 +=====  Required info =====
 +  * The package maintainers (JW in particular) use the forum to post the most recent extension creation guidelines. You need to read the [[http://forum.tinycorelinux.net/index.php?topic=330.0|recent guidelines forum thread]] and [[wiki-view_faq.php?faqId=3#q5|the FAQ entry for submission]]
 +  * For information on creating icons, menu entries, setup scripts, .info and .dep files, please see [[iconmenuinfo]].
 +  * Packaging kernel modules: [[http://forum.tinycorelinux.net/index.php?topic=443.0|see this thread]].
 +  * Tiny Core v2.4+ uses extensions in .tcz format. Other formats are deprecated.
 +  * Tiny Core v2.7+ only uses the .tcz extension. There are no filename extension variants. If you don't know what that means, be thankful. Just create files ending in tcz.
  
-=====  Required info =====      +=====  Abbreviated steps ===== 
- +The Big Steps: 
-  * The package maintainers (JW in particular) use the forum to post the most recent extension creation guidelines. You need to read the [[http://forum.tinycorelinux.net/index.php?topic=330.0|recent guidelines forum thread]] and [[tiki-view_faq.php?faqId=3#q5|the FAQ entry for submission]]    +  - configure/make/make install 
-  * For information on creating icons, menu entries, setup scripts, .info and .dep files, please see [[iconmenuinfo]].    +  - separate out docs, locale info, and development files 
-  * Packaging kernel modules: [[http://forum.tinycorelinux.net/index.php?topic=443.0|thread]].    +  - include a copyright/license (if license requires it) in the packages. Most gpl do not need this compliance. 
-  * Tiny Core v2.4+ uses extensions in .tcz format. Other formats are deprecated.    +  - squash up everything into your extension(s) 
-  * Tiny Core v2.7+ only uses the .tcz extension. There are no filename extension variants. If you don't know what that means ... be thankful. Just create files ending in tcz.   +  - write & place support files: dep, info, list, and md5 hash 
- +  - bcrypt/tar it all 
-=====  Abbreviated steps =====    +  - email it to the Tiny Core Team
- +
-The Big Steps:     +
-  - configure/make/make install    +
-  - separate out docs, locale info, and development files    +
-  - include a copyright/license (if license requires it) in the packages. Most gpl do not need this compliance.    +
-  - squash up everything into your extension(s)    +
-  - write & place support files: dep, info, list, and md5 hash    +
-  - bcrypt/tar it all    +
-  - email it to the Tiny Core Team   +
 Much can be scripted and the payoff is well worth it. For instance, steps 3-6 can be automated with [[http://tcztools.googlecode.com/|tcztools]] (not an official TC tool).  Just for the record:  Much can be scripted and the payoff is well worth it. For instance, steps 3-6 can be automated with [[http://tcztools.googlecode.com/|tcztools]] (not an official TC tool).  Just for the record: 
 +<code>*.a *.h *.m4 *.pc -> dev extension (after --strip-debug)
 +*.so* -> main extension (after --strip-unneeded)</code>
 +**Note** *.la should not be used in the dev extension anymore. See [[http://forum.tinycorelinux.net/index.php/topic,26201.0.html|this topic]].
  
-<code> +===== Installing ===== 
-*.a *.h *.la *.m4 *.pc -> dev extension (after --strip-debug)  +Before you begin, please do not have any build depend tczs like compiletc, lib* or *dev files ondemand. All depends for building need to be loaded thru onboot or manually such as 
-*.so* -> main extension (after --strip-unneeded)  +<code>tce-load -i package</code> 
-</code>  +This means you do not not need to adjust your onboot list, but can use the APPS panel to download (only) packages and then install them when you need them.
- +
-=====  Installing =====  +
-Before you begin, please do **not** have any build depend tczs like compiletc, lib* or *dev files ondemand. All depends for building need to be loaded thru onboot or manually such as  +
- +
-<code bash> +
-tce-load -i package +
-</code> +
- +
-This means you do not not need to adjust your onboot list, but can use the APPS panel to download (only) packages and then install them when you need them +
 Use the compiletc extension when compiling your source - it includes the most common tools, all set up for tc (gcc, make, etc). If you are getting strange make errors, try the coreutils extension. Tar errors? Get the tar extension. And so on. Use the compiletc extension when compiling your source - it includes the most common tools, all set up for tc (gcc, make, etc). If you are getting strange make errors, try the coreutils extension. Tar errors? Get the tar extension. And so on.
- +Please note that the standard install prefix for TC is /usr/local
-Please note that the standard install prefix for TC is **/usr/local** +
 Suggested compiler flags on x86 (for compatibility): Suggested compiler flags on x86 (for compatibility):
- +<code bash>export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
-<code bash> +
-export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"+
 export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe"
-export LDFLAGS="-Wl,-O1" +export LDFLAGS="-Wl,-O1"</code> 
-</code>+It is OK to use lower architectures in -march and -mtune than the recommended(-march=i386, -mtune=i586, -mtune=i486 and -mtune=i386. All are acceptable.), however 
 +it is not OK to use higher architectures in -march and not recommended to use higher architectures in -mtune (eg. -march=i586). It isn't necessary to use //-pipe//
 +If you get an error about -Wl you can omit it. You might be able to specify a different -O value to LDFLAGS and you might be able to use "-Oz" in the place of "-Os" 
 +but that may only work for "clang", not "gcc".
  
-Suggested compiler flags on x86_64 (for compatibility; see also [[http://forum.tinycorelinux.net/index.php/topic,14397.0.html|the forum thread]]): +Suggested compiler flags on x86_64 (for compatibility; see also the forum thread): 
-<code bash> +<code bash>export CFLAGS="-mtune=generic -Os -pipe"
-export CFLAGS="-mtune=generic -Os -pipe"+
 export CXXFLAGS="-mtune=generic -Os -pipe" export CXXFLAGS="-mtune=generic -Os -pipe"
-export LDFLAGS="-Wl,-O1" +export LDFLAGS="-Wl,-O1"</code> 
-</code>+ 
 +Again, //-pipe// isn't necessary. If you get an error about "-Wl" you can leave it out.
  
-If you wish to try to get a lower sized C++ app, you can try adding "-fno-exceptions -fno-rttito CXXFLAGS. Use only on C++ applicationslibraries should use the same flags as in CFLAGS above.+Suggested compiler flags on RPi (discussed in this forum thread): 
 +<code bash>export CFLAGS="-Os -pipe" 
 +export CXXFLAGS="-Os -pipe" 
 +export LDFLAGS="-Wl,-O1"</code>
  
 +Again, //-pipe// isn't necessary. If you get an error about "-Wl" you can leave it out.
 +If you wish to try to get a lower sized C++ app, you can try adding "-fno-exceptions -fno-rtti" to CXXFLAGS. Use only on C++ applications, libraries should use the same flags as in CFLAGS above.
 For apps that do not use threads (pthread_cancel), the following flag reduces binary size: "-fno-asynchronous-unwind-tables". For apps that do not use threads (pthread_cancel), the following flag reduces binary size: "-fno-asynchronous-unwind-tables".
 +For apps that need speed (math library or so), you can use "-O2" flag instead of "-Os" flag. The "-Oz" flag is not portable but you can use it if you're compiling with "clang"(CC="clang" and CXX="clang").
 +It gives smaller binaries than "-Os".
  
 Flags Not-allowed (good performance, but likely won't work on other machines): Flags Not-allowed (good performance, but likely won't work on other machines):
-<code bash>-march=native -mtune=native +-march=native -mtune=native
-</code>+
  
-On x86_64, [[http://forum.tinycorelinux.net/index.php/topic,14397.0.html|Juanito has suggested]] that additional flags may help reduce size, but this may break some builds: +On x86_64, Juanito has suggested that additional flags may help reduce size, but this may break some builds:
-<code>+
 CC="gcc -flto -fuse-linker-plugin" CC="gcc -flto -fuse-linker-plugin"
 CXX="g++ -flto -fuse-linker-plugin" CXX="g++ -flto -fuse-linker-plugin"
-</code> 
- 
-Please refer to [[http://www.gentoo.org/doc/en/gcc-optimization.xml]] and [[http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html]] for more compiler flags info. 
  
 +Please refer to http://www.gentoo.org/doc/en/gcc-optimization.xml and http://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html for more compiler flags info.
 Setting pkg-config paths via "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" is no longer required as the default in the latest extension includes "/usr/{local,}/{lib,share}/pkgconfig". Setting pkg-config paths via "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" is no longer required as the default in the latest extension includes "/usr/{local,}/{lib,share}/pkgconfig".
  
 Example steps to configure and compile a package_name.tar.bz2: Example steps to configure and compile a package_name.tar.bz2:
- +<code bash>tar xjvf package_name.tar.bz2
-<code bash> +
-tar xjvf package_name.tar.bz2+
 cd package_name cd package_name
 ./configure --prefix=/usr/local ./configure --prefix=/usr/local
-make -j3 +make -j3</code>
-</code>+
  
-Note: "-j3" is meant for a 2 processor system.  The general guideline is -jN where N is 1 more than the total number of processors available.+Note: "-j3" is meant for a 2 processor system. The general guideline is -jN where N is 1 more than the total number of processors available
 +unless you are on a system that supports hyperthreading (which means that the each of the physical processors acts like 2 virtual processors 
 +[because the processor does multitasking and so can run 2 processes "at once"]). 
 +If your system uses hyperthreading, use the number of physical plus the number of virtual processors(usually twice the physical processors).
  
 Create/update a date marker just in case your app doesn't support DESTDIR: Create/update a date marker just in case your app doesn't support DESTDIR:
- +<code bash>touch /tmp/mark</code>
-<code bash> +
-touch /tmp/mark +
-</code>+
  
 Install the application: Install the application:
-<code bash> 
 make DESTDIR=/tmp/package install make DESTDIR=/tmp/package install
-</code> +  (see below, "When DESTDIR Fails" if needed.)
- +
-(see below, "When DESTDIR Fails" if needed.) +
- +
-Note: some packages support "make install-strip", which strips off debugging information. [[http://forum.tinycorelinux.net/index.php?topic=2072.0|Jason W recommends doing so]] to save space. He also mentions that you can do it post-make with:+
  
-<code bash> +Note: some packages support "make install-strip", which strips off debugging information. Jason W recommends doing so to save space. He also mentions that you can do it post-make with: 
-find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null +<code bash>find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null</code>
-</code>+
  
 Run these on your package directory tree before you tar it up. Run these on your package directory tree before you tar it up.
-===== All extension creators please note ====+==== All extension creators please note ==== 
 +If you don't need a startup script, then skip the next section. The TC system will create empty tce.installed/package_name files. You can ask for help IRC or on the tce Q&A if you are having issues getting your script working OK. You may wish to see how others have done it, for x86 see http://www.tinycorelinux.net/8.x/x86/tcz/src/ or whatever version you have (If you have a newer or older version, replace 8.x with the version you have and/or x86 with your architecture).
  
-If you don't need a startup script, then skip the next section. The TC system will create empty tce.installed/package_name files. You can ask for help IRC or on the tce Q&A if you are having issues getting your script working ok.  You may wish to see how others have done it, for x86 see http://www.tinycorelinux.net/4.x/x86/tcz/src/   +gutmensch provides the following set of rules:
- +
-== gutmensch provides the following set of rules: ==+
   * Tiny Core special settings, e.g. root:staff for /usr/local/tce.installed and 775   * Tiny Core special settings, e.g. root:staff for /usr/local/tce.installed and 775
   * Shared object lib files (end in .so or .so*) are classified as executables   * Shared object lib files (end in .so or .so*) are classified as executables
Line 129: Line 110:
   * All files root:root, 644 for files, 755 for executables, 755 for directories   * All files root:root, 644 for files, 755 for executables, 755 for directories
   * Special settings varying on the software,   * Special settings varying on the software,
-  ----e.g. setuid, setgid for Xorg, read/write-only for root in /etc/private or /var/..., +    * e.g. setuid, setgid for Xorg, read/write-only for root in /etc/private or /var/..., 
-  ----special user like postfix or mysql, etc. within the extension or setup with the tce.installed/* script while booting.+    * special user like postfix or mysql, etc. within the extension or setup with the tce.installed/* script while booting.
   * [/usr/local]/etc/init.d/xyz scripts are usually system services and not user based services,   * [/usr/local]/etc/init.d/xyz scripts are usually system services and not user based services,
-  ----so the simple set here is: check for root user, if not, just fail. +    * so the simple set here is: check for root user, if not, just fail.
  
-Optional: +Most of the time(but not always) this is done automatically by the install script.
-  * If app/service can be run as a normal user (not as root!), make sure your init, start or extensions scripts  +
-  * ---are able to handle this. For example, query the $TCUSER variable and set the permissions accordingly when  +
-  * ---installing the extension. Or reconfigure the software so that it defaults to user writeable directories like $HOME, /tmp, etc +
  
 +==== Optional ====
 +  * If app/service can be run as a normal user (not as root!), make sure your init, start or extensions scripts
 +    * are able to handle this. For example, query the $TCUSER variable and set the permissions accordingly when
 +    * installing the extension. Or reconfigure the software so that it defaults to user writable directories like $HOME, /tmp, etc.
  
-== @cups example: == +@cups example: 
-  Unordered List ItemSince the service is run as root either way, the init script should also fail when not run as root, which is the easiest solution.  +  Unordered List ItemSince the service is run as root either way, the init script should also fail when not run as root, which is the easiest solution. 
-  Checkout the checkroot() helper function in /etc/init.d/tc-functions e.g. Try to use sudo in scripts as least as possible.   +  Checkout the checkroot() helper function in /etc/init.d/tc-functions e.g. Try to use sudo in scripts as least as possible. 
-reference  http://forum.tinycorelinux.net/index.php/topic,14988.msg85727.html#msg85727 +  reference http://forum.tinycorelinux.net/index.php/topic,14988.msg85727.html#msg85727
- +
-== aus9 writes: == +
-  * There are many ways to build extensions. If you prefer the build script way, it is easy to build root:root by running the script as root. Extensions can not be loaded by root powers, so change your script to the following method, you can drop the .tcz off each nameX.tcz     +
-  +
-<code bash> +
-su -c 'tce-load -i name1 name2' tc +
-</code>     +
- +
-  * To use wget as a normal user without leaving root try loading submitqc4 which autoloads wget then run +
- +
-<code bash> +
-su -c '/usr/local/bin/wget -nc http://www.some-site/download/filename.tar.gz -O /tmp/tarball-name.tar.gz' tc +
-</code> +
- +
-  * The wget.tcz is useful when you can't verify certificate so you can add  --no-check-certificate into that last command, while busybox's wget might struggle.   +
-  * When you check permissions sym links will show up as 777 which I have been advised is normal behaviour. +
- +
- +
-===== Adding Custom Startup Scripts =====    +
- +
-If your software needs a startup script then create the folder for it   +
- +
-<code bash> +
-mkdir -p /tmp/package/usr/local/tce.installed  +
-</code>   +
- +
-Next, create script as  /tmp/package/usr/local/tce.installed/package_name if you would like to do something when the package is first installed or again mounted on boot.   +
- +
-A good pattern to follow would be to first rename /tmp/package/usr/local/etc/package_name.conf to package_name.conf.sample, and for your script to check always whether /usr/local/etc/package_name.conf exists, and if no, copy over /usr/local/etc/package_name.conf.sample into it. This is so that the application's configuration files are fully writable in the natural path, without having to resort to weird paths that you determine on your own.  +
  
 +==== Adding Custom Startup Scripts ====
 +If your software needs a startup script then create the folder for it
 +<code bash>mkdir -p /tmp/package/usr/local/tce.installed</code>
 +Next, create script as **/tmp/package/usr/local/tce.installed/package_name** if you would like to do something when the package is first installed or again mounted on boot. The first line of the script should be <code bash>#!/bin/sh</code>
 +A good pattern to follow would be to first rename **/tmp/package/usr/local/etc/package_name.conf** to **package_name.conf.sample**, and for your script to check always whether /usr/local/etc/package_name.conf exists, and if no, copy over /usr/local/etc/package_name.conf.sample into it. This is so that the application's configuration files are fully writable in the natural path, without having to resort to weird paths that you determine on your own.
 e.g.: e.g.:
-<code>  +<code bash>cd /usr/local/etc/ [[ ! -e nano.rc ]] && cp -p nano.rcsample nano.rc</code> 
-cd /usr/local/etc/ [[ ! -e nano.rc ]] && cp -p nano.rcsample nano.rc +Warning: If you don't do this now, these configuration files would be read-only. Please read iconmenuinfo wiki page for more information on creating wbar icons, menu entries, setup scripts, .info and .dep files. 
-</code> +Warning: Please make sure that your script does NOT depend on the existence of files located at /tmp/tcloop/package_name (the extension's mount point) unless absolutely necessary, as this breaks the Install to File System (copy2fs.flg) feature, where extensions are extracted to memory, instead of staying mounted.
  
-**Warning**: If you don't do this now, these configuration files would be read-only Please read [[http://wiki.tinycorelinux.net/wiki:iconmenuinfo | iconmenuinfo wiki page]] for more information on creating wbar icons, menu entries, setup scripts, .info and .dep files.  +Nextfollow these commands to make script executable and with correct permissions. 
 +<code bash>sudo chown -R root:staff /tmp/package/usr/local/tce.installed 
 +sudo chmod -R 775 /tmp/package/usr/local/tce.installed</code>
  
-Nextfollow these commands to make script executable and with correct permissions +Watch out for persistence. If your startup script is creating a home file and the user has persistenceyou may like to create an IF-THEN script to check if file already exists as a part of the startup script.
  
-<code bash> +Extra steps may also be needed see [[iconmenuinfo|link]]
-sudo chown -R root:staff /tmp/package/usr/local/tce.installed  +
-sudo chmod -R 775 /tmp/package/usr/local/tce.installed  +
-</code>+
  
-Watch out for persistence--If your startup script is creating a home file and the user has persistence, you may like to create an IF-THEN script to check if file already exists as a part of the startup script.          
  
-===== Extra steps may also be needed see link ===== +===== License ===== 
 +Please check the license condition. Although we can strip a number of documents from the main tcz and have a separate doc.tcz, this is not always possible. eg if you see a file called COPYING and it has a section like this: 
 +<code>The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.</code> 
 +Please create and copy the relevant file, eg: 
 +<code bash>mkdir -p /tmp/package/usr/local/share/doc/package 
 +cp -f COPYING /tmp/package/usr/local/share/doc/package</code>
  
-[[wiki:iconmenuinfo]] +===== Creating a .tcz ===== 
 +If the program supports DESTDIR (most do) the files will be installed in /tmp/package, but configured for /usr/local. In this case, create extension like this: 
 +<code bash>cd /tmp 
 +mksquashfs package program_name.tcz 
 +cd /tmp/package</code>
  
-===== License ===== +Next create the list of files in the extension, it will be submitted with the extension: 
 +<code bash>find usr -not -type d > program_name.tcz.list</code>
  
-Please check the **license** condition. Although we can strip a number of documents from the main tcz and have a separate doc.tcz, this is not always possible. eg if you see a file called COPYING and it has a section like this+As a final step, remove the packed files from /tmp/package: 
 +<code bash>rm -rf usr</code>
  
-<code> +===== When DESTDIR Fails ===== 
-The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.  +Just about all applications support the use of DESTDIR on the make line (as above). There are those that don't, however. If your application does not support DESTDIR, it will likely install into subdirectories of root, rather than tmp. 
-</code> +One possible solution from the forums, by Jason W, uses a time stamp, find, and tar. 
 +As above, set the ./configure installation prefix as normal. Then be sure to create a time stamp after make, but do it just before make install. Use find to list all the newly installed files, and then gather those files up using tar
 +<code bash>./configure --prefix=/usr/local 
 +make 
 +touch /tmp/mark #in case DESTDIR fails 
 +make install DESTDIR=/tmp/pkg #DESTDIR may not work 
 +find /usr/local -newer /tmp/mark -not -type d > /tmp/list 
 +tar -T /tmp/list -czvf /tmp/someapp.tar.gz</code>
  
-Please create and copy the relevant file, eg +For TC newer than 2.4, you will need to unzip the tar file, and then use mksquashfs to create your extension: 
 +<code bash>mkdir /tmp/pkg 
 +cd /tmp/pkg 
 +tar -xf /tmp/someapp.tar.gz #'install' the extension in tmp 
 +cd /tmp 
 +mksquashfs pkg/ someapp.tcz</code>
  
-<code bash> +Be careful using touch/find -newer method. There are files just copied by installer from the source package, like configuration files, header files, scripts, doc files, images, etc. with original date, therefore they are not detected. Check installer messages!
-mkdir -p /tmp/package/usr/local/share/doc/package  +
-cp -f COPYING /tmp/package/usr/local/share/doc/package +
-</code>+
  
-=====  Creating a .tcz =====  +===== Testing ===== 
 +Test out your new extension(s) by manually loading them after booting TC with the cheatcodes: 
 +<code>base norestore</code>
  
-If the program supports DESTDIR (most do) the files will be installed in /tmp/packagebut configured for /usr/local. In this case, create extension like this:  +Load your extensionand check: 
 +  * all dependencies loaded? 
 +  * menu item works? wbar/desktop icons work? 
 +  * program actually runs?
  
-<code bash> +It is easy to leave out a required dependency from your .dep file. Do use base norestore, and check the dependencies in particular. 
-cd /tmp  +If you are planning on submitting your extension for inclusion in the repository, you should run the extension auditing script, which is in the repository as submitqc.tcz.
-mksquashfs package program_name.tcz  +
-cd /tmp/package +
-</code> +
  
-Next create the list of files in the extension, it will be submitted with the extension:  +===== Separation ===== 
 +Smaller extensions reduce 'bloat' in Tiny Core. To help out: 
 +  * move translations and other locale data into a locale extension (myprogram-locale.tcz) 
 +  * move documentation and help files into a doc extension (myprogram-doc.tcz) 
 +  * rather than including docs in your extension, use the info file to list official online docs. 
 +  * move headers and static libraries to a dev extension(myprogram-dev.tcz)
  
-<code bash> +===== Required Files ===== 
-find usr -not -type d > program_name.tcz.list +Submissions must include: 
-</code> +  * the extension file (.tcz) 
 +  * a list of its contents (.tcz.list) 
 +  * an md5 sum (.tcz.md5.txt) 
 +  * an info file describing its contents (.tcz.info) this content is standardized. Visit the repository for examples(The link is to the 8.x repository. If you have a different version, follow the link, and then replace 8.x with whatever version you have[but only the major release eg. 7.x 9.x, not the minor release eg8.0, 7.2]). Also see the example below. 
 +  * a dependency list, if necessary (.tcz.dep) 
 +  * If the source is under the GPL license, include the source as well. 
 +  * a .tcz.zsync (autogenerated by submitqc)
  
-As final stepremove the packed files from /tmp/package:  +It is not required, but certainly recommended, that you include any additional build instructions in plain text file for future referencementioning such things as which extensions are required to build the package and what compile flags were used. This can be done in a file named "build-dep". For example, the build-dep file for urxvt looks like this: 
 +<code>Required extensions to build: 
 +Xorg-7.4-dev 
 +Xlibs_support
  
-<code bash> +Notes: 
-rm -rf usr +256-color patch applied
-</code>  +
  
-=====  When DESTDIR Fails =====  +Additional configure options: 
 +  * -enable-xft 
 +  * -with-codesets=none 
 +  * -disable-afterimage 
 +  * -disable-xterm-scroll 
 +  * -disable-next-scroll 
 +  * -disable-perl</code>
  
-Just about all applications support the use of DESTDIR on the make line (as above). There are those that don't, however. If your application does not support DESTDIR, it will likely install into subdirectories of root, rather than tmp +This is just an exampleand the format can be however you desireAgain, this is not requiredbut is a helpful practice, as it will help if you update the extension for a new release.
  
-[[http://forum.tinycorelinux.net/index.php?topic=1275.0 | One possible solution from the forums, by Jason W]], uses a time stamp, find, and tar.   +===== .tcz.info example ===== 
- +<code>Title:          package_name.tcz 
-As above, set the ./configure installation prefix as normal. Then be sure to create a time stamp after make, but do it just before make install. Use find to list all the newly installed files, and then gather those files up using tar.   +Description:    package description 
- +Version:        0.1 
-<code bash> +Author:         Author(s) name 
-./configure --prefix=/usr/local  +Original-site:  http://website.domain 
-make  +Copying-policy: GPL v1 
-touch /tmp/mark #in case DESTDIR fails  +Size:           100K (of the package) 
-make install DESTDIR=/tmp/pkg #DESTDIR may not work ...  +Extension_by:   Your nickname 
-find /usr/local -newer /tmp/mark -not -type d > /tmp/list  +Tags:           tag1 tag2 tag3 ... 
-tar -T /tmp/list -czvf /tmp/someapp.tar.gz +Comments:       Information that you consider useful 
-</code>   +                for those who will be use this package. 
- +                ---- 
-For TC past 2.4, you will need to unzip the tar file, and then use mksquashfs to create your extension:   +                Compiled for TC 4.x 
- +                ---- 
-<code bash> +                PPI Compatible
-mkdir /tmp/pkg  +
-cd /tmp/pkg  +
-tar -xf /tmp/someapp.tar.gz #'install' the extension in tmp  +
-cd /tmp  +
-mksquashfs pkg/ someapp.tcz +
-</code> +
- +
-Be careful using touch/find -newer method. There are files just copied by installer from the source package, like configuration files, header files, scripts, doc files, images, etc. with original date, therefore they are not detected. Check installer messages!   +
- +
-=====  Testing =====   +
- +
-Test out your new extension(s) by manually loading them after booting TC with the cheatcodes:   +
- +
-^base norestore^   +
- +
-Load your extension, and check:  +
-  - all dependencies loaded?  +
-  - menu item works? wbar/desktop icons work?  +
-  - program actually runs?   +
- +
-It is easy to leave out a required dependency from your .dep file. Do use base norestore, and check the dependencies in particular.   +
- +
-If you are planning on submitting your extension for inclusion in the repository, you should run the [[http://forum.tinycorelinux.net/index.php?topic=2475.0|extension audit script]] as well. The script is now available as an extension called submitqc.tcz. (Remember that if you want to download the script from the forum, you need to be logged in to see the links.)   +
- +
-=====  Submission =====    +
- +
-=====  Separation =====   +
- +
-Smaller extensions reduce 'bloat' in Tiny Core. To help out:   * move translations and other locale data into a locale extension (myprogram-locale.tcz)   * move documentation and help files into a doc extension (myprogram-doc.tcz)   * rather than including docs in your extension, use the info file to list official online docs.   +
- +
-===== Required Files =====   +
- +
-Submissions must include:  +
-  * the extension file (.tcz)  +
-  * a list of its contents (.tcz.list)  +
-  * an md5 sum (.tcz.md5.txt)  +
-  * an info file describing its contents (.tcz.info) - this content is standardized. [[http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/|Visit the repository for examples]].  +
-  * a dependency list, if necessary (.tcz.dep)  +
-  * If the source is under the GPL license, include the source as well.   +
-  * a .tcz.zsync (autogenerated with submitqc4)   +
- +
-It is not required, but certainly recommended, that you include any additional build instructions in a plain text file for future reference, mentioning such things as which extensions are required to build the package and what compile flags were used. This can be done in a file named "build-dep". For example, the build-dep file for urxvt looks like this:  +
- +
-<code> +
-Required extensions to build:  +
-Xorg-7.4-dev  +
-Xlibs_support   +
- +
-Notes:  +
-256-color patch applied   +
- +
-Additional configure options:  +
-  * -enable-xft  +
-  * -with-codesets=none  +
-  * -disable-afterimage    +
-  * -disable-xterm-scroll    +
-  * -disable-next-scroll    +
-  * -disable-perl +
-</code>   +
- +
-This is just an example, and the format can be however you desire. Again, this is not required, but is a helpful practice, as it will help if you update the extension for a new release.  +
- +
-=====  .tcz.info example=====   +
- +
-<code>  +
-Title:          package_name.tcz  +
-Description:    package description  +
-Version:        0.1  +
-Author:         Author(s) name  +
-Original-site:  http://website.domain  +
-Copying-policy: GPL v1  +
-Size:           100K (of the package)  +
-Extension_by:   Your nickname  +
-Tags:           tag1 tag2 tag3 ...  +
-Comments:       Information that you consider useful  +
-                for those who will be use this package.  +
-                ----                  +
-                Compiled for TC 4.x                  +
-                ----    +
-                PPI Compatible +
 Change-log:     2012/00/01 First version, 0.1 Change-log:     2012/00/01 First version, 0.1
-                2012/01/01 Short change description  +                2012/01/01 Short change description 
-Current:        2012/02/01 Current short change description  +Current:        2012/02/01 Current short change description</code>
-</code>   +
- +
-If the package contains a program, the best choice for its name is the bin name (this will ensure that program start directly if you load package ondemand). Alternatively, it is better to use suffixes on standard name of content instead of prefixes to customize the package name because in the main type of research in appbrowser ("search") you can only omit final letters. e.g., if the package name is gold_eggs, if I search eggs I do not find it, if I search Gold I find it (case is not important).   +
- +
-In field "Comments" string "PPI Compatible" (if the package is compatible with "Persistent Personal Installation" mode, usually if we have used /usr/local directory as a installation prefix) seems no longer to be specified since this type of operation has been removed from 4.x   +
- +
-===== .tcz.dep example =====   +
  
-If submitting a package called fruit.tcz your depend should be a simple list of main dependencies, one tcz per line with no indentationMeaning it has  no gaps or "tree" structure  +If the package contains program, the best choice for its name is the bin name (this will ensure that program start directly if you load package ondemand [but you need to make an executable shell script usr/local/tce.installed/<bin_name> for that to work {make the script then do chmod +x usr/local/tce.installed/<bin_name>}]). The paths would be under you package's root. 
 +In field "Comments" string "PPI Compatible" (if the package is compatible with "Persistent Personal Installation" mode, usually if we have used /usr/local directory as a installation prefix) seems no longer to be specified since this type of operation has been removed from 4.x and later. Of course, it doesn't break anything to add PPI Compatible, but it can be kind of confusing since it was removed 4 major releases ago!
  
-Right example: fruit.tcz.dep +===== DAEMONS ===== 
 +Please show //full pathways// to start daemons in your info fileTC does not condone starting daemons in your tce.install script. 
 +<code>$ sudo /usr/local/etc/init.d/dbus start</code>
  
-<code> +===== .tcz.dep example ===== 
-apple.tcz banana.tcz  +If submitting a package called fruit.tcz your depend should be a simple list of main dependencies, one tcz per line with no indentation. Meaning it has no gaps or "tree" structure
-</code>  +
  
-Wrong example: fruit.tcz.dep +Right example: <file dep fruit.tcz.dep
 +apple.tcz 
 +banana.tcz</file>
  
-<code+Wrong example: <file dep fruit.tcz.dep
-apple.tcz  +apple.tcz 
-  chemicals.tcz  +  chemicals.tcz 
-banana.tcz  +banana.tcz</file> 
-</code   +If package has no dependencies, do not submit a .dep file but in email please mention that there are no dependencies.
  
-If package has **no dependencies*do not submit any file but in email please alert tcz checker that there are no dependencies    +===== Submitting ===== 
 +Have you run the extension audit script (//submitqcx// where x is the major release of tinycore that you have {legacy, not available for newer releases} or //submitqc//) to test your extension? 
 +If so, create a gzip archive. For example, if all the required files are in one directory, the command would look like this: 
 +<code bash>tar zcf extension.tar.gz *</code> 
 +Or, alternatively, if you have temporary directories in the directory you put the extensions in, you can use this code(and want more compression): 
 +<code bash>tar -cf extension.tar *.tcz* 
 +gzip -9 extension.tar</code> 
 +Our email provider sometimes blocks emails with .tar or .tar.gz attachments, so please encrypt your contribution using bcrypt (use 'tinycore' as the encryption key): 
 +<code bash>bcrypt extension.tar.gz 
 +Encryption key: tinycore</code>
  
-=====  Send to =====  +Send the resulting extension.tar.gz.bfe file to **tcesubmit @ gmail ... com** (without spaces or extra periods.)
  
-Have you run the [[http://forum.tinycorelinux.net/index.php?topic=2475.0|extension audit script]] to test your extension? If so, create a gzip archive. For example, if all the required files are in one directory, the command would look like this:  +For piCore (Raspberry Pi) extensions send it to **picoresubmit @ gmail ... com** (without spaces or extra periods.)
  
-<code bash> +For more details, read the submission guidelines thread.
-tar zcf extension.tar.gz * +
-</code>  +
  
-Send the resulting extension.tar.gz file to **tcesubmit _at_ gmail _dot_ com** +Gmail currently limits attachments to 25 Mb per email.
  
-For piCore (Raspberry Pi) extensions send it to **picoresubmit _at_ gmail _dot_ com**.   
  
-Files part of an extension package are Gmail neutral and accepted for delivery, no need to encrypt.   For more details, read the [[http://forum.tinycorelinux.net/index.php?topic=330.0|guildelines forum thread]]. 
Print/export
QR Code
QR Code wiki:creating_extensions (generated for current page)