#!/usr/bin/bash # # THIS SCRIPT ONLY: # 1. REPACKAGES THE SLACKWARE .TGZ PACKAGE; # 2. ADAPTS THE SLACK-DESC TO VL; # 3. USES REQUIREDBUILDER TO CREATE A SLACK-REQUIRED FILE. # # IT DOESN'T COMPILE THE SOURCES! (THESE ARE INCLUDED IN ./src/sources/) NAME="gcc-gfortran" #Enter package Name! VERSION=${VERSION:-"4.1.2"} #Enter package Version! VL_PACKAGER=${VL_PACKAGER:-"wcs"} #Enter your Name! #SYSTEM VARIABLES #---------------------------------------------------------------------------- BUILD=${BUILDNUM:-"1"} ARCH=i486 #---------------------------------------------------------------------------- #SETUP PACKAGING ENVIRONMENT #-------------------------------------------- CWD=$(pwd) cd ../ RELEASEDIR=$(pwd) cd $CWD mkdir -p $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME #-------------------------------------------- if [ $UID != 0 ]; then echo "You are not authorized to run this script. Please login as root" exit 1 fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit 1 fi rm -rf $PKG mkdir -p $PKG cd $PKG #EXPLODE PACKAGE #----------------------------------------------------- echo "Exploding package..." explodepkg $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz || exit 1 #----------------------------------------------------- #SET PERMISSIONS #----------------------------------------- echo "Setting permissions..." chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 2777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 2755 -exec chmod 755 {} \; find . -perm 774 -exec chmod 644 {} \; find . -perm 666 -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 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; #----------------------------------------- # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=$(expr length "$NAME") SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done cat > $RELEASEDIR/slack-desc << EOF # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: $NAME (Fortran support for GCC) $NAME: This package contains those parts of the compiler collection needed $NAME: to compile Fortran code. The base gcc package is also required. $NAME: Its primary base is the ANSI FORTRAN 95 standard, with some $NAME: extensions popularized by the 'f77' and 'f2c' compilers, other $NAME: compilers (such as Digital products), and the Fortran 90 standard. $NAME: (Repackaged from a Slackware package for VL 5.9) $NAME: $NAME: License: GNU GPL $NAME: Authors: GNU Project $NAME: Website: http://gcc.gnu.org/fortran/ #---------------------------------------- BUILDDATE: $(date) PACKAGER: $VL_PACKAGER HOST: $(uname -srm) DISTRO: $(cat /etc/vector-version) (Repackaged from Slackware .tgz package) ORIGINAL PACKAGE: http://packages.slackware.it/package.php?q=12.0/gcc-gfortran-4.1.2-i486-1 EOF rm $PKG/install/slack-desc cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc #FINISH PACKAGE #-------------------------------------------------------------- echo "Finding dependencies..." ADD="gcc = 4.1.2-i486-1" requiredbuilder -v -y -s $RELEASEDIR $PKG echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD echo "Cleaning up temp files..." && rm -rf $TMP echo "Package Complete" #--------------------------------------------------------------