fpc.spec 3.6 KB

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