tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

buildrpm (837B)


      1 #!/bin/bash
      2 
      3 source=.
      4 version=`cat $source/../version`
      5 package=$source/../alsa-utils-$version.tar.bz2
      6 packagedir=/usr/src/redhat
      7 xrpmbuild=rpm
      8 rpmbuild --usage 2> /dev/null > /dev/null && xrpmbuild=rpmbuild
      9 
     10 # SuSE path
     11 if [ -d /usr/src/packages ]; then
     12   packagedir=/usr/src/packages
     13 fi
     14 
     15 make -C .. clean
     16 make -C .. dist
     17 
     18 if [ ! -r $package ]; then
     19   echo "Error: wrong package: $package"
     20   exit 1
     21 fi
     22 
     23 cp -fv $package ${packagedir}/SOURCES
     24 
     25 if [ ! -r $source/buildrpm ]; then
     26   echo "Error: invalid directory: $source"
     27   exit 1
     28 fi
     29 
     30 if [ ! -d ${packagedir} ]; then
     31   echo "Error: ${packagedir} directory not found"
     32   exit 1
     33 fi
     34 
     35 if [ ! -r $source/alsadriver.spec ]; then
     36   cd $source/..
     37   ./configure
     38   cd utils
     39 fi
     40 
     41 cp -fv $source/alsa-utils.spec ${packagedir}/SPECS
     42 cd ${packagedir}/SPECS
     43 $xrpmbuild -ba alsa-utils.spec
     44 cd ${packagedir}