SUMMARY="Uncompress rar files" DESCRIPTION="UnRAR decompresses rar files. It is a powerful archive manager \ that can backup your data and reduce the size of email attachments. UnRAR can \ decompress the following file formats: - RAR - ZIP - CAB - ARJ - JZH - TAR - GZ and TAR.GZ - BZ2 and TAR.BZ2 - ACE - UUE - JAR (Java Archive) - ISO - 7Z - XZ - Z (Unix Compress)" HOMEPAGE="https://www.rarlab.com/rar_add.htm" COPYRIGHT="1993-2018 Alexander Roshal" LICENSE="UnRAR" REVISION="1" SOURCE_URI="https://www.rarlab.com/rar/unrarsrc-$portVersion.tar.gz" CHECKSUM_SHA256="a4cc0ac14a354827751912d2af4a0a09e2c2129df5766576fa7e151791dd3dff" SOURCE_DIR="unrar" PATCHES="unrar-$portVersion.patchset" ADDITIONAL_FILES=" test.rar unrar.rdef " ARCHITECTURES="x86_gcc2 x86 x86_64" PROVIDES=" unrar = $portVersion cmd:unrar = $portVersion devel:libunrar = $portVersion lib:libunrar = $portVersion " REQUIRES=" haiku " BUILD_REQUIRES=" haiku_devel " BUILD_PREREQUIRES=" cmd:cut cmd:g++ cmd:make cmd:sed " PATCH() { if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then sed -i \ -e "/^CXXFLAGS=/ s/ -Wno-logical-op-parentheses//;" \ -e "/^CXXFLAGS=/ s/ -Wno-dangling-else//;" \ makefile fi sed -i -e "/^LDFLAGS=/ d;" makefile } BUILD() { local MAJOR="`echo "$portVersion" | cut -d. -f1`" local MIDDLE="`echo "$portVersion" | cut -d. -f2`" local MINOR="`echo "$portVersion" | cut -d. -f3`" sed \ -e "s|@MAJOR@|$MAJOR|" \ -e "s|@MIDDLE@|$MIDDLE|" \ -e "s|@MINOR@|$MINOR|" \ "$portDir"/additional-files/unrar.rdef > unrar.rdef for i in unrar lib sfx; do mkdir -p $i cd $i ln -f -s ../*.cpp ../*.hpp ../makefile . CPPFLAGS="-D_BSD_SOURCE" LDFLAGS="-lbsd" make $i cd .. done } INSTALL() { install -d "$libDir"/unrar install -t "$libDir"/unrar sfx/default.sfx for i in unrar lib; do make -C $i DESTDIR="$prefix" install-$i done rm "$libDir"/libunrar.a prepareInstalledDevelLib libunrar addResourcesToBinaries unrar.rdef "$binDir"/unrar mimeset -f "$binDir"/unrar } TEST() { rm -rf dir "$sourceDir"/unrar/unrar x "$portDir"/additional-files/test.rar test "`cat dir/haiku.txt`" = Haiku cat sfx/default.sfx "$portDir"/additional-files/test.rar >dir/sfxtest cd dir chmod +x sfxtest ./sfxtest test "`cat dir/haiku.txt`" = Haiku }