Createing a PUPPYPKG File - noryb009/ppkg GitHub Wiki

This page is for users who have a program that you want to package with ppkg, but don't know how.

Before creating a pBuild, look in the ppkg script repository, and try to search online for an existing pBuild. If you find one, you can use that.

In this tutorial, I will be using "advancecomp" as an example program.

To begin, make a new folder anywhere (it is recommended that there is no spaces in the file name), and open a terminal in the folder.

To start, copy the PUPPYPKG template by running:

cp /usr/share/ppkg/PUPPYPKG.template

Open the newly created PUPPYPKG.template in your favorite text editor. Put "1" into the pkgrev field.

Next, find the program's home page. advancecomp's home page is [here](http:/here. Put the URL into the "url" field in the PUPPYPKG. While you are at the home page, you can get the name (put it into the pkgname field), version (pkgver), and a short description (pkgdesc). At this point, you can also fill "pkgcat" with the package's category. It can be one of the following: "BuildingBlock", "Help", "Develop", "Graphic", "Fun", "Multimedia", "Internet", "Network", "Personal", "Calculate", "Document", "Filesystem", "Desktop", "Utility", or "System".

Next, locate the latest source file download of your package. Try to find an "achievable" link - a link with the package version, not "latest". If the source is available in multiple compression formats (xz, bz2, and/or gz), then use the smallest. Copy this link into the "sources" array. It should look something like:

sources=(
	http://downloads.sourceforge.net/project/advancemame/advancecomp/1.15/advancecomp-1.15.tar.gz
)

Now, replace the package name with "${pkgname}" and the package version with "${pkgver}". This allows packages to be updated easier, as changing the "pkgver" field would update the source field also. It should now look something like this: (note: if possible, don't include the {} brackets)

sources=(
	http://downloads.sourceforge.net/project/advancemame/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz
)

Next, save and close the PUPPYPKG. Run the following two commands to generate the source's md5 sum and extract the source:

ppkg -g
ppkg -e

Open the PUPPYPKG file again. Browse to the newly created "src" folder, and any other folders needed to get to the top level of the program (this would usually be src/<package name>-<package version>. If it is not, you must edit the first "cd" command in the build() and package() functions to point to the source folder).

Look for a COPYING or LICENCE file. Put the licence type into the license array. Some examples are: 'GPL', 'LGPL', 'AGPL', 'BSD', 'public domain', and 'custom'. If you cannot find the license, use 'unknown'.

advancecomp's COPYING file is the GPL2 licence, so the license array would be licence=('GPL')

Read the package's INSTALL or README files. If dependencies are listed, put them into the deps array. If not, you might have to run ldd on the binaries after, look at the project website, or search for it. advancecomp needs zlib and glibc. Because zlib needs glibc, we do not need to include glibc. If you are unsure, keep both. advancecomp's deps array should look like:

deps=(
	'glibc'
	'zlib'
)

(Note: if there are only a few dependencies, you can use deps=('glibc' 'zlib'))

Because advancecomp is a binary program, we will use the noarch array, not the arch array (you can delete that line), and we don't know any platforms that it doesn't run, so we leave it blank, so it would look like: noarch=()

If the package was an architecture independent program (like a script), the you would use arch=('any')

If the package could only be built on a few architectures, you could use arch=('i386' 'i486' 'i686')