makeindyrpm.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. set -x
  3. #set -e
  4. echo "Extracting Program and RPM Values:"
  5. INDYVERSION=10.6.3.0
  6. # You actually should use three version values.
  7. # FPCVer is for the value reported by fpc for some path specs.
  8. # FPCRPMVER is used for our "Requires section so that this is
  9. # tied to the EXACT version of the fpc RPM you used to build
  10. # this.
  11. # FPCSRCRPMVER is used for our "Requires section so that this
  12. # is tied to the EXACT version of the fpc-src RPM you used
  13. # you have to prevent errors.
  14. INDYRELNO=9
  15. FPCVER=`fpc -iV`
  16. FPCRPMVER=$(rpm -qa | egrep '^fpc-[0-9]')
  17. FPCRPMVER=${FPCRPMVER:4}
  18. FPCSRCRPMVER=$(rpm -qa | egrep '^fpc-src-[0-9]')
  19. FPCSRCRPMVER=${FPCSRCRPMVER:8}
  20. echo "FPC Version: $FPCVER"
  21. echo "FPC RPM Ver: $FPCRPMVER"
  22. echo "FPCSRC RPM Ver: $FPCSRCRPMVER"
  23. echo "making tarball"
  24. #rm indy-$INDY_Version.tar.bz2
  25. tar jcf indy-$INDYVERSION.tar.bz2 .
  26. pwd
  27. echo "copying tarball to ~/rpmbuild/SOURCES"
  28. cp indy-$INDYVERSION.tar.bz2 ~/rpmbuild/SOURCES
  29. echo "Making RPM spec file"
  30. cat indy-fpc.spec.template| \
  31. sed -e "s/^%define _FPC_Version .*/%define _FPC_Version $FPCVER/" \
  32. -e "s/^%define _FPC_RPM_Ver .*/%define _FPC_RPM_Ver $FPCRPMVER/" \
  33. -e "s/^%define _FPC_SRC_RPM_Ver .*/%define _FPC_SRC_RPM_Ver $FPCSRCRPMVER/" \
  34. -e "s/^Version: .*/Version: $INDYVERSION/" \
  35. -e "s/^Release: .*/Release: $INDYRELNO/" \
  36. > indy-fpc.spec
  37. echo "Building RPM"
  38. rpmbuild -bb -v indy-fpc.spec