gtk2.spec 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ##
  2. ## gtk2.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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_gtk 2.2.3
  27. %define V_gtk_major 2.2
  28. %define V_glib_major 2.2
  29. %define V_pango_major 1.2
  30. %define V_atk_major 1.2
  31. # package information
  32. Name: gtk2
  33. Summary: The Gtk Toolkit Library (%{V_gtk_major})
  34. URL: http://www.gtk.org/
  35. Vendor: The Gtk Project
  36. Packager: The OpenPKG Project
  37. Distribution: OpenPKG [PLUS]
  38. Group: XWindow
  39. License: GPL
  40. Version: %{V_gtk}
  41. Release: 20030827
  42. # list of sources
  43. Source0: ftp://ftp.gtk.org/pub/gtk/v%{V_gtk_major}/gtk+-%{V_gtk}.tar.gz
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20021218, glib2 >= %{V_glib_major}
  48. BuildPreReq: X11, png, jpeg, tiff, gettext, make
  49. BuildPreReq: pango >= %{V_pango_major}, atk >= %{V_atk_major}
  50. PreReq: OpenPKG, openpkg >= 20021218, glib2 >= %{V_glib_major}
  51. PreReq: X11, png, jpeg, tiff, gettext
  52. PreReq: pango >= %{V_pango_major}, atk >= %{V_atk_major}
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. Gtk+ is a multi-platform toolkit for creating graphical user
  57. interfaces. Offering a complete set of widgets, Gtk+ is suitable for
  58. projects ranging from small one-off projects to complete application
  59. suites.
  60. %prep
  61. %setup -q -n gtk+-%{version}
  62. # avoid including static libraries into convenience libraries
  63. %{l_shtool} subst \
  64. -e 's;^LIBS =.*;LIBS =;' \
  65. gdk-pixbuf/Makefile.in \
  66. gdk-pixbuf/pixops/Makefile.in \
  67. gdk/x11/Makefile.in
  68. # avoid searching for shared libraries
  69. %{l_shtool} subst \
  70. -e 's;\$export_dynamic_flag_spec;;g' \
  71. -e 's;\$lt_export_dynamic_flag_spec;;g' \
  72. configure
  73. # build binaries from static libraries
  74. %{l_shtool} subst \
  75. -e 's;\(gtk_demo_LDFLAGS *=\);\1 -static;' \
  76. -e 's;\(gtk_demo_LDADD .*\);\1 -lintl;' \
  77. -e 's;\(gtk_query_immodules_2_0_LDFLAGS *=\);\1 -static;' \
  78. -e 's;\(gtk_query_immodules_2_0_LDADD .*\);\1 -lintl;' \
  79. -e 's;\(gdk_pixbuf_csource_LDFLAGS *=\);\1 -static;' \
  80. -e 's;\(gdk_pixbuf_csource_LDADD .*\);\1 -lintl;' \
  81. -e 's;\(gdk_pixbuf_query_loaders_LDFLAGS *=\);\1 -static;' \
  82. -e 's;\(gdk_pixbuf_query_loaders_LDADD .*\);\1 -lintl;' \
  83. demos/gtk-demo/Makefile.in \
  84. gtk/Makefile.in \
  85. gdk-pixbuf/Makefile.in
  86. # remove version from paths
  87. %{l_shtool} subst \
  88. -e 's;/gtk-2\.0;/gtk2;g' \
  89. -e 's;lib\(g[-_a-z]*\)-2\.0;lib\12;g' \
  90. -e 's;/@PACKAGE@;;g' \
  91. -e 's;-\$(GTK_API_VERSION);2;g' \
  92. -e 's;/\$(GTK_BINARY_VERSION);;g' \
  93. Makefile.in \
  94. */Makefile.in \
  95. */*/Makefile.in
  96. %{l_shtool} subst \
  97. -e 's;/gtk-2\.0;/gtk2;g' \
  98. -e 's;-l\(g[-_a-z]*\)-@GTK_API_VERSION@;-l\12;g' \
  99. -e 's;-l\(g[-_a-z]*\)-\${target}-@GTK_API_VERSION@;-l\12;g' \
  100. *-2.0.pc.in
  101. %{l_shtool} subst \
  102. -e 's;gtk-2.0;gtk2;g' \
  103. gtk/gtkrc.c
  104. # adjust path to locale and doc files
  105. %{l_shtool} subst \
  106. -e 's;\${libdir}/locale;\${datadir}/locale;' \
  107. -e 's;/gtk-doc/html;/gtk2/html;g' \
  108. configure
  109. %{l_shtool} subst \
  110. -e 's;\$(libdir)/locale;\$(datadir)/locale;' \
  111. po/Makefile.in.in
  112. %build
  113. CC="%{l_cc}" \
  114. CFLAGS="%{l_cflags -O}" \
  115. CPPFLAGS="%{l_cppflags tiff}" \
  116. LDFLAGS="%{l_ldflags}" \
  117. ./configure \
  118. --prefix=%{l_prefix} \
  119. --with-x \
  120. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  121. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  122. --with-glib-prefix=%{l_prefix} \
  123. --with-libpng=%{l_prefix} \
  124. --with-libjpeg=%{l_prefix} \
  125. --with-libtiff=%{l_prefix} \
  126. --disable-modules \
  127. --with-included-loaders=yes \
  128. --enable-nls \
  129. --with-native-locale=no \
  130. --enable-shm \
  131. --disable-debug \
  132. --disable-rebuilds \
  133. --enable-shared \
  134. --enable-static
  135. %{l_make} %{l_mflags}
  136. %install
  137. rm -rf $RPM_BUILD_ROOT
  138. %{l_shtool} mkdir -f -p -m 755 \
  139. $RPM_BUILD_ROOT%{l_prefix}/etc/gtk2
  140. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  141. # provide config file
  142. %{l_shtool} install -c -m 644 \
  143. /dev/null \
  144. $RPM_BUILD_ROOT%{l_prefix}/etc/gtk2/gtk.immodules
  145. # use generic library name
  146. mv \
  147. $RPM_BUILD_ROOT%{l_prefix}/lib/libgtk-x11-2.0.a \
  148. $RPM_BUILD_ROOT%{l_prefix}/lib/libgtk2.a
  149. mv \
  150. $RPM_BUILD_ROOT%{l_prefix}/lib/libgdk-x11-2.0.a \
  151. $RPM_BUILD_ROOT%{l_prefix}/lib/libgdk2.a
  152. # clean up installation area
  153. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  154. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/themes
  155. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk*/demos
  156. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so
  157. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so.*
  158. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
  159. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/gtk2/immodules/*
  160. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-[0-9][0-9.]*
  161. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1
  162. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  163. %{l_files_std} \
  164. '%not %dir %{l_prefix}/share/aclocal' \
  165. '%not %dir %{l_prefix}/lib/pkgconfig'
  166. %files -f files
  167. %clean
  168. rm -rf $RPM_BUILD_ROOT