#!/bin/sh

name="program"
title="The Program"
package="program"
version="1.2.3"
build="1"
noarch="n"
build_info="Standard build."

info="A program that does something."
info_pl="Program, który coś robi."
desc="The Program is a program to do something."
desc_pl="Program jest programem do robienia czegoś."
category="category/category"
environment="environment/environment"
contact="$name@packages.packware.gnu.pl"
vendor="The Packager"
vendor_id="tp"

# Other packages required by the package (not because of needed libraries).
requires=""
# Other packages that the package can replace.
obsoletes=""
# Other packages that conflicts with the package.
conflicts=""

# Files to copy from sources directory.
docs_source="INSTALL,README,TODO,VERSION"
# Files to copy from directory with .builder.
docs_cwd=""

# Strip all binaries.
strip_bin="y"
# Set files ownings to root.root.
reset_own="y"
# Set directories modes to 755.
reset_dir="y"
# Set files modes to 755 and 644
reset_fil="y"
# Delete formatted man pages.
delete_cat="y"

# Don't remove the line below.
. /usr/src/tgz/lib/builder.defs

# Unpack sources here (add_source).
add_source ftp://host.domain/path/to/source/$name-$version.tar.gz

# Ask user for compile-time options here.

# Change file mode with function change_mod (format of mode is the same as in
# chmod command):
# change_mod package file mode

# Change file owner with function change_own (format of mode is the same as in
# chown command):
# change_own package file user.group

# Constant options for ./configure script (configure_option).
configure_option --prefix=/usr

# Warning! --host=$architecture-pc-linux-gnu is passed to ./configure by
# default. Use build_host_off to turn it off.
# build_host_off

# Constant options for make (make_option).

# Constant options for make install (install_option).
install_option DESTDIR=$pkg_main

# Don't remove the two lines below.
parent_package="$package"
write_info main

# Change to sources directory that we will be operating on.
cd $src1

# Run configure script with options as given by function configure_option.
do_configure
# Run make with options as given by function make_option.
do_make
# Run make install with options as given by function install_option.
do_install

# Copy files passed by src_docs and cwd_docs variables to usr/doc/name-version.
make_docs

# Define subpackages here (subpackage).

# Create packages (main and subpackages defined earlier).
make_package main

# Remove temporary directory.
clean_up
