Commits

stretchedthin committed 658ba28

Ted

  • Participants
  • Parent commits 36a06d9

Comments (0)

Files changed (1)

var/vabs/Ted/src/Ted.SlackBuild

 #
 # Please put your name below if you add some original scripting lines.
 # AUTHORS = 
+##Thanks to the people at http://slackbuilds.org for the references drawn from thier SlackBuild.
 
 NAME="Ted"            #Enter package Name!
 VERSION=${VERSION:-"2.22"}      #Enter package Version!
-VER=$(echo $VERSION|sed 's/-/_/') #this fixes - in version
+VER=$(echo ${VERSION}|sed 's/-/_/') #this fixes - in version
 VL_PACKAGER=${VL_PACKAGER:-"stretchedthin"}   #Enter your Name!
-LINK=${LINK:-"ftp://ftp.nluug.nl/pub/editors/ted/ted-$VERSION.src.tar.gz"}  #Enter URL for package here!
-SRCNAM="ted"
+LINK=${LINK:-"ftp://ftp.nluug.nl/pub/editors/ted/ted-${VERSION}.src.tar.gz"}  #Enter URL for package here!
+
+TOOLKIT=${TOOLKIT:-GTK}
+SRCNAM=$(echo $NAME | tr T t)
 
 #SYSTEM VARIABLES
 #----------------------------------------------------------------------------
 LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-""}
 ADDRB=${ADDRB:-""} #Add deps that need to be added to the slack-required file here
 EXRB=${EXRB:-""} #Add deps that need to be excluded from the slack-required file here
-MAKEDEPENDS=${MAKEDEPENDS:-""} #Add deps needed TO BUILD this package here.
+MAKEDEPENDS=${MAKEDEPENDS:-"pcre xz"} #Add deps needed TO BUILD this package here.
 #----------------------------------------------------------------------------
 
 # DO NOT EXECUTE if NORUN is set to 1
 cd $CWD
 mkdir -p $RELEASEDIR/tmp
 TMP=$RELEASEDIR/tmp
-PKG=$TMP/package-$NAME
+PKG=$TMP/package-${NAME}
 #--------------------------------------------
 
 
 
 rm -rf $PKG
 cd $TMP
-rm -rf $NAME-$VERSION
+rm -rf ${NAME}-${VERSION}
 
 
 #EXTRACT SOURCES
 #-----------------------------------------------------
 echo "Extracting source..."
-tar xvf $CWD/ted-$VERSION.src.tar.* || exit 1
+tar xvf $CWD/ted-${VERSION}.src.tar.gz
 #this moves whatever was extracted to the std dirname we are expecting
-mv * $NAME-$VERSION &> /dev/null 2>&1
+mv * ${NAME}-${VERSION} &> /dev/null 2>&1
 mkdir -p $PKG
 #-----------------------------------------------------
-cp $CWD/docSectProperties.c $NAME-$VERSION/docBase/docSectProperties.c
 
-cd $TMP/$NAME-$VERSION
+
+cd $TMP/${NAME}-${VERSION}
 
 
 #PATCHES
 #-----------------------------------------------------
 for i in $CWD/patches/*;do
   patch -p1 <$i
-  mkdir -p $PKG/usr/doc/$NAME-$VERSION/patches/
-  cp $i $PKG/usr/doc/$NAME-$VERSION/patches/
+  mkdir -p $PKG/usr/doc/${NAME}-${VERSION}/patches/
+  cp $i $PKG/usr/doc/${NAME}-${VERSION}/patches/
 done
 #-----------------------------------------------------
  
 # correct path and that it will work seamlessly within the KDE environment.
 #
 #-----------------------------------------------------------------------
+# Let's edit Ted's Makefile, so this allows us to package Ted quite properly without
+# actually having to need /usr/local/.
+sed -i 's#./configure#./configure --prefix=/usr/share#g' $TMP/$NAME-$VERSION/Makefile
 
-echo "Configuring source..."
 # Let's edit Ted's Makefile, so this allows us to package Ted quite properly without
 # actually having to need /usr/local/.
 sed -i 's#./configure#./configure --prefix=/usr/share#g' $TMP/$NAME-$VERSION/Makefile
 sed \
   -e "/^M_MACHINE/s|=.*|=$ARCH|" \
   -e "/^M_ARCH/s|=.*|=$ARCH|" \
-  -i tedPackage/configure
-
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
+  -i ./tedPackage/configure
+ 
 make
 make package.shared DESTDIR=$PKG CONFIGURE_OPTIONS="--with-$TOOLKIT \
   --prefix=/usr/share/$NAME  --bindir=/usr/bin \
-  --build=$ARCH-slackware-linux"
-
-mkdir -p $PKG/usr/
-tar -xvf $TMP/$NAME-$VERSION/${SRCNAM}Package/$SRCNAM-$VERSION-linux-*$LIBDIRSUFFIX.tar.gz -C $PKG/usr/
+  --build=$CONFIGURE_TRIPLET \
+  $CONFIG_OPTIONS || exit 1"
+  
+mkdir -p $PKG/usr/bin
+tar -xvf $TMP/$NAME-$VERSION/tedPackage/$SRCNAM-$VERSION-linux-*$LIBDIRSUFFIX.tar.gz -C $PKG/usr/
 mv $PKG/usr/Ted $PKG/usr/share
 mv $PKG/usr/share/$NAME/{rtf2pdf,rtf2ps}.sh $PKG/usr/bin/
 cat $CWD/$NAME.desktop > $PKG/usr/share/applications/$NAME.desktop
 mkdir -p $PKG/usr/man/man1
 mv $PKG/usr/share/$NAME/{rtf2pdf,rtf2ps,$NAME}.1 $PKG/usr/man/man1
 find $PKG/usr/man -type f -exec gzip -9 {} \;
+ 
+  
+
+make || exit 1
+
+make install DESTDIR=$PKG || exit 1
 
 
 #######################################################################
 
 
 
-mkdir -p $PKG/usr/doc/$NAME-$VERSION
+mkdir -p $PKG/usr/doc/${NAME}-${VERSION}
 cp -a AUTHORS COPYING ChangeLog Credits MANIFEST README TODO \
-$PKG/usr/doc/$NAME-$VERSION
-cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
+$PKG/usr/doc/${NAME}-${VERSION}
+cat $CWD/${NAME}.SlackBuild > $PKG/usr/doc/${NAME}-${VERSION}/${NAME}.SlackBuild
 
 #----------------------------------------------------------------------
 
 else
 # This creates the white space in front of "handy-ruler" in slack-desc below.
 
-LENGTH=$(expr length "$NAME")
+LENGTH=$(expr length "${NAME}")
 SPACES=0
 SHIM=""
 until [ "$SPACES" = "$LENGTH" ]; do
 
 # Fill in the package summary between the () below.
 # Then package the description, License, Author and Website.
-# There may be no more then 11 $NAME: lines in a valid slack-desc.
+# There may be no more then 11 ${NAME}: lines in a valid slack-desc.
 
 cat > $RELEASEDIR/slack-desc << EOF
 # HOW TO EDIT THIS FILE:
 # customary to leave one space after the ':'.
 
 $SHIM|-----handy-ruler------------------------------------------------------|
-$NAME: $NAME ()
-$NAME:
-$NAME: 
-$NAME: 
-$NAME: 
-$NAME: 
-$NAME:
-$NAME:
-$NAME: License: GPL
-$NAME: Authors: 
-$NAME: Website: 
+${NAME}: ${NAME} ()
+${NAME}:
+${NAME}: 
+${NAME}: 
+${NAME}: 
+${NAME}: 
+${NAME}:
+${NAME}:
+${NAME}: License: GPL
+${NAME}: Authors: 
+${NAME}: Website: 
 
 EOF
 fi
 #--------------------------------------------------------------
 echo "Finding dependencies..."
 ADD="$ADDRB" EXCLUDE="$EXRB" requiredbuilder -v -y -s $RELEASEDIR $PKG
-echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.txz"
-makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.txz
+echo "Creating package ${NAME}-${VERSION}-$ARCH-$BUILD.txz"
+makepkg -l y -c n $RELEASEDIR/${NAME}-${VERSION}-$ARCH-$BUILD.txz
 
 cd $CWD
 echo "Cleaning up temp files..." && rm -rf $TMP