kde-base.spec 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. ##
  2. ## kde-base.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_kde 3.2.3
  27. %define V_base 3.2.3
  28. # package information
  29. Name: kde-base
  30. Summary: K Desktop Environment (Base Components)
  31. URL: http://www.kde.org/
  32. Vendor: KDE Project
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: EVAL
  36. Group: KDE
  37. License: GPL
  38. Version: %{V_base}
  39. Release: 20040807
  40. # list of sources
  41. Source0: ftp://ftp.kde.org/pub/kde/stable/%{V_kde}/src/kdebase-%{V_base}.tar.bz2
  42. Patch0: kde-base.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make, pkgconfig
  47. PreReq: OpenPKG, openpkg >= 20040130
  48. BuildPreReq: X11, kde-qt, kde-arts, kde-libs, openssl, gettext
  49. PreReq: X11, kde-qt, kde-arts, kde-libs, openssl, gettext
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. KDE is a powerful Open Source graphical desktop environment for Unix
  54. workstations. It combines ease of use, contemporary functionality,
  55. and outstanding graphical design with the technological superiority
  56. of the Unix operating system.
  57. This part is the KDE Base Components.
  58. %track
  59. prog kde-base = {
  60. version = %{version}
  61. url = ftp://ftp.kde.org/pub/kde/stable/
  62. regex = (\d+\.\d+\.\d+)
  63. url = ftp://ftp.kde.org/pub/kde/stable/__NEWVER__/src/
  64. regex = kdebase-(__VER__)\.tar\.bz2
  65. }
  66. %prep
  67. %setup -q -n kdebase-%{V_base}
  68. %patch -p0
  69. # GCC 3.3 with -pedantic is too restrictive for most vendor system headers.
  70. %{l_shtool} subst \
  71. -e 's;-pedantic;;' \
  72. configure
  73. # adjust hardcoded paths
  74. %{l_shtool} subst \
  75. -e 's;kde3\(/plugins/designer\);kde\1;g' \
  76. configure
  77. # fix UIC check
  78. %{l_shtool} subst \
  79. -e 's;grep klineedit;grep -i klineedit;g' \
  80. configure
  81. # deactivate unsafe chown root operations
  82. %{l_shtool} subst \
  83. -e 's;-m 4755 -o root;-m 4755;g' \
  84. configure
  85. # redirect false datadir based locations
  86. %{l_shtool} subst -s \
  87. -e 's;$(prefix)/share/;$(datadir);' \
  88. `find . -name Makefile.in -type f -print`
  89. # make sure KDE searches for binaries inside OpenPKG first
  90. %{l_shtool} subst -s \
  91. -e 's;\(kde_default_bindirs\)="[^"]*";\1="%{l_prefix}/libexec/kde %{l_prefix}/bin /bin /sbin /usr/bin /usr/sbin";' \
  92. configure
  93. %build
  94. # set standard KDE/Qt build environment
  95. export CC="%{l_cc} `%{l_prefix}/bin/pkg-config --libs-only-L kde-qt`"
  96. export CXX="%{l_cxx} `%{l_prefix}/bin/pkg-config --libs-only-L kde-qt`"
  97. export CFLAGS="`%{l_prefix}/bin/pkg-config --cflags-only-other kde-qt` %{l_cflags -O}"
  98. export CXXFLAGS="`%{l_prefix}/bin/pkg-config --cflags-only-other kde-qt` %{l_cxxflags -O}"
  99. export CPPFLAGS="`%{l_prefix}/bin/pkg-config --cflags-only-I kde-qt` %{l_cppflags}"
  100. export LDFLAGS="`%{l_prefix}/bin/pkg-config --libs-only-L kde-qt` %{l_ldflags}"
  101. export LIBS="`%{l_prefix}/bin/pkg-config --libs-only-l --libs-only-other kde-qt`"
  102. export PATH="%{l_prefix}/libexec/kde:`%{l_prefix}/etc/rc --query x11_bindir`:$PATH"
  103. export LD_LIBRARY_PATH="%{l_prefix}/lib/kde:${LD_LIBRARY_PATH-/usr/lib}"
  104. export MOC="%{l_prefix}/libexec/kde/moc"
  105. export UIC_PATH="%{l_prefix}/libexec/kde/uic"
  106. export HOME="`pwd`"
  107. export KDECONFIG="%{l_prefix}/libexec/kde/kde-config"
  108. # set KDE/Qt installation paths
  109. export KDEDIR="%{l_prefix}"
  110. export kde_htmldir='%{l_prefix}/share/kde/doc/HTML'
  111. export kde_appsdir='%{l_prefix}/share/kde/applnk'
  112. export kde_icondir='%{l_prefix}/share/kde/icons'
  113. export kde_sounddir='%{l_prefix}/share/kde/sounds'
  114. export kde_datadir='%{l_prefix}/share/kde/apps'
  115. export kde_locale='%{l_prefix}/share/kde/locale'
  116. export kde_confdir='%{l_prefix}/share/kde/config'
  117. export kde_mimedir='%{l_prefix}/share/kde/mimelnk'
  118. export kde_toolbardir='%{l_prefix}/share/kde/toolbar'
  119. export kde_wallpaperdir='%{l_prefix}/share/kde/wallpapers'
  120. export kde_templatesdir='%{l_prefix}/share/kde/templates'
  121. export kde_servicesdir='%{l_prefix}/share/kde/services'
  122. export kde_servicetypesdir='%{l_prefix}/share/kde/servicetypes'
  123. export kde_bindir='%{l_prefix}/libexec/kde'
  124. export kde_cgidir='%{l_prefix}/lib/kde/cgi'
  125. export kde_moduledir='%{l_prefix}/lib/kde/modules'
  126. export kde_styledir='%{l_prefix}/lib/kde/plugins/styles'
  127. export kde_widgetdir='%{l_prefix}/lib/kde/plugins/designer'
  128. # configure package
  129. export DO_NOT_COMPILE="kdm"
  130. ./configure \
  131. --prefix=%{l_prefix} \
  132. --bindir=%{l_prefix}/libexec/kde \
  133. --includedir=%{l_prefix}/include/kde \
  134. --libdir=%{l_prefix}/lib/kde \
  135. --datadir=%{l_prefix}/share/kde \
  136. --localstatedir=%{l_prefix}/var/kde \
  137. --with-x \
  138. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  139. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  140. --with-qt-dir=%{l_prefix} \
  141. --with-qt-includes=%{l_prefix}/include/kde/qt \
  142. --with-qt-libraries=%{l_prefix}/lib/kde \
  143. --with-extra-includes=%{l_prefix}/include \
  144. --with-extra-libs=%{l_prefix}/lib \
  145. --with-ssl-dir=%{l_prefix} \
  146. --without-java \
  147. --without-motif \
  148. --disable-debug \
  149. --enable-rpath \
  150. --disable-static \
  151. --enable-shared
  152. # prevent linking of static libraries to early in the build process
  153. %{l_shtool} subst \
  154. -e 's;\-lXrender;;g' \
  155. -e 's;\-lexpat;;g' \
  156. -e 's;\-lfreetype;;g' \
  157. -e 's;\-lfontconfig;;g' \
  158. kate/interfaces/Makefile \
  159. kcontrol/background/Makefile \
  160. kcontrol/filetypes/Makefile \
  161. kcontrol/input/Makefile \
  162. kcontrol/style/Makefile \
  163. kcontrol/kcontrol/Makefile \
  164. kcontrol/colors/Makefile \
  165. kcontrol/fonts/Makefile \
  166. kcontrol/kfontinst/lib/Makefile \
  167. kfind/Makefile \
  168. khotkeys/kcontrol/ui/Makefile \
  169. khotkeys/shared/Makefile \
  170. kicker/share/Makefile \
  171. kicker/core/Makefile \
  172. kicker/buttons/Makefile \
  173. kicker/ui/Makefile \
  174. klipper/Makefile \
  175. ksplashml/themeengine/default/Makefile \
  176. ksplashml/themeengine/redmond/Makefile \
  177. ksplashml/themeengine/standard/Makefile \
  178. ksysguard/gui/SensorDisplayLib/Makefile \
  179. libkonq/Makefile
  180. # if linked with static libraries, order is important
  181. %{l_shtool} subst \
  182. -e '/^kfontinst_LDADD = /s;\(\$(LIBFONTCONFIG_LIBS) \$(LIBFREETYPE_LIBS)\) \(\$(LIB_KDECORE) \.\./lib/libkfontinst.la\);\2 \1;' \
  183. kcontrol/kfontinst/kfontinst/Makefile
  184. # add directives for pcre where needed
  185. %{l_shtool} subst \
  186. -e '/LIBS = /s;\(\-lqt-mt\);\-lpcreposix \-lpcre \1;g' \
  187. khelpcenter/Makefile \
  188. kdesktop/kwebdesktop/Makefile
  189. # build package
  190. %{l_make} %{l_mflags -O}
  191. %install
  192. # set minimal KDE/Qt run-time environment
  193. export PATH="%{l_prefix}/libexec/kde:`%{l_prefix}/etc/rc --query x11_bindir`:$PATH"
  194. export LD_LIBRARY_PATH="%{l_prefix}/lib/kde:${LD_LIBRARY_PATH-/usr/lib}"
  195. # install package
  196. rm -rf $RPM_BUILD_ROOT
  197. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  198. # strip down installation
  199. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/kde/* >/dev/null 2>&1 || true
  200. # determine installation files
  201. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  202. %files -f files
  203. %clean
  204. rm -rf $RPM_BUILD_ROOT