fpc.spec 3.3 KB

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