fpc.spec 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. Name: fpc
  2. Version: 1.9.7
  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 fv_smart FPC=${NEWPP}
  58. make packages_extra_smart FPC=${NEWPP}
  59. make ide_all FPC=${NEWPP}
  60. make utils_all FPC=${NEWPP}
  61. if [ -z ${NODOCS} ]; then
  62. make -C docs pdf FPDOC=${NEWFPDOC}
  63. fi
  64. %install
  65. if [ %{buildroot} != "/" ]; then
  66. rm -rf %{buildroot}
  67. fi
  68. NEWPP=`pwd`/compiler/%{ppcname}
  69. INSTALLOPTS="FPC=${NEWPP} INSTALL_PREFIX=%{buildroot}/usr INSTALL_LIBDIR=%{buildlibdir} \
  70. INSTALL_DOCDIR=%{builddocdir} INSTALL_BINDIR=%{buildbindir} \
  71. INSTALL_EXAMPLEDIR=%{buildexampledir}"
  72. make compiler_distinstall ${INSTALLOPTS}
  73. make rtl_distinstall ${INSTALLOPTS}
  74. make packages_distinstall ${INSTALLOPTS}
  75. make fcl_distinstall ${INSTALLOPTS}
  76. make fv_distinstall ${INSTALLOPTS}
  77. make ide_distinstall ${INSTALLOPTS}
  78. make utils_distinstall ${INSTALLOPTS}
  79. make demo_install ${INSTALLOPTS} INSTALL_SOURCEDIR=%{buildexampledir}
  80. make doc_install ${INSTALLOPTS}
  81. make man_install ${INSTALLOPTS} INSTALL_MANDIR=%{buildmandir}
  82. if [ -z ${NODOCS} ]; then
  83. make -C docs pdfinstall DOCINSTALLDIR=%{builddocdir}
  84. fi
  85. # create link
  86. ln -sf %{fpcdir}/%{ppcname} %{buildroot}%{_bindir}/%{ppcname}
  87. # Workaround:
  88. # newer rpm versions do not allow garbage
  89. # delete lexyacc
  90. rm -rf %{buildroot}/usr/lib/fpc/lexyacc
  91. %clean
  92. make compiler_clean
  93. make rtl_clean
  94. make packages_clean
  95. make fcl_clean
  96. make fv_clean
  97. make ide_clean
  98. make utils_clean
  99. if [ -z ${NODOCS} ]; then
  100. make -C docs clean
  101. fi
  102. if [ %{buildroot} != "/" ]; then
  103. rm -rf %{buildroot}
  104. fi
  105. %post
  106. # Create a version independent config
  107. %{fpcdir}/samplecfg %{_libdir}/fpc/\$fpcversion
  108. %files
  109. %defattr(-, root, root)
  110. %{_bindir}/*
  111. %{fpcdir}
  112. %doc %{docdir}/NEWS
  113. %doc %{docdir}/README
  114. %doc %{docdir}/readme.ide
  115. %doc %{docdir}/faq*
  116. %doc %{exampledir}/*
  117. %{_mandir}/*/*