# $Id: /trunk/debian/packages 297 2005-08-22T15:16:52.506880Z dexter  $

# debian/packages for yada
# Copyright 1999 Charles Briscoe-Smith.  Licenced according to the GNU GPL.
# Copyright 1999-2005 Piotr Roszatycki.

# If the debian/rules or debian/control file is missing, rebuild the file:
#
#   $ yada rebuild control
#   $ yada rebuild rules

# Environment variables:

# compiles documentation from XML DocBook format
#   with_docbook=%{with_docbook}

# installs documentation in XML DocBook format
#   with_doc_xml=%{with_doc_xml}

# installs debconf templates
#   with_templates=%{with_templates}


# Other macros:

%define yada_doc_version_with_packages_7_manpage_moved_to_yada 0.26.0.1
%define yada_version_splitted_to_yada_doc 0.16

%define PATCHES patches/*.diff
%define PERL perl
%define TEST_MORE_LINES \
 echo line 1 \
 echo line 2
%define TEST_NESTED_SHELL_MACRO %`echo "{%{PERL}}"`

Source: yada
Section: devel
Priority: optional
Maintainer: Piotr Roszatycki <dexter@debian.org>
Upstream-Authors: Piotr Roszatycki <dexter@debian.org>
Standards-Version: 3.6.2
Home-Page: <URI:http://yada.alioth.debian.org/>
Description: Yet Another Debianisation Aid
 YADA is a Debian packaging helper.  It parses a special file,
 debian/packages, in a source package, and generates an appropriate
 debian/rules to control building of the package.
Patches: %{PATCHES}
Copyright: GPL
 Copyright 1999 Charles Briscoe-Smith
 Copyright 1999-2005 Piotr Roszatycki
 .
%`sed -e 's/^$/./' -e 's/^/ /' debian/license.GPL`
%if %{with_docbook}
Build-Depends: docbook-utils, links, tidy
%endif
Build: bash
 echo test build
%include packages.after
%include packages.before
 for pod in man/*.pod; do
     eval pod2man $(head -n1 $pod | sed 's/^# pod2man //') $pod \
         > ${pod%.pod}.$(head -n1 $pod | sed -e 's/.*--section=//' -e 's/ .*//')
 done
%if %{with_docbook}
 pushd doc
     make
 popd
%endif
Clean: bash
 rm -f man/*.[1-9]* || true
 # This shouldn't find its way into the source package...
 pushd doc
     make clean || true
%if %{with_docbook}
     make distclean || true
%endif
 popd
%if 1
 echo test 1
%if 2
 echo test 2
%if 0
 echo test 0
%else
 echo test -0
%endif
 echo test 2
%else
 echo test -2
%endif
 echo test 1
%else
 echo test -1
%endif
 echo test "%{TEST_NESTED_SHELL_MACRO}"

# Packages files can contain comments, like this one.

Package: yada
Architecture: all
Depends: dpkg-dev, file, patch
%include packages.yada.depends
Recommends: yada-doc
Suggests: bzip2
Conflicts: yada-doc (<< %{yada_doc_version_with_packages_7_manpage_moved_to_yada})
Replaces: yada-doc (<< %{yada_doc_version_with_packages_7_manpage_moved_to_yada})
Description: Yet Another Debianisation Aid
 This package provides YADA tool.
Install: sh
 yada install -script debian/yada
 yada install -man man/yada.1
 yada install -man man/packages.7

Package: yada-doc
Architecture: all
Suggests: yada
Conflicts: yada (<< %{yada_version_splitted_to_yada_doc})
Description: Yet Another Debianisation Aid - documentation and examples
 This package provides documentation for YADA and some examples of
 debian/packages files.
Install: sh
 yada install -doc doc/yada.txt doc/yada.pdf debian/*.syntax
%if %{with_doc_xml}
 yada install -doc doc/yada.xml
%endif
 yada install -doc -subdir examples examples/*
 yada install -doc -subdir examples/yada debian/packages debian/packages.* debian/%{PATCHES}
 echo test "?" %{?PERL:ok} %{?ERR:err}
 echo test "!?" %{!?ERR:ok} %{!?PERL:err}
 echo %{TEST_MORE_LINES}
%include packages.yada.templates
