youlle
08-16-2005, 07:03 PM
I have spent a while thinking about how ports actually works and how PBI works and came to the conclusion that integration is possible. You should note however I have not tested this method myself, but it should work without hitch excepyt maybe the actually PBI Library declaration in the PBI creator.
Glossary:
[app] == To be replaced with name of application you are creating PBI for.
[app]_p-pbi == [app] with the suffix "_p-pbi" _p-pbi stands for Ports-PBI. NOTE: Reason for doing this is to prevent contaminating the Ports tree, so this is vital
INTEGRATION HOW-TO BEGIN
[1] create the following files structure in an empty folder say "/home/andrew/pbi/[app]/"
./MyPrograms/[app]
./MyPrograms/[app]/lib
./lib
./man
./bin
./sbin
Now you may be wondering why do this? well its all part of the ports integration. now to setup the PBI.
[2] Download a pre-compiled binary from ftp://ftp.freebsd.org/pub/FreeBSD/ports ... 6-current/ (ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-current/) or ftp://ftp.freebsd.org/pub/FreeBSD/relea ... /packages/ (ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/5.4-RELEASE/packages/)
Now extract the contents of the archieve to /home/andrew/pbi/[app]/
This is the layout of the P-PBI (Ports-PBI)
[3] Now copy the contents of ./bin (and / or) ./sbin into ./MyPrograms/[app].
[4] Open Konsole and type the following:
cd /home/andrew/pbi/[app]/MyPrograms/[app]
ldd [binary name here]This should list all libraries required by the application and their locations, copy these libraries into ./MyPrograms/[app]/lib
[5] Now we have to create the Ports specific files pkg_descr and pkg_plist; first pkg_descr:
Open Kedit and type:
This is a port of [app]
:
(etc.)
WWW: [app website here]
- [your name]
[email address here]
Save that file as /home/andrew/pbi/[app]/pkg_descr now for pkg_plist:
Open Konsole and type:
cd /home/andrew/pbi/[app]/
ls >> pkg_1
cd MyPrograms/[app]
ls >> pkg_1
cd lib
ls >> pkg_1
cd ../../..
cd lib
The lists the files in each folder and places the filenames into a file called pkg_1, open each one of these and copy the contents into a new file in Kedit e.g.:
MyPrograms/[app]/dave.jpg
MyPrograms/[app]/bob
MyPrograms[app]/lib/taxx.so.4
lib/dave.lib
@drrm /MyPrograms/[app]
You do how ever have to manually enter the folder names before the file name, as shown above otherwise the P-PBI will not work.
The @drrm part of the pkg_plist file is to tell ports it can remove the directory if all files are un-installed.
Now save this file as /home/andrew/pbi/[app]/pkg_plist
[6] Create the Archieve "[app]_p-pbi.tbz" (tar bzip) and place the entire contents of /home/andrew/pbi/[app] into it except for pkg_descr and pkg_plist.
7 Make a Directory called pkg inside /home/andrew/pbi/[app]/MyPrograms/[app] and now Copy [app]_p-pbi.tbz into ./pkg
8 Copy both pkg_descr and pkg_plist into ./pkg aswell.
[9] Time to create the Script which will prepare Ports for the P-PBI; Open Kedit and type the following:
#Ports PBI Integration System, Preperation Script (C)2005 Andrew Youll
cd /usr/ports/[category name]/
mkdir [app]_p-pbi
cd /usr/local/MyPrograms/${1}
cp pkg_descr /usr/ports/[category name]/[app]_p-pbi
cp pkg_plist /usr/ports/[category name]/[app]_p-pbi
cp [app]_p-pbi.tbz /usr/ports/distfiles
Save this file as p-pbi.prepare.sh
Make this script file executable via the properties dialogue
10 Time to create the general installation script:
#Ports PBI Integration System, Installation Script (C)2005 Andrew Youll
./[app]_p-pbi.prepare.sh
pkg_add [app]_p-pbi
save this as PBI.SetupScript.sh and make this executable in the same way as we did with the previous script.
11 Now to create the removal script:
#Ports PBI Integration System, Un-installation Script (C)2005 Andrew Youll
pkg_delete [app]_p-pbi
save this as PBI.RemoveScript.sh and make executable as well.
12 Copy both PBI.SetupScript.sh and PBI.RemoveScript.sh into the folder ./pkg in /home/andrew/pbi/[app]/MyPrograms/[app] folder.
13 Now Create the PBI using the PBI Creator, entering all relivant information about version etc, and setting "package directory" as: /home/andrew/pbi/[app]/MyPrograms/[app]/pkg.
select "specific lib directory" and enter /usr/local/MyPrograms/${1}/lib.
add any executables to the executables list in the next screen, and then any mime-types, then click create, you should now have a PBI ready to test.
[/code]
Glossary:
[app] == To be replaced with name of application you are creating PBI for.
[app]_p-pbi == [app] with the suffix "_p-pbi" _p-pbi stands for Ports-PBI. NOTE: Reason for doing this is to prevent contaminating the Ports tree, so this is vital
INTEGRATION HOW-TO BEGIN
[1] create the following files structure in an empty folder say "/home/andrew/pbi/[app]/"
./MyPrograms/[app]
./MyPrograms/[app]/lib
./lib
./man
./bin
./sbin
Now you may be wondering why do this? well its all part of the ports integration. now to setup the PBI.
[2] Download a pre-compiled binary from ftp://ftp.freebsd.org/pub/FreeBSD/ports ... 6-current/ (ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-current/) or ftp://ftp.freebsd.org/pub/FreeBSD/relea ... /packages/ (ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/5.4-RELEASE/packages/)
Now extract the contents of the archieve to /home/andrew/pbi/[app]/
This is the layout of the P-PBI (Ports-PBI)
[3] Now copy the contents of ./bin (and / or) ./sbin into ./MyPrograms/[app].
[4] Open Konsole and type the following:
cd /home/andrew/pbi/[app]/MyPrograms/[app]
ldd [binary name here]This should list all libraries required by the application and their locations, copy these libraries into ./MyPrograms/[app]/lib
[5] Now we have to create the Ports specific files pkg_descr and pkg_plist; first pkg_descr:
Open Kedit and type:
This is a port of [app]
:
(etc.)
WWW: [app website here]
- [your name]
[email address here]
Save that file as /home/andrew/pbi/[app]/pkg_descr now for pkg_plist:
Open Konsole and type:
cd /home/andrew/pbi/[app]/
ls >> pkg_1
cd MyPrograms/[app]
ls >> pkg_1
cd lib
ls >> pkg_1
cd ../../..
cd lib
The lists the files in each folder and places the filenames into a file called pkg_1, open each one of these and copy the contents into a new file in Kedit e.g.:
MyPrograms/[app]/dave.jpg
MyPrograms/[app]/bob
MyPrograms[app]/lib/taxx.so.4
lib/dave.lib
@drrm /MyPrograms/[app]
You do how ever have to manually enter the folder names before the file name, as shown above otherwise the P-PBI will not work.
The @drrm part of the pkg_plist file is to tell ports it can remove the directory if all files are un-installed.
Now save this file as /home/andrew/pbi/[app]/pkg_plist
[6] Create the Archieve "[app]_p-pbi.tbz" (tar bzip) and place the entire contents of /home/andrew/pbi/[app] into it except for pkg_descr and pkg_plist.
7 Make a Directory called pkg inside /home/andrew/pbi/[app]/MyPrograms/[app] and now Copy [app]_p-pbi.tbz into ./pkg
8 Copy both pkg_descr and pkg_plist into ./pkg aswell.
[9] Time to create the Script which will prepare Ports for the P-PBI; Open Kedit and type the following:
#Ports PBI Integration System, Preperation Script (C)2005 Andrew Youll
cd /usr/ports/[category name]/
mkdir [app]_p-pbi
cd /usr/local/MyPrograms/${1}
cp pkg_descr /usr/ports/[category name]/[app]_p-pbi
cp pkg_plist /usr/ports/[category name]/[app]_p-pbi
cp [app]_p-pbi.tbz /usr/ports/distfiles
Save this file as p-pbi.prepare.sh
Make this script file executable via the properties dialogue
10 Time to create the general installation script:
#Ports PBI Integration System, Installation Script (C)2005 Andrew Youll
./[app]_p-pbi.prepare.sh
pkg_add [app]_p-pbi
save this as PBI.SetupScript.sh and make this executable in the same way as we did with the previous script.
11 Now to create the removal script:
#Ports PBI Integration System, Un-installation Script (C)2005 Andrew Youll
pkg_delete [app]_p-pbi
save this as PBI.RemoveScript.sh and make executable as well.
12 Copy both PBI.SetupScript.sh and PBI.RemoveScript.sh into the folder ./pkg in /home/andrew/pbi/[app]/MyPrograms/[app] folder.
13 Now Create the PBI using the PBI Creator, entering all relivant information about version etc, and setting "package directory" as: /home/andrew/pbi/[app]/MyPrograms/[app]/pkg.
select "specific lib directory" and enter /usr/local/MyPrograms/${1}/lib.
add any executables to the executables list in the next screen, and then any mime-types, then click create, you should now have a PBI ready to test.
[/code]