#!/bin/sh

name="irda-utils"
title="irda-utils"
package="irda-utils"
version="0.9.15"
build="1"
noarch="n"
build_info="Standard build."

info="GPL implamentation of IrDA(TM) (Infrared Data Association) protocols."
info_pl="Implamentacja protokolow IrDA(TM) (Infrared Data Association)
na licencji GPL"
desc="Utilities for infrared communication between devices."
desc_pl="Narzedzia do komunikacji przez port podczerwieni"
category="System/Utils"
environment="console"
contact="packages@packware.org"
vendor="Packware Project"
vendor_id="pw"

# 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="README"
# 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://irda.sourceforge.net/pub/irda/irda-utils/$name-$version.tar.bz2
add_source irda-utils-0.9.15.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


# 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).
make_option all
# Constant options for make install (install_option).
#install_option DESTDIR=$pkg_main ROOT=$pkg_main
install_option ROOT=$pkg_main 
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 make with options as given by function make_option.
do_make
mkdir -p $pkg_main/usr/{bin,sbin}

# 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

for dir in irattach irdadump irdaping tekram; do
    cp $dir/README $docdir/README.$dir
done

# Define subpackages here (subpackage).

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

# Remove temporary directory.
clean_up
