#!/bin/sh

name="unrar"
title="unRAR"
package="unrar"
version="3.0"
build="1"
noarch="n"
build_info="Standard build."

info="Extracts, tests and viewes RAR archives."
desc="The unRAR utility is a freeware program, distributed with source
code and developed for extracting, testing and viewing the
contents of archives created with the RAR archiver version 1.50
and above."
category="tools/archivizing"
environment="console/text"
contact="$name@packages.packware.gnu.pl"
vendor="The Packware Project"
vendor_id="pw"

requires=""
obsoletes=""
conflicts=""

docs_source="license.txt,readme.txt"
docs_cwd=""

strip_bin="y"
reset_own="y"
reset_dir="y"
reset_fil="y"
delete_cat="y"

. /usr/src/tgz/lib/builder.defs

add_source http://www.rarlab.com/rar/${name}src.tar.gz .

apply_patch unrar-am_cppflags.pw.patch

parent_package="$package"
write_info main

cd $src1

mv makefile.gcc Makefile

do_make

copy unrar $pkg_main/usr/bin
copy $src_pkg/unrar.1 $pkg_main/usr/man/man1
copy $src_pkg/unrar.1.pl $pkg_main/usr/man/pl/man1 unrar.1

make_docs

make_package main

clean_up
