projects / fglrx-packaging.git / commitdiff
Build Results
 
Summary

Description: The git repository for the ATI/AMD fglrx packaging scripts.
Last Change: Thu 2/4/10 2:40

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Thu 2/4/10 2:39
Mario Limonciello  
Convert to alternatives... 
Thu 2/4/10 1:55
Mario Limonciello  
Drop old kdelnk file... 
Thu 2/4/10 0:49
Mario Limonciello  
Drop arch stuff for fglrx... 
Wed 2/3/10 1:56
Mario Limonciello  
Migrate over to dh7. No... 
Wed 2/3/10 1:22
Mario Limonciello  
Bump standard version for... 
Sat 1/30/10 16:05
Anssi Hannula  
Mandriva: adapt for... 
 
> --git a/Mandriva/ati-packager.sh b/Mandriva/ati-packager.sh
index 1653944..26758d1 100755
--- a/Mandriva/ati-packager.sh
+++ b/Mandriva/ati-packager.sh
@@ -6,+6,@@
 
# Usage
 #   See README.distro document

-# prevent problems due to locales when grepping for 'wrote:'
-export LC_ALL=C
-
 
# List of supported distributions.
 
SuppDistro="2006 2007 2008 2009"

@@ -26,+23,33 @@ getSupportedPackages()
     
done
 
}

+
buildPrep()
+{
+    
distro=$2
+    dryrun=$3
+    if [ ! -/etc/mandriva-release ]; then
+        echo "You can build Mandriva packages only on a Mandriva Linux system."
+        exit ${ATI_INSTALLER_ERR_PREP}
+    
fi
+    [ -/usr/bin/rpmbuild ] && exit 0
+
+    if [ -
"$dryrun" ]; then
+        echo "You need the rpm-build package to build packages."
+        exit ${ATI_INSTALLER_ERR_PREP}
+    
fi
+
+    if [ -
"$DISPLAY" ]; then
+        gurpmi --auto rpm-build
+    else
+        
su -"urpmi --auto rpm-build"
+    fi
+
+    [ -
/usr/bin/rpmbuild ] && exit 0
+
+    echo 
"Package rpm-build is needed but installation failed."
+    exit ${ATI_INSTALLER_ERR_PREP}
+}
+
 
#Function: buildPackage()
 #Purpose: build the requested package if it is supported
 
buildPackage()
@@ -
58,+82,@@ buildPackage()
     
cp ${AbsDistroDir}/fglrx.spec ${TmpPkgSpec}

     
#Build the package
-    rpm -bb --with ati 
+    LC_ALL=C rpm -bb --with ati 
     
--define "_topdir ${RpmRoot}" 
     
--define "_tmppath ${RpmRoot}/tmp" 
     
--define "_builddir ${RpmRoot}/BUILD" 
@@ -101,+125,62 @@ buildPackage()
     exit ${
EXIT_CODE}
 }

+
installPackage()
+{
+    
package=$1
+    distrover=$(cat /etc/version cut -d. -f1)
+    if [ 
"${package}" != "${distrover}" ]; then
+        echo "Mandriva Linux ${distrover} can't use ${package} packages."
+        exit 1
+    fi
+    packagenames="$(rpm -q --specfile --with ati \
+        --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' \
+    --define "
version $(./ati-packager-helper.sh --version)" \
+    --define "
rel $(./ati-packager-helper.sh --release)" \
+    --define "
distsuffix amd.mdv" \
+    --define "
mdkversion ${package}00" \
+    --define "
mandriva_release ${package}" \
+    $(dirname $0)/fglrx.spec | tail -n+2 | grep -v -e ^fglrx-debug -e ^fglrx-__restore__)"
+    if [ -"${packagenames}" ]; then
+        echo "Unable to determine package names."
+        exit 1
+    fi
+    pushd ..
+    if [ -
"$DISPLAY" ]; then
+        gurpmi --auto $packagenames
+    else
+        
su -"urpmi --auto $packagenames"
+    fi
+    ret=$?
+    
popd
+    if [ $ret -ne 0 ]; then
+        echo "Unable to install packages."
+        exit 1
+    fi
+    echo "Installation successful."
+    exit 0
+}
+
+
isValidDistro()
+{
+    for 
supported_list in `getSupportedPackages`
+    do
+        if [ 
"${supported_list}" "$1" ]
+        
then
+            return 0
+        fi
+    done
+    return 1
+}
+
+
checkDistro()
+{
+    if ! 
isValidDistro $1then
+        echo "Unsupported distribution:" $1
+        exit 1
+    fi
+}
+
 
#Starting point of this script, process the {action} argument

 #Requested action
@@ -108,34 +188,22 @@ action=$1

 
case "${action}" in
 
--get-supported)
-    
getSupportedPackages
+    getSupportedPackages
     
;;
 --
buildpkg)
     
#First determine if we are explicitly calling a release build
     
package=$2
     support_flag
=false
-    for supported_list in `getSupportedPackages`
-    do
-        if [ 
"${supported_list}" "${package}" ]
-        
then
-            support_flag=true
-            break
-        
fi
-    done
-    #If we haven't explicitly called, or failed to type something coherent
+    isValidDistro ${package} && support_flag=true
+
     
#automatically detect
     
if [ "${support_flag}" != "true" ]
     
then
         package
=$(cat /etc/version cut -d. -f1)
-        for 
supported_list in `getSupportedPackages`
-        do
-            if [ 
"${supported_list}" "${package}" ]
-            
then
-                support_flag=true
-                echo "Automatically detected" ${package}
-                break
-            
fi
-        done
+        if isValidDistro ${package}; then
+            support_flag=true
+            echo "Automatically detected" ${package}
+        
fi
     fi
     
if [ "${support_flag}" "true" ]
     
then
@@ -146,+214,36 @@ case "${action}" in
     fi
     
exit 0
     
;;
+--
buildprep)
+    
package=$2
+    if [ -"$3" -"$3" != "--dryrun" ]; then
+        echo $3unsupported option passed by ati-installer.sh
+        exit 1
+    fi
+    checkDistro $package
+    buildPrep $$3
+    ;;
+--
installpkg)
+    
package=$2
+    checkDistro $package
+    installPackage $package
+    ;;
+--
installprep)
+    
package=$2
+    checkDistro $package
+    # All this is handled in --installpkg already.
+    exit 0
+    ;;
+--
identify)
+    
package=$2
+    if [ -/etc/mandriva-release -"${package}" "$(cat /etc/version | cut -d. -f1)" ]; then
+        exit 0
+    fi
+    exit ${ATI_INSTALLER_ERR_VERS}
+    ;;
+--
getAPIVersion)
+    exit 
2
+    ;;
 *|--*)
     echo ${
action}: unsupported option passed by ati-installer.sh
     
exit 
 
Phoronix.com
Linux Driver Forums
Copyright © 2010 by Phoronix Media