Advertisement
david_david

macro's Mageia policy

Apr 8th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. From Mageia policy:
  2.  
  3. You must use following command on spec file:
  4.  
  5. - %configure2_5x
  6. instead of:
  7. %configure or ./configure
  8.  
  9. -%configure2_5x \
  10. --with-pthreads \
  11. --enable-char-encoding=locale \
  12. --disable-static
  13. instead of:
  14. %configure2_5x --with-pthreads --enable-char-encoding=locale --disable-static
  15.  
  16. -%makeinstall_std
  17. instead of:
  18. make install (this is fedora's macro)
  19.  
  20. -%make
  21. instead of:
  22. make (unless the parallell make is broken)
  23. or
  24. make %{?_smp_mflags} (this is fedora's macro)
  25.  
  26. -%cmake
  27. instead of:
  28. mkdir build && cd build
  29. cmake
  30.  
  31. -%makeinstall_std -C build
  32. instead of:
  33. cd build
  34. %makeinstall_std
  35.  
  36. -%{_iconsdir}
  37. instead of:
  38. %{_datadir}/icons
  39.  
  40. -%{_javadir}
  41. instead of:
  42. %{_datadir}/java
  43.  
  44. -%{_docdir}
  45. instead of:
  46. %}_datadir}/doc
  47.  
  48. -%{_mandir}
  49. instead of:
  50. %{_datadir}/man
  51.  
  52. -add a link url for Source's (Always check if URL and Source URL are the last current and the good)
  53. ex: http://sourceforge.net/projects/%{name}/files/%{name}/%{version}/%{name}-%{version}.tar.gz
  54. instead of:
  55. %{name}-%{version}.tar.gz
  56.  
  57. -%{_datadir}/%{name}/ (it is better)
  58. instead of:
  59. %{_datadir}/%{name}/* (the '*' alone will prevent the removal of the %{name} folder)
  60. or you use (but must be 2 lines):
  61. dir %{_datadir}/%{name}/
  62. %{_datadir}/%{name}/*
  63.  
  64. -%apply_patches (only works if in the patch there is the full file path, option -p1 not for -p0)
  65. instead of:
  66. Patch0 -p1
  67. Patch1 -p1
  68. Patch2 -p1
  69. Patch3 -p1
  70. Patch4 -p1
  71.  
  72. -When deleted static build you must add two lines (on %install section) : (we do not need the static packages)
  73. # we don't want these
  74. find %{buildroot} -name '*.la' -delete
  75.  
  76. -for library packages (an example):
  77. %define major 3
  78. %define libname %mklibname %{name}_ %{major}
  79. %define develname %mklibname %{name} -d
  80.  
  81. -BuildRequires: pkgconfig(ffms2)
  82. instead of:
  83. BuildRequires: ffms2-devel
  84. to find if pkgconfig is available you can use:
  85. urpmq --provides lib64ffms2-devel or urpmq --provides libffms2-devel
  86.  
  87. -%find_lang %{name} (when you use this command add this one on %files section too) (only used for .mo files on /usr/share/locale)
  88. %files -f %{name}.lang
  89. -f %{name}.lang (this command does not install all the languages ​​of software on your system, it will look for the file '/etc/rpm/macros' and install only languages ​​allowed in this file, especially if there is, for example, 100 different translations)
  90.  
  91. -%{qt4bin}/lrelease translation/*.ts or %{qt4bin}/lrelease i18n/*.ts
  92. instead of
  93. export PATH=$PATH:%{_libdir}/qt4/bin
  94. lrelease translation/*.ts
  95. or
  96. %{_prefix}/%{_lib}/qt4/bin/lrelease translation/*.ts or %{_prefix}/%{_lib}/qt4/bin/lrelease i18n/*.ts
  97.  
  98. -%{__python} setup.py build
  99. instead of:
  100. python setup.py build
  101.  
  102. -%{__python} setup.py install --root=%{buildroot} --skip-build
  103. instead of:
  104. python setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot}
  105.  
  106. -desktop-file-install (add desktop-file-utils on BR)
  107. desktop-file-install \
  108. --dir=%{buildroot}%{_datadir}/applications/ \
  109. --remove-key=Encoding \
  110. --set-key=Keywords --set-value='PGN;FEN;Database;' \
  111. --set-key=Keywords[de] --set-value='PGN;FEN;Datenbank;' \
  112. --remove-key=Comment \
  113. --set-icon=%{name} \
  114. unix/%{name}.desktop
  115.  
  116. -desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement