fpc.spec 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. Name: fpc
  2. Version: 1.9.5
  3. Release: 0
  4. ExclusiveArch: i386 i586 i686 ppc
  5. Copyright: GPL
  6. Group: Development/Languages
  7. Source: %{name}-%{version}-src.tar.gz
  8. Summary: Free Pascal Compiler
  9. Packager: Peter Vreman ([email protected])
  10. URL: http://www.freepascal.org/
  11. BuildRoot: %{_tmppath}/fpc-build
  12. BuildRequires: fpc
  13. %define fpcdir %{_libdir}/fpc/%{version}
  14. %define docdir %{_docdir}/fpc-%{version}
  15. %define exampledir %{docdir}/examples
  16. %ifarch ppc
  17. %define ppcname ppcppc
  18. %else
  19. %define ppcname ppc386
  20. %endif
  21. %define builddocdir %{buildroot}%{docdir}
  22. %define buildmandir %{buildroot}%{_mandir}
  23. %define buildbindir %{buildroot}%{_bindir}
  24. %define buildlibdir %{buildroot}%{_libdir}
  25. %define buildexampledir %{buildroot}%{exampledir}
  26. # The normal redhat rpm scripts does not recognize properly, what files to strip
  27. # Hook our own strip command
  28. %define __strip %{_builddir}/%{name}-%{version}/smart_strip.sh
  29. %description
  30. The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit
  31. Pascal Compiler. It comes with fully TP 7.0 compatible run-time library.
  32. Some extensions are added to the language, like function overloading. Shared
  33. libraries can be linked. Basic Delphi support is already implemented (classes,
  34. exceptions,ansistrings,RTTI). This package contains commandline compiler and
  35. utils. Provided units are the runtime library (RTL), free component library
  36. (FCL), gtk,ncurses,zlib, mysql,postgres,ibase bindings.
  37. ###############################################################################
  38. # fpc.rpm
  39. #
  40. %prep
  41. %setup -c
  42. %build
  43. NEWPP=`pwd`/compiler/%{ppcname}
  44. NEWFPDOC=`pwd`/utils/fpdoc/fpdoc
  45. make compiler_cycle
  46. make rtl_clean rtl_smart FPC=${NEWPP}
  47. make packages_base_smart FPC=${NEWPP}
  48. make fcl_smart FPC=${NEWPP}
  49. make packages_extra_smart FPC=${NEWPP}
  50. make utils_all FPC=${NEWPP}
  51. if [ -z ${NODOCS} ]; then
  52. make -C docs pdf FPDOC=${NEWFPDOC}
  53. fi
  54. %install
  55. if [ %{buildroot} != "/" ]; then
  56. rm -rf %{buildroot}
  57. fi
  58. NEWPP=`pwd`/compiler/%{ppcname}
  59. INSTALLOPTS="FPC=${NEWPP} INSTALL_PREFIX=%{buildroot}/usr INSTALL_LIBDIR=%{buildlibdir} \
  60. INSTALL_DOCDIR=%{builddocdir} INSTALL_BINDIR=%{buildbindir} \
  61. INSTALL_EXAMPLEDIR=%{buildexampledir}"
  62. make compiler_distinstall ${INSTALLOPTS}
  63. make rtl_distinstall ${INSTALLOPTS}
  64. make packages_distinstall ${INSTALLOPTS}
  65. make fcl_distinstall ${INSTALLOPTS}
  66. make utils_distinstall ${INSTALLOPTS}
  67. make demo_install ${INSTALLOPTS} INSTALL_SOURCEDIR=%{buildexampledir}
  68. make doc_install ${INSTALLOPTS}
  69. make man_install ${INSTALLOPTS} INSTALL_MANDIR=%{buildmandir}
  70. if [ -z ${NODOCS} ]; then
  71. make -C docs pdfinstall DOCINSTALLDIR=%{builddocdir}
  72. fi
  73. # create link
  74. ln -sf %{fpcdir}/%{ppcname} %{buildroot}%{_bindir}/%{ppcname}
  75. # Workaround:
  76. # newer rpm versions do not allow garbage
  77. # delete lexyacc
  78. rm -rf %{buildroot}/usr/lib/fpc/lexyacc
  79. %clean
  80. make compiler_clean
  81. make rtl_clean
  82. make packages_clean
  83. make fcl_clean
  84. make utils_clean
  85. if [ -z ${NODOCS} ]; then
  86. make -C docs clean
  87. fi
  88. if [ %{buildroot} != "/" ]; then
  89. rm -rf %{buildroot}
  90. fi
  91. %post
  92. # Create a version independent config
  93. %{fpcdir}/samplecfg %{_libdir}/fpc/\$version
  94. %files
  95. %defattr(-, root, root)
  96. %{_bindir}/*
  97. %{fpcdir}
  98. %doc %{docdir}/NEWS
  99. %doc %{docdir}/README
  100. %doc %{docdir}/faq*
  101. %doc %{exampledir}/*
  102. %{_mandir}/*/*