SliTaz GNU/Linux official and community documentation wiki.
.png

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:handbook:development [2010/07/08 17:14]
127.0.0.1 external edit
en:handbook:development [2016/10/24 16:24] (current)
hgt IDE Geany replaced by Beaver
Line 11: Line 11:
 === Create a SHell script === === Create a SHell script ===
  
-Before starting a new SHell script, you must pay attention to the interpreter used. Most SHell scripts use ///​bin/​sh//,​ because it's more portable, but there are scripts that rely on ///​bin/​bash//​ and this must be installed on the system. For a SHell script to functionit must be made executable by changing permissions on the command line using the chmod tool. To create a script.sh and make it executable:+Before starting a new SHell script, you must pay attention to the interpreter used. Most SHell scripts use ///​bin/​sh//,​ because it's more portable, but there are scripts that rely on ///​bin/​bash//​ and this must be installed on the system. For a SHell script to function it must be made executable by changing permissions on the command line using the chmod tool. To create a script.sh and make it executable:
  
 <​code>​ $ touch script.sh <​code>​ $ touch script.sh
Line 17: Line 17:
 </​code>​ </​code>​
  
-Now that you have a new executable file, you can edit it. You can continue to stay in the terminal and use the Nano editor (Ctrl + x to save & exit) or IDE Geany to edit:+Now that you have a new executable file, you can edit it. You can continue to stay in the terminal and use the Nano editor (Ctrl + x to save & exit) or IDE Beaver ​to edit:
  
 <​code>​ <​code>​
  $ nano script.sh  $ nano script.sh
  Or :  Or :
- ​$ ​geany script.sh &+ ​$ ​beaver ​script.sh &
 </​code>​ </​code>​
  
 Here's a script that contains a variable NAME and displays the value with the echo command: Here's a script that contains a variable NAME and displays the value with the echo command:
  
-<code>+<file>
 #!/bin/sh #!/bin/sh
  
Line 33: Line 33:
  
 echo "$NAME is nice." echo "$NAME is nice."
-</code>+</file>
  
 Once you have created/​modified your script.sh, you can execute it to see the result: Once you have created/​modified your script.sh, you can execute it to see the result:
Line 48: Line 48:
    ​--msgbox "​Message made by dialog."​ 5 54 </​code>​    ​--msgbox "​Message made by dialog."​ 5 54 </​code>​
  
-You can find plenty of example scripts in the ///sample// directory inside the source code of dialogwhich can be downloaded from: http://​invisible-island.net/​dialog/​dialog.html. Download sources and decompress:+You can find plenty of example scripts in the ///sample// directory inside the source code of dialog which can be downloaded from: http://​invisible-island.net/​dialog/​dialog.html. Download sources and decompress:
  
 <​code>​ $ wget ftp://​invisible-island.net/​dialog/​dialog.tar.gz <​code>​ $ wget ftp://​invisible-island.net/​dialog/​dialog.tar.gz
Line 54: Line 54:
 </​code>​ </​code>​
  
-===== Geany IDE =====+===== Beaver ​=====
  
-Geany is an IDE or Integrated Development Environment. Geany is simple, ​quick and light, ​offering ​colored ​syntax, tabs and auto completionGeany was used to create this page and most of the website documentation (with a little bit of Nano as well).+Beaver ​is simple, ​lightweight ​and fast code editor ​offering syntax. ​Beaver can be found in the Menu -> Development -> Code Editor. Once launched for the first time you can adjust your preferences through the Edit button. You can run it through a X terminal ​with the following command:
  
-=== Launch Geany ===+<​code>​ $ beaver & </​code>​
  
-You will find Geany in the //menu --> Development --> Geany//. Once launched for the first time, you can adjust your preferences via Edit --> Preferences. You can also launch Geany via a terminal:+===== Geany IDE=====
  
-<​code>​ $ geany & </​code>​+Geany is an IDE, or Integrated Development Environment. It is a simple, small and lightweight application,​ offering syntax, tabs and self-completion.
  
-Note when compiling ​the source code, the ./configure script offers the option: ​//​-enable-the-force//​... Which you can use if you ever feel the need to become Luke Skywalker!+==== Executing Geany ==== 
 + 
 +You can install Geany:  
 + 
 +<​code>#​ tazpkg get-install geany</​code>​ 
 + 
 +After it runs for the first time, you can set your preferences through the menu //Edit// --> //​Preferences//​ option. It is also possible to run Geany via terminal: 
 + 
 +<​code>​$ geany &</​code>​ 
 + 
 +Notewhen compiling source code, the //./configure// script offers the //​-enable-the-force// ​option, which you could use if you feel the need to became a Jedi warrior!
  
 ===== Perl or Microperl - Code/use Perl scripts ===== ===== Perl or Microperl - Code/use Perl scripts =====
  
-On SliTaz you can use the powerful scripting language Perl via the perl or microperl binary. Microperl is a streamlined version of perl compiled from official sources, Perl scripts running Microperl are compatible with the complete version of Perl. One of Perl's strengths is its portability,​ it can be used on any system and it's an interpreted language, which means that the code doesn'​t need to be compiled and can be used directly. On SliTaz, Perl and Microperl are not installed by default on the LiveCD: you can either rebuild your ISO or install through the package manager. Note: Microperl is only 1 MB and provides no modules:+On SliTaz you can use the powerful scripting language Perl via the perl or microperl binary. Microperl is a streamlined version of perl compiled from official sources, Perl scripts running Microperl are compatible with the complete version of Perl. One of Perl's strengths is its portability,​ it can be used on any system and it's an interpreted language, which means that the code doesn'​t need to be compiled and can be used directly. On SliTaz, Perl and Microperl are not installed by default on the LiveCD: you can either rebuild your ISO or install through the package manager. Note: Microperl is only 1 MB and provides no modules:
  
 <​code>​ <​code>​
Line 78: Line 88:
 === Hello world! === === Hello world! ===
  
-The purpose of this script is to display Hello World. You can start by creating the file and making it executable on the command line and then editing with IDE Geany. Note the script is called hello.pl, but you can name it as you see fit, with or without the .pl extension:+The purpose of this script is to display Hello World. You can start by creating the file and making it executable on the command line and then editing with Beaver. Note the script is called hello.pl, but you can name it as you see fit, with or without the .pl extension:
  
 <​code>​ <​code>​
  $ touch hello.pl  $ touch hello.pl
  $ chmod +x hello.pl  $ chmod +x hello.pl
- ​$ ​geany hello.pl &+ ​$ ​beaver ​hello.pl &
 </​code>​ </​code>​
  
 The first line of a Perl script begins by defining the path to the Perl interpreter,​ usually ///​usr/​bin/​perl//​ and to display text, just use the print command. It should be noted that Perl is case sensitive and a line of code should always end with a semicolon. Example code (you can copy and paste): The first line of a Perl script begins by defining the path to the Perl interpreter,​ usually ///​usr/​bin/​perl//​ and to display text, just use the print command. It should be noted that Perl is case sensitive and a line of code should always end with a semicolon. Example code (you can copy and paste):
  
-<code>+<file>
 #​!/​usr/​bin/​perl #​!/​usr/​bin/​perl
 # #
Line 94: Line 104:
 print "Hello World!\n";​ print "Hello World!\n";​
  
-</code>+</file>
 To execute and test the script: To execute and test the script:
  
Line 103: Line 113:
 CGI scripts are designed to display dynamically generated web pages. The Perl language associated with the LightTPD web server allows you to use CGI scripts through your public space or via virtual hosts. Perl is quite adapted to Web 2.0 and can generate xHTML pages. On SliTaz you must have Perl or Microperl installed and the LightTPD server configured before you can use CGI scripts coded in Perl. Note that by default SHell scripts (.sh) can be placed in /cgi-bin/. CGI scripts are designed to display dynamically generated web pages. The Perl language associated with the LightTPD web server allows you to use CGI scripts through your public space or via virtual hosts. Perl is quite adapted to Web 2.0 and can generate xHTML pages. On SliTaz you must have Perl or Microperl installed and the LightTPD server configured before you can use CGI scripts coded in Perl. Note that by default SHell scripts (.sh) can be placed in /cgi-bin/.
  
-Once the server is properly configured, you can put your CGI in your //​$HOME/​Public/​cgi-bin//​ using the //.pl// or //.cgi// extension and view them locally or remotely. Example of using a Perl CGI script:+Once the server is properly configured, you can put your CGI in your //​$HOME/​Public/​cgi-bin//​ using the //.pl// or //.cgi// extension and view them either ​locally or remotely. Example of using a Perl CGI script:
  
-<code>+<file>
 #​!/​usr/​bin/​perl #​!/​usr/​bin/​perl
 # #
Line 111: Line 121:
  
 print "Hello World!\n";​ print "Hello World!\n";​
-</code>+</file>
  
 ===== Python ===== ===== Python =====
Line 127: Line 137:
 ===== Toolchain - Libraries, C compiler and tools ===== ===== Toolchain - Libraries, C compiler and tools =====
  
-To compile software from sources or your own code, you need at least the basic toolchain, comprising of Binutils, Glibc, C compiler, Kernel headers and the Make utility. Note that the toolchain is used by the SliTaz developers to compile the entire system from source. To install the meta package and all dependancies:+To compile software from sources or your own code, you need at least the basic toolchain, comprising of Binutils, Glibc, C compiler, Kernel headers and the Make utility. Note that the toolchain is used by the SliTaz developers to compile the entire system from source. To install the meta package and all dependencies:
  
 <​code>​ # tazpkg get-install slitaz-toolchain </​code>​ <​code>​ # tazpkg get-install slitaz-toolchain </​code>​
Line 135: Line 145:
 <​code>​ $ tazpkg search pkg-config </​code>​ <​code>​ $ tazpkg search pkg-config </​code>​
  
-If you would like to compile applications utilizing the Ncurses library, you must install the ncurses-dev package. Note the ncurses package also provides a variety of small programs such as tic or tack:+If you would like to compile applications utilizing the Ncurses library, you must install the ncurses-dev package. Note the ncurses package also provides a variety of small programs such as tic or tac:
  
 <​code>​ $ tazpkg search ncurses </​code>​ <​code>​ $ tazpkg search ncurses </​code>​
  
 
en/handbook/development.1278602061.txt.gz · Last modified: 2010/07/29 19:53 (external edit)