Difference between revisions of "EasyPBI"

From PC-BSD Wiki
Jump to: navigation, search
m
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<noinclude>{{NavHeader|back=Control Panel|forward=About}}</noinclude>
 
<noinclude>{{NavHeader|back=Control Panel|forward=About}}</noinclude>
  
EasyPBI is a graphical application that makes it easy to build a PBI module from a FreeBSD port. Beginning with PC-BSD® 9.1, EasyPBI ships with PC-BSD® and can be found in the Control Panel.
+
'''NOTE: this page is deprecated.''' Refer to [[EasyPBI2]] instead.
  
This section demonstrates how to use this utility to convert an existing FreeBSD port into a PC-BSD® PBI. You may wish to skim the section on how to [[Create PBIs]] first, as well as refer to that Guide should you have trouble creating a PBI or wish to create a more complex PBI.
+
EasyPBI is a graphical application that makes it easy to build a PBI module from a FreeBSD port. Beginning with PC-BSD®&nbsp;9.1, EasyPBI ships with PC-BSD® and can be found in the [[Control Panel]].
 +
 
 +
This section demonstrates how to use this utility to convert an existing FreeBSD port into a PC-BSD® PBI. [[File:Easypbi1b.png|thumb|393px|'''Figure 8.1b: EasyPBI Graphical Interface''']] You may wish to skim the section on how to [[PBI Module Builder Guide | Create PBIs]] first, as well as refer to that Guide should you have trouble creating a PBI or wish to create a more complex PBI.
  
 
To start EasyPBI, double-click its icon in Control Panel or type '''EasyPBI''' from within an X terminal as your regular user account.
 
To start EasyPBI, double-click its icon in Control Panel or type '''EasyPBI''' from within an X terminal as your regular user account.
Line 9: Line 11:
 
If the ports collection is not installed, you will receive the message shown in Figure 8.1a the first time you start EasyPBI.
 
If the ports collection is not installed, you will receive the message shown in Figure 8.1a the first time you start EasyPBI.
 
   
 
   
'''Figure 8.1a: Ports Must be Installed to Use EasyPBI'''
+
[[File:Easypbi1d.png|center|thumb|'''Figure 8.1a: Ports Must be Installed to Use EasyPBI''']]
 
+
[[File:Easypbi1d.png]]
+
 
+
If multiple users will be using the EasyPBI utility, go to ''[[Control Panel]]'' ➜ [[System Manager#Install FreeBSD Source and Ports| ''System Manager'' ➜ ''Tasks'']] and click the ''Fetch Ports Tree'' button. Alternately, use the following command as the superuser: '''portsnap fetch extract.''' Either of these methods will install the ports collection into ''/usr/ports.''
+
 
+
If you are the only user who will be using the EasyPBI utility, click OK to launch the main EasyPBI screen, shown in Figure 8.1b. Click ''File'' ➜ ''Get Ports'' which will download the ports collection to the ''[[EasyPBI]]'' subdirectory located in your home directory.
+
  
'''Figure 8.1b: EasyPBI Graphical Interface'''
+
If multiple users will be using the EasyPBI utility, go to ''[[Control Panel]]'' ➜ [[System Manager#Install FreeBSD Source and Ports| ''System Manager'' ➜ ''Tasks'']] and click the ''Fetch Ports Tree'' button. Alternately, use the following command as the superuser '''portsnap fetch extract'''. Either of these methods will install the ports collection into ''/usr/ports''.
  
[[File:Easypbi1b.png]]
+
If you are the only user who will be using the EasyPBI utility, click ''OK'' to launch the main EasyPBI screen, shown in Figure 8.1b. Click ''File'' ➜ ''Get Ports'' which will download the ports collection to the ''[[EasyPBI]]'' subdirectory located in your home directory.
  
If the ports collection was already installed or was installed using System Manager or '''portsnap''', the message in the bottom area of the screen will instead indicate "To get started, please push the "New Module" button.
+
If the ports collection was already installed or was installed using System Manager or '''portsnap''', the message in the bottom area of the screen will instead indicate To get started, please push the ''New Module'' button.
  
== Creating a PBI Module ==
+
== Creating a PBI Module ==  
  
 
Before building a PBI, refer to the {{citelink|url=http://forums.pcbsd.org/forumdisplay.php?f=61|txt=PBI Requests forum}} to determine which PBIs have been requested by users. You should also check that a module does not already exist for the PBI in the {{citelink|url=http://trac.pcbsd.org/browser#pbi/modules|txt=PBI Modules}} section of trac. Existing modules are listed alphabetically, according to their category in the ports collection.
 
Before building a PBI, refer to the {{citelink|url=http://forums.pcbsd.org/forumdisplay.php?f=61|txt=PBI Requests forum}} to determine which PBIs have been requested by users. You should also check that a module does not already exist for the PBI in the {{citelink|url=http://trac.pcbsd.org/browser#pbi/modules|txt=PBI Modules}} section of trac. Existing modules are listed alphabetically, according to their category in the ports collection.
  
To create a new module, click the "New Module" button and use the browser to select the desired port from the FreeBSD ports tree. Once a port is selected, EasyPBI will attempt to automatically supply the port information for the PBI and display the results in the GUI. In the example shown in Figure 8.1c, the ''net/trickle'' port has been selected and the fields have been auto-filled in.  
+
To create a new module, click the ''New Module'' button and use the browser to select the desired port from the FreeBSD ports tree. Once a port is selected, EasyPBI will attempt to automatically supply the port information for the PBI and display the results in the GUI. In the example shown in Figure 8.1c, the ''net/trickle'' port has been selected and the fields have been auto-filled in.  
 
+
'''Figure 8.1c: Review the New Module'''
+
 
+
[[File:Easypbi1c.png]]
+
  
 
You should review these fields for accuracy. If you click "Get Port Info" {{citelink|url=http://freshports.org|txt=FreshPorts.org}} will open in the default web browser so that you can view additional information about the port.  
 
You should review these fields for accuracy. If you click "Get Port Info" {{citelink|url=http://freshports.org|txt=FreshPorts.org}} will open in the default web browser so that you can view additional information about the port.  
  
A generic icon will be supplied for the module; you can change the default icon by clicking the "Choose Icon" button. When using a custom icon, use a 64x64 ''.png'' file with a transparent background.  
+
A generic icon will be supplied for the module; you can change the default icon by clicking the ''Choose Icon'' button. When using a custom icon, use a 64x64 ''.png'' file with a transparent background.  
  
Check the "Create Desktop/Menu Entries" if you wish the program's icon to be available on the desktop and in the desktop's application menu.
+
Check the ''Create Desktop/Menu Entries' if you wish the program's icon to be available on the desktop and in the desktop's application menu.
  
Once the port information is complete, click the "Create Module" button and EasyPBI will produce the PBI module. The module will be named after the port and will be stored in a subdirectory of the ''EasyPBI/Modules'' directory in your home directory. In this example, the module is located in ''EasyPBI/Modules/trickle.''
+
Once the port information is complete, click the ''Create Module'' button and EasyPBI will produce the PBI module. The module will be named after the port and will be stored in a subdirectory of the ''EasyPBI/Modules'' directory in your home directory. In this example, the module is located in ''EasyPBI/Modules/trickle''. [[File:Easypbi1c.png|thumb|'''Figure 8.1c: Review the New Module''']]
  
=== Build the Module ===
+
=== Build the Module ===  
  
 
Creating the module itself is very quick and takes less than a minute. However, you still need to build and test the module to make sure that the application works as expected. Depending upon the complexity of the application, you may have to edit the initial module then rebuild and retest it until you are satisfied with the PBI for the application.
 
Creating the module itself is very quick and takes less than a minute. However, you still need to build and test the module to make sure that the application works as expected. Depending upon the complexity of the application, you may have to edit the initial module then rebuild and retest it until you are satisfied with the PBI for the application.
  
Once the module is created, you are ready to build a PBI from the module. Click on the "Build PBI" tab and click the "Select Module" button to browse to the module you created. Figure 8.1d shows this tab with our example PBI selected.
+
Once the module is created, you are ready to build a PBI from the module. Click on the ''Build PBI'' tab and click the ''Select Module'' button to browse to the module you created. Figure 8.1d shows this tab with our example PBI selected.
 
+
'''Figure 8.1d: The Build PBI Tab'''
+
 
+
[[File:Easypbi3b.png]]
+
  
 
The top half of this screen contains modifiable settings which are used when building PBIs:
 
The top half of this screen contains modifiable settings which are used when building PBIs:
Line 55: Line 43:
 
'''Save Settings as Defaults:''' the settings in this section revert back to the default settings when you exit EasyPBI. This allows you to override the default settings for a particular build. If you wish your changes to be permanent, click this button.
 
'''Save Settings as Defaults:''' the settings in this section revert back to the default settings when you exit EasyPBI. This allows you to override the default settings for a particular build. If you wish your changes to be permanent, click this button.
  
'''Output Directory:''' specifies the directory to store the built module. By default, it is the ''EasyPBI/PBI'' subdirectory of the user's home directory. Click the "Change Directory" button to select another location.
+
'''Output Directory:''' specifies the directory to store the built module. By default, it is the ''EasyPBI/PBI'' subdirectory of the user's home directory. Click the ''Change Directory'' button to select another location.
  
'''Digital Signature File:''' the PBIs available from the PC-BSD® repositories are digitally signed by the PC-BSD® project's signature file. If you are creating your own repository, click the "Change File" button to select your own digital signature file. [[#Create Your Own PBI Repository|Create Your Own PBI Repository]] provides instructions for creating a signature file.
+
'''Digital Signature File:''' the PBIs available from the PC-BSD® repositories are digitally signed by the PC-BSD® project's signature file. If you are creating your own repository, click the ''Change File'' button to select your own digital signature file. [[File:Easypbi3b.png|thumb|393px|'''Figure 8.1d: The Build PBI Tab''']] [[Create Your Own PBI Repository]] provides instructions for creating a signature file.
  
 
'''Use TMPFS:''' if your build system has a lot of RAM, selecting this option can speed up the build.
 
'''Use TMPFS:''' if your build system has a lot of RAM, selecting this option can speed up the build.
Line 69: Line 57:
 
'''Build PBI:''' starts the build of the PBI module. It will prompt you for the superuser password and requires a working Internet connection in order to build the PBI. This process may take quite a while, depending upon the port selected and the speed of your computer. The build messages will be displayed in the window at the bottom of the tab. EasyPBI will inform you when the PBI build is finished, and whether it was successful or not.
 
'''Build PBI:''' starts the build of the PBI module. It will prompt you for the superuser password and requires a working Internet connection in order to build the PBI. This process may take quite a while, depending upon the port selected and the speed of your computer. The build messages will be displayed in the window at the bottom of the tab. EasyPBI will inform you when the PBI build is finished, and whether it was successful or not.
  
'''Stop Build:''' stops the build process. Click the "Build PBI" button to resume the build.
+
'''Stop Build:''' stops the build process. Click the ''Build PBI'' button to resume the build.
  
 
'''Save Build Log:''' useful if the build fails. Will prompt you to select the location to store ''build.log'' which can be read with any ASCII text editor.
 
'''Save Build Log:''' useful if the build fails. Will prompt you to select the location to store ''build.log'' which can be read with any ASCII text editor.
  
You can produce additional modules from the "Create Module" tab while a PBI build is running.
+
You can produce additional modules from the ''Create Module'' tab while a PBI build is running.
  
 
If the PBI build fails for some reason, you may need to modify the module as described in the next section. Use the build log to determine the error and modify the module as needed. If you are unsure how to fix the module, send the ''build.log'' for the failure to the {{citelink|url=http://lists.pcbsd.org/mailman/listinfo/pbi-dev|txt=pbi-dev mailing list}}.
 
If the PBI build fails for some reason, you may need to modify the module as described in the next section. Use the build log to determine the error and modify the module as needed. If you are unsure how to fix the module, send the ''build.log'' for the failure to the {{citelink|url=http://lists.pcbsd.org/mailman/listinfo/pbi-dev|txt=pbi-dev mailing list}}.
  
=== Test and Fine-Tune the Module ===
+
=== Test and Fine-Tune the Module ===  
  
 
Once your build is finished, test the PBI to ensure that it installs and that the application works.
 
Once your build is finished, test the PBI to ensure that it installs and that the application works.
  
To install the PBI, become the superuser, '''cd''' to the "Output Directory", and use the '''pbi_add''' command. Unless you have specified your own digital signature,  include the '''--no-checksig''' option.
+
To install the PBI, become the superuser, '''cd''' to the "Output Directory", and use the '''pbi_add''' command. Unless you have specified your own digital signature,  include the '''--no-checksig''' option.[[File:easypbi4a.png|thumb|393px|'''Figure 8.1e: EasyPBI Module Editor''']]
  
'''su'''
+
{{txtbox|box='''su'''
Password:
+
Password:
'''cd ~dru/EasyPBI/PBI'''
+
'''cd ~dru/EasyPBI/PBI'''
'''ls'''
+
'''ls'''
trickle-1.07_2_amd64.pbi    trickle-1.07_2_amd64.pbi.sha256
+
trickle-1.07_2_amd64.pbi    trickle-1.07_2_amd64.pbi.sha256
'''pbi_add --no-checksig trickle-1.07_2_amd64.pbi'''
+
'''pbi_add --no-checksig trickle-1.07_2_amd64.pbi'''
Verifying Checksum...OK
+
Verifying Checksum...OK
Extracting to: /usr/pbi/trickle-amd64
+
Extracting to: /usr/pbi/trickle-amd64
Installed: trickle-1.07_2
+
Installed: trickle-1.07_2}}
  
 
If the module installs successfully, perform the following tests:
 
If the module installs successfully, perform the following tests:
  
* if you checked the box "Create Desktop/Menu Entries", verify that a desktop icon was created (from a desktop that supports icons), that an entry was added to that desktop's application menu, and that the application successfully launches from the application menu. If you used a custom icon, verify that the icon was used.
+
* if you checked the box ''Create Desktop/Menu Entries'', verify that a desktop icon was created (from a desktop that supports icons), that an entry was added to that desktop's application menu, and that the application successfully launches from the application menu. If you used a custom icon, verify that the icon was used.
  
 
* start the application from the command line to determine if there are any error messages at application launch. When starting the application, specify the full path to the application's binary to make sure that you are testing the PBI's binary.
 
* start the application from the command line to determine if there are any error messages at application launch. When starting the application, specify the full path to the application's binary to make sure that you are testing the PBI's binary.
Line 103: Line 91:
 
* if you encounter any error messages in either starting or using the application, record them. If the fix for resolving the error messages is not clear to you, send the error report the {{citelink|url=http://lists.pcbsd.org/mailman/listinfo/pbi-dev|txt=pbi-dev mailing list}}.
 
* if you encounter any error messages in either starting or using the application, record them. If the fix for resolving the error messages is not clear to you, send the error report the {{citelink|url=http://lists.pcbsd.org/mailman/listinfo/pbi-dev|txt=pbi-dev mailing list}}.
  
The "Module Editor" tab, seen in Figure 8.1e, can be used to modify the module's settings. Use the "Select Module" button to browse to the location of the module and to un-grey-out the settings in this screen.
+
The ''Module Editor'' tab, seen in Figure 8.1e, can be used to modify the module's settings. Use the ''Select Module'' button to browse to the location of the module and to un-grey-out the settings in this screen.
  
'''Figure 8.1e: EasyPBI Module Editor'''
+
Several tabs are provided, allowing you to customize the PBI module. It should be noted that most PBI modules do not require you to make any configuration changes in the ''Module Editor'' tab. This tab allows the creation of more complex PBI modules that require additional FreeBSD ports or scripts which are not provided by the default FreeBSD port.
 
+
[[File:easypbi4a.png]]
+
 
+
Several tabs are provided, allowing you to customize the PBI module. It should be noted that most PBI modules do not require you to make any configuration changes in the "Module Editor" tab. This tab allows the creation of more complex PBI modules that require additional FreeBSD ports or scripts which are not provided by the default FreeBSD port.
+
  
 
The rest of this section describes the actions available within each tab. If you modify any settings in the PBI module, rebuild it then test again to see if the changes fixed the PBI.
 
The rest of this section describes the actions available within each tab. If you modify any settings in the PBI module, rebuild it then test again to see if the changes fixed the PBI.
  
==== pbi.conf ====
+
==== pbi.conf ====  
  
Typically the "Program Name", "Program Website", and "Program Author" are left at their default values. If this information is incorrect, you should email the FreeBSD port maintainer shown in the "Program Author" field so that the information can be corrected in the FreeBSD port.  
+
Typically the ''Program Name'', ''Program Website'', and ''Program Author'' are left at their default values. If this information is incorrect, you should email the FreeBSD port maintainer shown in the ''Program Author'' field so that the information can be corrected in the FreeBSD port.  
  
If you choose to replace the "Program Icon", use a 64x64 ''.png'' file with a transparent background.  
+
If you choose to replace the ''Program Icon'', use a 64x64 ''.png'' file with a transparent background. [[File:Easypbi5a.png|thumb|393px|'''Figure 8.1f: PBI Module Resource Configuration''']]
  
If your PBI requires a dependency that is not provided by the FreeBSD port, use the + button next to "Make Port Before" to select the needed port.  
+
If your PBI requires a dependency that is not provided by the FreeBSD port, use the ''+'' button next to ''Make Port Before'' to select the needed port.  
  
If you wish an additional port to be included with your PBI, use the + button next to "Make Port After" to select the desired port.
+
If you wish an additional port to be included with your PBI, use the ''+'' button next to ''Make Port After'' to select the desired port.
  
The "Make Options" field lets you specify a space separated list of options. The available options and their default settings will be listed in the ''OPTIONS='' section of the port's ''Makefile''.
+
The ''Make Options'' field lets you specify a space separated list of options. The available options and their default settings will be listed in the ''OPTIONS='' section of the port's ''Makefile''.
  
If the resulting PBI needs to be run as the root user, check the "Require Root Permissions" box.
+
If the resulting PBI needs to be run as the root user, check the ''Require Root Permissions'' box.
  
==== Resources ====  
+
==== Resources ====
  
 
This tab, shown in Figure 8.1f, is used to add additional files to the PBI module.
 
This tab, shown in Figure 8.1f, is used to add additional files to the PBI module.
  
'''Figure 8.1f: PBI Module Resource Configuration'''
+
An example of an additional file would be an application that requires the user to accept a License. Use the ''+&nbsp;Add Resource'' button to browse to the location of the ''LICENSE'' file.  
 
+
[[Image:Easypbi5a.png]]
+
 
+
An example of an additional file would be an application that requires the user to accept a License. Use the "+Add Resource" button to browse to the location of the ''LICENSE'' file.  
+
  
 
Another example would be when you wish to use a custom script to start the application rather than starting the application binary directly. A custom script could also be used to verify that the service is enabled or to generate a custom configuration file.
 
Another example would be when you wish to use a custom script to start the application rather than starting the application binary directly. A custom script could also be used to verify that the service is enabled or to generate a custom configuration file.
Line 141: Line 121:
 
If the application uses custom installer graphics, add them using this screen.
 
If the application uses custom installer graphics, add them using this screen.
  
==== Desktop/Menu Entries ====  
+
==== Desktop/Menu Entries ====
  
 
This tab, shown in Figure 8.1g, is used to fine-tune the desktop icon and the application menu entry for the application.
 
This tab, shown in Figure 8.1g, is used to fine-tune the desktop icon and the application menu entry for the application.
  
'''Figure 8.1g: Customizing the PBIs Desktop and Menu Entries'''
+
[[File:Easypbi6a.png|thumb|393px|'''Figure 8.1g: Customizing the PBI's Desktop and Menu Entries''']]
  
[[Image:Easypbi6a.png]]
+
If the ''Create Desktop/Menu Entries'' box was checked when creating the module and EasyPBI detects that the application is graphical, the default entries for the application will be listed. In our PBI example, '''trickle''' is a command line application so no entries were created by default. If your application is graphical but EasyPBI did not detect it, you can manually add the desired entries using the ''Remove Desktop Entry'' and ''Remove Menu Entry'' buttons.
  
If the "Create Desktop/Menu Entries" box was checked when creating the module and EasyPBI detects that the application is graphical, the default entries for the application will be listed. In our PBI example, '''trickle''' is a command line application so no entries were created by default. If your application is graphical but EasyPBI did not detect it, you can manually add the desired entries using the "Remove Desktop Entry" and "Remove Menu Entry" buttons.
+
Under ''Executable'', the drop-down menu will display all of the binaries that came with the application. Select the binary that should launch when the user clicks the desktop icon or selects the application from the application menu. Alternately, you can select ''Custom Binary'' and input the path to the desired executable.
  
Under "Executable", the drop-down menu will display all of the binaries that came with the application. Select the binary that should launch when the user clicks the desktop icon or selects the application from the application menu. Alternately, you can select "Custom Binary" and input the path to the desired executable.
+
The ''Entry Label'' field allows you to customize the name that will appear with the icon and application menu entry.
  
The "Entry Label" field allows you to customize the name that will appear with the icon and application menu entry.
+
The ''Icon'' drop-down menu allows you to select the ''.png'' file to use for the icon. This file must exist in ''~/EasyPBI/Modules/PBI_name/resources'' in order to appear in the drop-down menu. Use the ''Select Module'' button to re-select the module if you add the icon after loading the module.
  
The "Icon" drop-down menu allows you to select the ''.png'' file to use for the icon. This file must exist in ''~/EasyPBI/Modules/PBI_name/resources'' in order to appear in the drop-down menu. Use the "Select Module" button to re-select the module if you add the icon after loading the module.
+
The ''Menu Category'' drop-down menu is used to select the category the application menu entry will be added to.
  
The "Menu Category" drop-down menu is used to select the category the application menu entry will be added to.
+
To add a desktop entry, select an ''Executable'', input an ''Entry Label'', and click the ''+&nbsp;Add Desktop Entry'' button. This will generate the ''.desktop'' file to be used by XDG-compliant desktops. The entry will appear under ''Current Desktop Entries''.
  
To add a desktop entry, select an "Executable", input an "Entry Label", and click the "+Add Desktop Entry" button. This will generate the ''.desktop'' file to be used by XDG-compliant desktops. The entry will appear under "Current Desktop Entries".
+
To add an application menu entry, select an ''Executable'', input an ''Entry Label'', and click the ''+&nbsp;Add Menu Entry'' button. The generated ''.desktop'' file will appear under ''Current Menu Entries''.
 
+
To add an application menu entry, select an "Executable", input an "Entry Label", and click the "+Add Menu Entry" button. The generated ''.desktop'' file will appear under "Current Menu Entries".
+
  
 
==== External-Links ====  
 
==== External-Links ====  
Line 167: Line 145:
 
This tab, shown in Figure 8.1h, is used to customize how the specified binary starts.
 
This tab, shown in Figure 8.1h, is used to customize how the specified binary starts.
  
'''Figure 8.1h: Configuring Custom Links for the PBI'''
+
[[File:Easypbi7a.png|thumb|393px|'''Figure 8.1h: Configuring Custom Links for the PBI''']]
 
+
[[Image:Easypbi7a.png]]
+
  
To customize how a binary starts, highlight it and click the "Action" drop-down menu. The possible actions are:
+
To customize how a binary starts, highlight it and click the ''Action'' drop-down menu. The possible actions are:
  
 
* '''binary:''' indicates that this is an executable. EasyPBI will automatically create the necessary wrapper and PATH links for you.
 
* '''binary:''' indicates that this is an executable. EasyPBI will automatically create the necessary wrapper and PATH links for you.
Line 183: Line 159:
 
* '''nocrash:''' disables the crashhandler GUI from running on this PBI. Note that the glue for the crash handler is not built into the base system yet.
 
* '''nocrash:''' disables the crashhandler GUI from running on this PBI. Note that the glue for the crash handler is not built into the base system yet.
  
If you select an "Action", use the up arrow to add it. If you change your mind, click the "Clear Changes" button.
+
If you select an ''Action'', use the up arrow to add it. If you change your mind, click the ''Clear Changes'' button.
  
=== Submit the Module ===
+
=== Submit the Module ===  
  
 
Once you are satisfied with the PBI, go to the "Module Editor" tab and use the "Select Module" button to select the PBI's module. Then click the "Package Module" button. A pop-up window will indicate that the module has been compressed and that a ''.tar.gz'' file has been added to the PBI module directory. The file name for our example PBI is ''~dru/EasyPBI/Modules/trickle.tar.gz''.
 
Once you are satisfied with the PBI, go to the "Module Editor" tab and use the "Select Module" button to select the PBI's module. Then click the "Package Module" button. A pop-up window will indicate that the module has been compressed and that a ''.tar.gz'' file has been added to the PBI module directory. The file name for our example PBI is ''~dru/EasyPBI/Modules/trickle.tar.gz''.
Line 191: Line 167:
 
If you send that file to the {{citelink|url=http://lists.pcbsd.org/mailman/listinfo/pbi-dev|txt=pbi-dev mailing list}}, it will be added to the PC-BSD® build servers so that the 32- and 64-bit versions of the PBI can be built. Once the built PBIs are tested, they will be added to AppCafe® so that other PC-BSD® users can benefit from the PBI.
 
If you send that file to the {{citelink|url=http://lists.pcbsd.org/mailman/listinfo/pbi-dev|txt=pbi-dev mailing list}}, it will be added to the PC-BSD® build servers so that the 32- and 64-bit versions of the PBI can be built. Once the built PBIs are tested, they will be added to AppCafe® so that other PC-BSD® users can benefit from the PBI.
  
<noinclude>{{refheading}}</noinclude>
 
 
<noinclude>
 
<noinclude>
 +
{{refheading}}
 
[[category:handbook]]
 
[[category:handbook]]
 
[[category:Control Panel]]
 
[[category:Control Panel]]
 
[[category:EasyPBI]]
 
[[category:EasyPBI]]
 +
[[category:webpage referred]]
 
</noinclude>
 
</noinclude>

Revision as of 08:54, 16 April 2013

(Sorry for the inconvenience)

Contents

NOTE: this page is deprecated. Refer to EasyPBI2 instead.

EasyPBI is a graphical application that makes it easy to build a PBI module from a FreeBSD port. Beginning with PC-BSD® 9.1, EasyPBI ships with PC-BSD® and can be found in the Control Panel.

This section demonstrates how to use this utility to convert an existing FreeBSD port into a PC-BSD® PBI.
Figure 8.1b: EasyPBI Graphical Interface
You may wish to skim the section on how to Create PBIs first, as well as refer to that Guide should you have trouble creating a PBI or wish to create a more complex PBI.

To start EasyPBI, double-click its icon in Control Panel or type EasyPBI from within an X terminal as your regular user account.

If the ports collection is not installed, you will receive the message shown in Figure 8.1a the first time you start EasyPBI.

Figure 8.1a: Ports Must be Installed to Use EasyPBI

If multiple users will be using the EasyPBI utility, go to Control Panel System ManagerTasks and click the Fetch Ports Tree button. Alternately, use the following command as the superuser portsnap fetch extract. Either of these methods will install the ports collection into /usr/ports.

If you are the only user who will be using the EasyPBI utility, click OK to launch the main EasyPBI screen, shown in Figure 8.1b. Click FileGet Ports which will download the ports collection to the EasyPBI subdirectory located in your home directory.

If the ports collection was already installed or was installed using System Manager or portsnap, the message in the bottom area of the screen will instead indicate To get started, please push the New Module button.

Creating a PBI Module

Before building a PBI, refer to the PBI Requests forum[1] to determine which PBIs have been requested by users. You should also check that a module does not already exist for the PBI in the PBI Modules[2] section of trac. Existing modules are listed alphabetically, according to their category in the ports collection.

To create a new module, click the New Module button and use the browser to select the desired port from the FreeBSD ports tree. Once a port is selected, EasyPBI will attempt to automatically supply the port information for the PBI and display the results in the GUI. In the example shown in Figure 8.1c, the net/trickle port has been selected and the fields have been auto-filled in.

You should review these fields for accuracy. If you click "Get Port Info" FreshPorts.org[3] will open in the default web browser so that you can view additional information about the port.

A generic icon will be supplied for the module; you can change the default icon by clicking the Choose Icon button. When using a custom icon, use a 64x64 .png file with a transparent background.

Check the Create Desktop/Menu Entries' if you wish the program's icon to be available on the desktop and in the desktop's application menu.

Once the port information is complete, click the Create Module button and EasyPBI will produce the PBI module. The module will be named after the port and will be stored in a subdirectory of the EasyPBI/Modules directory in your home directory. In this example, the module is located in EasyPBI/Modules/trickle.
Figure 8.1c: Review the New Module

Build the Module

Creating the module itself is very quick and takes less than a minute. However, you still need to build and test the module to make sure that the application works as expected. Depending upon the complexity of the application, you may have to edit the initial module then rebuild and retest it until you are satisfied with the PBI for the application.

Once the module is created, you are ready to build a PBI from the module. Click on the Build PBI tab and click the Select Module button to browse to the module you created. Figure 8.1d shows this tab with our example PBI selected.

The top half of this screen contains modifiable settings which are used when building PBIs:

Save Settings as Defaults: the settings in this section revert back to the default settings when you exit EasyPBI. This allows you to override the default settings for a particular build. If you wish your changes to be permanent, click this button.

Output Directory: specifies the directory to store the built module. By default, it is the EasyPBI/PBI subdirectory of the user's home directory. Click the Change Directory button to select another location.

Digital Signature File: the PBIs available from the PC-BSD® repositories are digitally signed by the PC-BSD® project's signature file. If you are creating your own repository, click the Change File button to select your own digital signature file.
Figure 8.1d: The Build PBI Tab
Create Your Own PBI Repository provides instructions for creating a signature file.

Use TMPFS: if your build system has a lot of RAM, selecting this option can speed up the build.

Use Package Caching: this setting is recommended as it reuses previously built packages to speed up subsequent builds.

The rest of this screen is used to build the specified module:

Select Module: select the previously created module to build.

Build PBI: starts the build of the PBI module. It will prompt you for the superuser password and requires a working Internet connection in order to build the PBI. This process may take quite a while, depending upon the port selected and the speed of your computer. The build messages will be displayed in the window at the bottom of the tab. EasyPBI will inform you when the PBI build is finished, and whether it was successful or not.

Stop Build: stops the build process. Click the Build PBI button to resume the build.

Save Build Log: useful if the build fails. Will prompt you to select the location to store build.log which can be read with any ASCII text editor.

You can produce additional modules from the Create Module tab while a PBI build is running.

If the PBI build fails for some reason, you may need to modify the module as described in the next section. Use the build log to determine the error and modify the module as needed. If you are unsure how to fix the module, send the build.log for the failure to the pbi-dev mailing list[4].

Test and Fine-Tune the Module

Once your build is finished, test the PBI to ensure that it installs and that the application works.

To install the PBI, become the superuser, cd to the "Output Directory", and use the pbi_add command. Unless you have specified your own digital signature, include the --no-checksig option.
Figure 8.1e: EasyPBI Module Editor
su

Password: cd ~dru/EasyPBI/PBI ls trickle-1.07_2_amd64.pbi trickle-1.07_2_amd64.pbi.sha256 pbi_add --no-checksig trickle-1.07_2_amd64.pbi Verifying Checksum...OK Extracting to: /usr/pbi/trickle-amd64

Installed: trickle-1.07_2

If the module installs successfully, perform the following tests:

  • if you checked the box Create Desktop/Menu Entries, verify that a desktop icon was created (from a desktop that supports icons), that an entry was added to that desktop's application menu, and that the application successfully launches from the application menu. If you used a custom icon, verify that the icon was used.
  • start the application from the command line to determine if there are any error messages at application launch. When starting the application, specify the full path to the application's binary to make sure that you are testing the PBI's binary.
  • for GUI applications, go through the various menus to see if they produce any errors.
  • if you encounter any error messages in either starting or using the application, record them. If the fix for resolving the error messages is not clear to you, send the error report the pbi-dev mailing list[4].

The Module Editor tab, seen in Figure 8.1e, can be used to modify the module's settings. Use the Select Module button to browse to the location of the module and to un-grey-out the settings in this screen.

Several tabs are provided, allowing you to customize the PBI module. It should be noted that most PBI modules do not require you to make any configuration changes in the Module Editor tab. This tab allows the creation of more complex PBI modules that require additional FreeBSD ports or scripts which are not provided by the default FreeBSD port.

The rest of this section describes the actions available within each tab. If you modify any settings in the PBI module, rebuild it then test again to see if the changes fixed the PBI.

pbi.conf

Typically the Program Name, Program Website, and Program Author are left at their default values. If this information is incorrect, you should email the FreeBSD port maintainer shown in the Program Author field so that the information can be corrected in the FreeBSD port.

If you choose to replace the Program Icon, use a 64x64 .png file with a transparent background.
Figure 8.1f: PBI Module Resource Configuration

If your PBI requires a dependency that is not provided by the FreeBSD port, use the + button next to Make Port Before to select the needed port.

If you wish an additional port to be included with your PBI, use the + button next to Make Port After to select the desired port.

The Make Options field lets you specify a space separated list of options. The available options and their default settings will be listed in the OPTIONS= section of the port's Makefile.

If the resulting PBI needs to be run as the root user, check the Require Root Permissions box.

Resources

This tab, shown in Figure 8.1f, is used to add additional files to the PBI module.

An example of an additional file would be an application that requires the user to accept a License. Use the + Add Resource button to browse to the location of the LICENSE file.

Another example would be when you wish to use a custom script to start the application rather than starting the application binary directly. A custom script could also be used to verify that the service is enabled or to generate a custom configuration file.

If the application uses custom installer graphics, add them using this screen.

Desktop/Menu Entries

This tab, shown in Figure 8.1g, is used to fine-tune the desktop icon and the application menu entry for the application.

Figure 8.1g: Customizing the PBI's Desktop and Menu Entries

If the Create Desktop/Menu Entries box was checked when creating the module and EasyPBI detects that the application is graphical, the default entries for the application will be listed. In our PBI example, trickle is a command line application so no entries were created by default. If your application is graphical but EasyPBI did not detect it, you can manually add the desired entries using the Remove Desktop Entry and Remove Menu Entry buttons.

Under Executable, the drop-down menu will display all of the binaries that came with the application. Select the binary that should launch when the user clicks the desktop icon or selects the application from the application menu. Alternately, you can select Custom Binary and input the path to the desired executable.

The Entry Label field allows you to customize the name that will appear with the icon and application menu entry.

The Icon drop-down menu allows you to select the .png file to use for the icon. This file must exist in ~/EasyPBI/Modules/PBI_name/resources in order to appear in the drop-down menu. Use the Select Module button to re-select the module if you add the icon after loading the module.

The Menu Category drop-down menu is used to select the category the application menu entry will be added to.

To add a desktop entry, select an Executable, input an Entry Label, and click the + Add Desktop Entry button. This will generate the .desktop file to be used by XDG-compliant desktops. The entry will appear under Current Desktop Entries.

To add an application menu entry, select an Executable, input an Entry Label, and click the + Add Menu Entry button. The generated .desktop file will appear under Current Menu Entries.

External-Links

This tab, shown in Figure 8.1h, is used to customize how the specified binary starts.

Figure 8.1h: Configuring Custom Links for the PBI

To customize how a binary starts, highlight it and click the Action drop-down menu. The possible actions are:

  • binary: indicates that this is an executable. EasyPBI will automatically create the necessary wrapper and PATH links for you.
  • linux: indicates that this is a Linux executable. EasyPBI will automatically create the necessary Linux wrapper and PATH links for you.
  • keep: instructs the PBI to not overwrite an existing binary when linking a file into the LOCALBASE. By default, LOCALBASE is set to /usr/local.
  • replace: instructs the PBI to overwrite an existing binary when linking a file into the LOCALBASE.
  • nocrash: disables the crashhandler GUI from running on this PBI. Note that the glue for the crash handler is not built into the base system yet.

If you select an Action, use the up arrow to add it. If you change your mind, click the Clear Changes button.

Submit the Module

Once you are satisfied with the PBI, go to the "Module Editor" tab and use the "Select Module" button to select the PBI's module. Then click the "Package Module" button. A pop-up window will indicate that the module has been compressed and that a .tar.gz file has been added to the PBI module directory. The file name for our example PBI is ~dru/EasyPBI/Modules/trickle.tar.gz.

If you send that file to the pbi-dev mailing list[4], it will be added to the PC-BSD® build servers so that the 32- and 64-bit versions of the PBI can be built. Once the built PBIs are tested, they will be added to AppCafe® so that other PC-BSD® users can benefit from the PBI.


References


  1. http://forums.pcbsd.org/forumdisplay.php?f=61
  2. http://trac.pcbsd.org/browser#pbi/modules
  3. http://freshports.org
  4. 4.0 4.1 4.2 http://lists.pcbsd.org/mailman/listinfo/pbi-dev
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox