rendered paste body#!/bin/bash#Automatically Created by buildpkg 0.0.1#url: http://libdv.sourceforge.net/######Begin Redundant Code#######################################This is the reason a universal wrapper script is neededcheck_for_root() { [ ! "$UID" = "0" ] && echo "You need to be root" && exit 1}set_pre_permissions() { cd $startdir/src find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \;}strip_binaries() { cd $startdir/pkg find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ xargs strip --strip-unneeded 2> /dev/null}gzip_man_and_info_pages() { for DOCS in man info; do if [ -d "$startdir/pkg/usr/$DOCS" ]; then for DIRECTORY in $(ls $startdir/usr/$DOCS); do cd $startdir/usr/$DOCS/$DIRECTORY gzip -9 * done fi done}set_post_permissions() { if [ -d "$startdir/pkg/usr/bin" ]; then chown -R root:root $startdir/pkg/usr/bin fi}copy_build_script() { mkdir -p $startdir/pkg/usr/src/$pkgname-$pkgver cp $startdir/build-$pkgname.sh $startdir/pkg/usr/src/$pkgname-$pkgver/build-$name.sh}create_package() { cd $startdir/pkg makepkg -l y -c n $startdir/$package.tgz cd $startdir md5sum $startdir/$package.tgz > $startdir/$package.md5 requiredbuilder -z $startdir/$package.tgz > $startdir/$package.dep}clean() { rm -rf $startdir/pkg $startdir/src}#########End Redundant Code######################################See what I mean#########Begin Non Redundant Code##############################prepare_directory() { mkdir $startdir/src cp -R libdv-1.0.0.tar.gz $startdir/src cd $startdir/src for FILES in *; do if [[ "$(echo $FILES | grep tar)" ]]; then tar xf $FILES fi done mkdir $startdir/pkg}build() { cd $startdir/src/$pkgname-$pkgver ./configure --prefix=/usr --mandir=/usr/man make || return 1 make DESTDIR=$startdir/pkg install}create_slackdesc() {mkdir $startdir/pkg/installcat <<"EOF" >$startdir/pkg/install/slack-desclibdv: libdv - software codec for DV videolibdv: libdv: The Quasar DV codec (libdv) is a software codec for DV video, thelibdv: encoding format used by most digital camcorders, typically those thatlibdv: support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv waslibdv: developed according to the official standards for DV video: IEC 61834libdv: and SMPTE 314Mlibdv: libdv: libdv: libdv: EOF}####End Non Redundant Code##################startdir=$(pwd)pkgname=libdvpkgver=1.0.0pkgrel=1arch=i486package=$pkgname-$pkgver-$arch-$pkgrelexport CFLAGS="-O2 -march=$arch -mtune=i686"export CXFLAGS="-O2 -march=$arch -mtune=i686"#Executioncheck_for_rootprepare_directoryset_pre_permissionsbuildif [ ! "$?" = "0" ]; then echo "The compilation failed"ficreate_slackdescstrip_binariesgzip_man_and_info_pagesset_post_permissionscopy_build_scriptcreate_package#clean