# -*-shell-script-*-

# Author:  Francesco Montorsi <frm@users.sourceforge.net>
# Purpose: A minimal Autopackage SPEC file which can be used as template
#          for creating autopackages of wxWidgets-based applications.
#          See http://www.autopackage.org for more information about Autopackage.
#
#          IMPORTANT: this spec file requires Autopackage 1.2 or later.


# Notes about [Meta] section:
# - if your project uses configure, you can use the @PACKAGE_VERSION@ string instead
#   of a fixed value for the "SoftwareVersion:" key:

[Meta]
RootName: @site.org/appname:$SOFTWAREVERSION
DisplayName: wxWidgets-based minimal program
ShortName: wxminimal
Maintainer: The wxWidgets Developers <devel@nowhere.com>
Packager: Anonymous <anonymous@nowhere.com>
Summary: wxMinimal is an example minimal program based on wxGTK.
URL: http://www.site.org/
Licence: wxWindows licence
SoftwareVersion: 1.0
AutopackageTarget: 1.2
Revision: 1
PackageVersion: 1
PackageFileName: $SHORTNAME-$SOFTWAREVERSION-$PACKAGEVERSION.x86.package


[BuildPrepare]
# if you need to link your executable with some static libraries, whose
# order to the linker is important, then you should add a regexp matching
# the name of that libraries using this env var:
export APBUILD_RESOLVE_LIBPATH=".*mywxbasedlib.*"

# libraries used by wxWidgets like tiff and expat should always be linked
# statically (as they broke ABI recently - 9/2006)...
export APBUILD_STATIC="tiff expat"

# build in release mode against a stable release of wxGTK.
# The wxGTK builds present in linux distributions are always compiled in
# multilib, shared, unicode, release mode.
# Thus your project needs to be compiled in release, unicode mode, too.
#

# run the commands to build your package using apbuild's tool instead of
# the standard GCC compiler:
make CXX="apg++" CPP="apgcc"
make install prefix=$build_root

# NB: if your project uses a configure script then you probably want to use
#     the prepareBuild autopackage API instead:
#
#         prepareBuild --disable-debug --enable-unicode --with-wxdir=/some/path/to/wxGTK/2.6.x
#


[BuildUnprepare]
make clean

# NB: if your project uses a configure script then you probably want to use
#     the unprepareBuild autopackage API instead


[Imports]
echo '*' | import


[Prepare]
# Check for dependencies which are dynamically linked to your projects; you don't
# need to check for statically linked projects.

# Now you need to check for presence of wxGTK libraries; that's done using:
#    require @wxwidgets.org/wxgtk 26.0
#
# NOTE: the interface version that you specify must be in form A.B where A is
#       the major##minor version of wxGTK. This is because binary compatibility
#       of wxGTK libraries are reserved only among different releases of the
#       same major and minor versions.
#       So that if you need at least wxGTK 2.6.3, you should e.g. use the
#       "require @wxwidgets.org/wxgtk 26.3" command
#
require @wxwidgets.org/wxgtk 26.0

# wxGTK requires GTK+ 2.0 but you don't need to add the:
#     require @gtk.org/gtk 2.0
# check to your apspec - if wxGTK is installed, also GTK is.



[Install]
# Put your installation script here
installExe bin/minimal

[Uninstall]
# Usually just the following line is enough to uninstall everything
uninstallFromLog
