#!/bin/sh


#-- bump version
VERSION=$(version  read stub.php  bump show  write::2 stub.php)

#-- create plain phar
xpm -s src -t phar --phar-format zip-gz --phar-stub stub.php --phar-x -f stub.php

# test update classmap
ln -f shared.phar single/
php single/shared.phar

#-- deb + rpm
xpm -s dir -u man -t deb,rpm -f -v $VERSION -n php-shared-autoloader -a all \
--description "Canonic Autoloader / shared.phar
Provides a unified autoloader for /usr/share/php. It scans identifiers
in php scripts, but also makes phar collections first class citizens.
It's easily used from PHP:

   include_once('shared.phar');

It comes with a custom trigger for autoupdating the classmap on dpkg
installation, and falls back on 'phpab' generation if available. Class
identifiers are matched case-insensitively (as PHP expects it).
Also it's preparing for https://wiki.php.net/rfc/function_autoloading
in any future PHP version.

The shared autoloader is self-contained in a phar file, which eases
copying it onto and used in local project directories as well. Can be
split up into its individual scripts (autoloader, updater, classmap)
though." \
--url 'http://fossil.include-once.org/canonic' --category 'php' --vendor 'io' --maintainer 'mario#include-once:org' \
--depends php5-common --deb-suggests phpab \
--deb-interest /usr/share/php/ --after-install=deb_rpm_trigger \
--rpm-trigger-after-install '[-f ^./usr/share/php/]: deb_rpm_trigger' \
shared.phar=/usr/share/php/shared.phar \
manpage.1=/usr/share/man/man1/shared.phar.1 \


