PHP APT parser

PHP APT parser is a script for parsing the Packages[.gz] and Sources[.gz] files that APT uses to access Debian package repositories.

Unofficial Debian package repository maintainers use it to let the users view the package listing through a web browser.
Here's how:

  1. Make some Debian packages and copy the files that (e.g.) debuild produces, to a web directory of your choice. Then cd to that same directory and run the following commands:

        apt-ftparchive sources ./ > Sources
        apt-ftparchive packages ./ > Packages
        gzip < Sources > Sources.gz
        gzip < Packages > Packages.gz

    Or use special tools like reprepro, dak etc. to .

  2. Download from PHP-APT-Parser's project page at Alioth. (Here's also a direct link to Subversion repository.) Copy it to the same directory as Sources and Packages.

  3. Open index.php in your favourite text editor and type something like:

        <h1>My own Debian repository!</h1>
          parse_and_list( "Packages.gz", "Sources.gz" );

That's it! In this simple example the script takes care of the HTML layout for you, but you can also do it yourself you don't like the default view.

Visit the Project page at Alioth.