From: Wai-Sun Chia Date: 2001-06-07T18:06:31+09:00 Subject: [ruby-talk:16300] RPM .spec for Ruby and friends This is a multi-part message in MIME format. --------------B1D834A2FCB52CBC61E45E48 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I'm a fairly new Rubyist, and have just completed my first Ruby program (which is a data convertor shuttling rows betwween a Postgres and Oracle dbs). I'm impressed by the speed of which the solution flowed from my head into code.. ;-) Most of the time I'm happy not to think about stuff like malloc'ing and freeing stuff (have you ever tried OCI programming in 'C'? Don't!). As a contribution back to the Ruby community, here's a couple of spec files (so that you can make your own RPMs) that I've used successfully to build RPM packages for my Redhat system. Attached are the spec files for the following Ruby extensions: * Ruby (this is a hacked version from Mandrake, RH's version sucked) * Oracle * PostgreSQL * XML * Gnome HTH. Keep on Rubying! -- Wai-Sun "Squidster" Chia Unix/Web Developer/RHCE Professional Services --------------B1D834A2FCB52CBC61E45E48 Content-Type: text/plain; charset=us-ascii; name="ruby.spec" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby.spec" Summary: Object Oriented Script Language Name: ruby Version: 1.6.4 %define subver 1.6 Release: 1 License: GPL Group: Development/Other BuildRequires: XFree86-devel gpm-devel ncurses-devel readline-devel tcl tk Source: ftp://ftp.netlab.co.jp/pub/lang/ruby/ruby-1.6.4.tar.bz2 Source1: http://www.pragprog.com:8080/rubyfaq/rubyfaqall.html.bz2 Source2: http://www.rubycentral.com/downloads/files/ProgrammingRuby-0.2.tar.bz2 URL: http://www.ruby-lang.org/ Packager: Pixel BuildRoot: %{_tmppath}/%{name}-%{version}-root %ifarch ppc %define my_target_cpu powerpc %else %define my_target_cpu %{_target_cpu} %endif %package doc Summary: Documentation for the powerful language Ruby Group: Development/Other Requires: %{name} = %version-%release %package devel Summary: Development file for the powerful language Ruby Group: Development/Other Requires: %{name} = %version-%release %package tk Summary: Tk extension for the powerful language Ruby Group: Development/Other Requires: %{name} = %version-%release %description Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. %description doc Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. This package contains the Ruby's documentation %description devel Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. This package contains the Ruby's devel files. %description tk Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. This package contains the Tk extension for Ruby. %prep %setup -q #FILELIST="ruby.1 \ # ext/extmk.rb.in \ # ext/curses/*.rb \ # ext/tcltklib/demo/*.* ext/tcltklib/sample/*.rb ext/tcltklib/*.euc \ # ext/tk/sample/*.rb \ # sample/*.*" #for i in ${FILELIST}; do # sed -e s#/usr/local/bin/#%{_bindir}/#g $i >$i.$$ # mv $i.$$ $i #done %build %configure --with-default-kcode=none --enable-shared make make test %install rm -rf %buildroot make DESTDIR=%buildroot install install -d %buildroot%{_docdir}/%{name}-%{version} cp -a COPYING* ChangeLog README* ToDo sample %buildroot%{_docdir}/%{name}-%{version} bzcat %{SOURCE1} > %buildroot%{_docdir}/%{name}-%{version}/FAQ.html install -d %buildroot%{_datadir}/emacs/site-lisp cp -a misc/ruby-mode.el %buildroot%{_datadir}/emacs/site-lisp install -d %buildroot%{_sysconfdir}/emacs/site-start.d cat <%buildroot%{_sysconfdir}/emacs/site-start.d/%{name}.el (autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t) (add-to-list 'auto-mode-alist '("\\\\.rb$" . ruby-mode)) (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) EOF (cd %buildroot%{_docdir}/%{name}-%{version} ; tar xfj %{SOURCE2} ; cd Pro*; mv -f html/* . ; rm -rf html xml) (cd %buildroot ; find usr/lib/%{name}/%{subver} ! -type d -printf "/%%p\n") > %{name}.list (cd %buildroot ; find usr/lib/%{name}/%{subver} -type d -printf "%%%%dir /%%p\n") >> %{name}.list perl -ni -e 'print if !m|/(tcl)?tk|' %{name}.list perl -ni -e 'print if !m|%{my_target_cpu}-%{_host_os}/.*[ha]$|' %{name}.list %clean rm -rf %buildroot %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -f %{name}.list %defattr(-, root, root) %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/README %{_bindir}/* %dir %{_libdir}/%{name}/ %{_mandir}/*/* %{_datadir}/emacs/site-lisp/* %config(noreplace) %{_sysconfdir}/emacs/site-start.d/* %files doc %defattr(-, root, root) %{_docdir}/%{name}-%{version}/COPYING* %{_docdir}/%{name}-%{version}/ChangeLog %{_docdir}/%{name}-%{version}/README.* %{_docdir}/%{name}-%{version}/FAQ.html %{_docdir}/%{name}-%{version}/ToDo %{_docdir}/%{name}-%{version}/sample %{_docdir}/%{name}-%{version}/ProgrammingRuby* %files devel %defattr(-, root, root) %{_libdir}/%{name}/%{subver}/%{my_target_cpu}-%{_host_os}/*.[ah] %{_libdir}/libruby.so* %files tk %defattr(-, root, root) %{_libdir}/%{name}/%{subver}/%{my_target_cpu}-%{_host_os}/tcltk* %{_libdir}/%{name}/%{subver}/%{my_target_cpu}-%{_host_os}/tk* %{_libdir}/%{name}/%{subver}/tcltk* %{_libdir}/%{name}/%{subver}/tk* %changelog * Wed Jun 6 2001 Squidster 1.6.4-1 - Added in shared library, libruby.so* into the devel package * Mon Jun 4 2001 Pixel 1.6.4-1mdk - new version * Fri May 25 2001 Pixel 1.6.3-4mdk - directories-are-not-executables * Fri May 18 2001 Pixel 1.6.3-3mdk - fix dadou fucking up things (irb and emacs mode were not there anymore!) * Fri Apr 20 2001 David BAUDENS 1.6.3-2mdk - Fix build on PPC * Sun Mar 25 2001 Pixel 1.6.3-1mdk - new version * Mon Mar 19 2001 Pixel 1.6.2.2-2mdk - fix the ruby.el (\\. -> \\\\.) * Thu Jan 25 2001 Pixel 1.6.2.2-1mdk - new stable snapshot * Wed Dec 27 2000 Pixel 1.6.2-2mdk - fix extensions - create %{name}-devel - remove %{name}-extensions, but create %{name}-tk * Tue Dec 26 2000 Pixel 1.6.2-1mdk - new version * Mon Nov 27 2000 Pixel 1.6.1-4mdk - build again full optflags * Wed Nov 8 2000 Pixel 1.6.1-3mdk - build without -fomit-frame-pointer for time being - capitalize summaries * Mon Oct 2 2000 Pixel 1.6.1-2mdk - fix mispelling * Thu Sep 28 2000 Pixel 1.6.1-1mdk - new version - remove "--with-default-kcode=none", not more needed - remove setting optflags to -O2, ruby doesn't crashes any more * Tue Sep 19 2000 Pixel 1.6.0-1mdk - new version * Wed Aug 23 2000 Pixel 1.4.6-6mdk - add packager * Tue Aug 22 2000 Pixel 1.4.6-5mdk - nicer site-start.d/ruby.el (use add-to-list) * Tue Aug 22 2000 Pixel 1.4.6-4mdk - fix missing %%config * Tue Aug 22 2000 Pixel 1.4.6-3mdk - use %{_sysconfdir}/emacs/site-start.d for the ruby-mode.el * Fri Aug 18 2000 Pixel 1.4.6-2mdk - rebuild (fredlsux) * Fri Aug 18 2000 Pixel 1.4.6-1mdk - new version - remove menu * Mon Aug 07 2000 Frederic Lepied 1.4.5-6mdk - automatically added BuildRequires * Wed Jul 19 2000 Pixel 1.4.5-5mdk - rebuild with clean clean_menus * Wed Jul 19 2000 Pixel 1.4.5-4mdk - macroization - BM * Thu Jul 13 2000 Pixel 1.4.5-3mdk - fix %%URL * Sun Jun 25 2000 Pixel 1.4.5-2mdk - rebuild (src.rpm got lost :( ) * Fri Jun 23 2000 Pixel 1.4.5-1mdk - new version * Wed Jun 14 2000 Pixel 1.4.4-1mdk - new version * Mon Apr 10 2000 Pixel 1.4.3-6mdk - fix group for doc * Mon Mar 27 2000 Pixel 1.4.3-5mdk - add menu * Sat Mar 25 2000 Pixel 1.4.3-4mdk - new group + cleanup * Wed Feb 16 2000 Pixel 1.4.3-3mdk - build with no charset conversion (was kanji :) * Mon Feb 14 2000 Pixel 1.4.3-2mdk - added the reference manual and FAQ in doc - moved the lib/README in ext * Mon Feb 14 2000 Pixel 1.4.3-1mdk - mandrake adaptation and spliting in -/doc/extensions * Wed Dec 08 1999 Atsushi Yamagata - Updated to version 1.4.3 * Mon Sep 20 1999 Atsushi Yamagata - Updated to version 1.4.2 (Sep 18) * Fri Sep 17 1999 Atsushi Yamagata - Updated to version 1.4.2 * Tue Aug 17 1999 Atsushi Yamagata - Updated to version 1.4.0 * Fri Jul 23 1999 Atsushi Yamagata - 2nd release - Updated to version 1.2.6(15 Jul 1999) - striped %{prefix}/bin/ruby * Mon Jun 28 1999 Atsushi Yamagata - Updated to version 1.2.6(21 Jun 1999) * Wed Apr 14 1999 Atsushi Yamagata - Updated to version 1.2.5 * Fri Apr 09 1999 Atsushi Yamagata - Updated to version 1.2.4 * Fri Dec 25 1998 Toru Hoshina - Version up to 1.2 stable. * Fri Nov 27 1998 Toru Hoshina - Version up to 1.1c9. * Thu Nov 19 1998 Toru Hoshina - Version up to 1.1c8, however it appear short life :-P * Fri Nov 13 1998 Toru Hoshina - Version up. end of changelog shortened, hope you japs won't kill a froggy for this :) --------------B1D834A2FCB52CBC61E45E48 Content-Type: text/plain; charset=us-ascii; name="ruby-oracle.spec" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby-oracle.spec" %define name ruby-oracle %define version 0.2.11 %define release 1 Summary: Ruby extension library to access Oracle Databases Name: %{name} Version: %{version} Release: %{release} Source0: http://www.yoshidam.net/oracle-0.2.11.tar.gz Copyright: GPL Group: Development/Other BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} Requires: ruby >= 1.6 BuildRequires: ruby-devel %description Ruby extension library to access Oracle Databases. %prep %setup -q -n oracle %build ruby extconf.rb CFLAGS=${RPM_OPT_FLAGS} make %install rm -rf %buildroot libdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["libdir"]'` archdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["archdir"]'` make install libdir=$libdir archdir=$archdir install -d %buildroot%{_docdir}/%{name}-%{version} cp -a MANIFEST README *.def samples %buildroot%{_docdir}/%{name}-%{version} %clean rm -rf %buildroot %files %defattr(-,root,root) %{_libdir}/*/*/*.rb %{_libdir}/*/*/*/*.so %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/* %changelog * Thu Jun 07 2001 Squidster 0.6.4-1 - first release # end of file --------------B1D834A2FCB52CBC61E45E48 Content-Type: text/plain; charset=us-ascii; name="ruby-postgres.spec" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby-postgres.spec" %define name ruby-postgres %define version 0.6.4 %define release 1 Summary: Ruby extension library to access PostgreSQL Databases Name: %{name} Version: %{version} Release: %{release} Source0: http://www.jp.postgresql.org/interfaces/ruby/archive/ruby-postgres-0.6.4.tar.gz Copyright: GPL Group: Development/Other BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} Requires: ruby >= 1.6, postgresql >= 7.0 BuildRequires: ruby-devel, postgresql, postgresql-libs, postgresql-devel %description Ruby extension library to access PostgreSQL Databases. %prep %setup -q -n %{name}-%{version} %build ruby extconf.rb --with-pgsql-include-dir=/usr/include/pgsql CFLAGS=${RPM_OPT_FLAGS} make %install rm -rf %buildroot libdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["libdir"]'` archdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["archdir"]'` make install libdir=$libdir archdir=$archdir install -d %buildroot%{_docdir}/%{name}-%{version} cp -a ChangeLog MANIFEST README sample %buildroot%{_docdir}/%{name}-%{version} %clean rm -rf %buildroot %files %defattr(-,root,root) %{_libdir}/*/*/*/*.so %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/* %changelog * Thu Jun 07 2001 Squidster 0.6.4-1 - first release # end of file --------------B1D834A2FCB52CBC61E45E48 Content-Type: text/plain; charset=us-ascii; name="ruby-xml.spec" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby-xml.spec" %define name ruby-xml %define version 0.6.1 %define release 1 Summary: Ruby extension library for XML via Expat Name: %{name} Version: %{version} Release: %{release} Source0: http://www.yoshidam.net/xmlparser-0.6.1.tar.gz Copyright: GPL Group: Development/Other BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} Requires: ruby >= 1.6, expat >= 1.0 BuildRequires: ruby-devel, expat, expat-devel %description Ruby extension library for XML via Expat %prep %setup -q -n xmlparser %build ruby extconf.rb CFLAGS=${RPM_OPT_FLAGS} make %install rm -rf %buildroot libdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["libdir"]'` archdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["archdir"]'` make install libdir=$libdir archdir=$archdir install -d %buildroot%{_docdir}/%{name}-%{version} cp -a MANIFEST README Encodings samples %buildroot%{_docdir}/%{name}-%{version} %clean rm -rf %buildroot %files %defattr(-,root,root) %{_libdir}/*/*/*.rb %{_libdir}/*/*/*/*.so %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/* %changelog * Thu Jun 07 2001 Squidster 0.6.4-1 - first release # end of file --------------B1D834A2FCB52CBC61E45E48 Content-Type: text/plain; charset=us-ascii; name="ruby-gnome.spec" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ruby-gnome.spec" %define name ruby-gnome %define version 0.25 %define release 1 Summary: Ruby extension library to use Gnome/Gtk+. Name: %{name} Version: %{version} Release: %{release} Source0: http://www.ruby-lang.org/gtk/download/gnome-ruby-0.25.tar.bz2 Copyright: GPL Group: Development/Other BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} Requires: ruby >= 1.6, gtk+ >= 1.2.8 BuildRequires: ruby-devel, gtk+-devel XFree86-devel imlib-devel gnome-libs-devel gdk-pixbuf-devel %description Ruby extension library to use Gnome/Gtk+. %prep %setup -q -n gnome-ruby-0.25 %build ruby extconf.rb CFLAGS=${RPM_OPT_FLAGS} make %install rm -rf %buildroot libdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["libdir"]'` archdir=%buildroot`ruby -e 'require "mkmf" ; print Config::CONFIG["archdir"]'` make install libdir=$libdir archdir=$archdir install -d %buildroot%{_docdir}/%{name}-%{version} install -d %buildroot%{_docdir}/%{name}-%{version}/gdkimlib install -d %buildroot%{_docdir}/%{name}-%{version}/gdkpixbuf install -d %buildroot%{_docdir}/%{name}-%{version}/gnome install -d %buildroot%{_docdir}/%{name}-%{version}/gtk cp -a ChangeLog MANIFEST %buildroot%{_docdir}/%{name}-%{version} cp -a gdkimlib/ChangeLog gdkimlib/MANIFEST gdkimlib/sample %buildroot%{_docdir}/%{name}-%{version}/gdkimlib cp -a gdkpixbuf/ChangeLog gdkpixbuf/MANIFEST gdkpixbuf/README gdkpixbuf/sample %buildroot%{_docdir}/%{name}-%{version}/gdkpixbuf cp -a gnome/ChangeLog gnome/MANIFEST gnome/README gnome/doc gnome/sample %buildroot%{_docdir}/%{name}-%{version}/gnome cp -a gtk/BUGS gtk/ENVIRONMENT gtk/README gtk/ToDo gtk/doc gtk/sample %buildroot%{_docdir}/%{name}-%{version}/gtk %clean rm -rf %buildroot %files %defattr(-,root,root) %{_libdir}/*/*/*.rb %{_libdir}/*/*/*/*.so %dir %{_docdir}/%{name}-%{version} %{_docdir}/%{name}-%{version}/* %changelog * Thu May 24 2001 Michal Rokos 0.25-1mdk - new version * Sat Apr 21 2001 Michal Rokos 0.24-1mdk - official gnome-ruby-0.24 - added more examples * Mon Feb 12 2001 Guillaume Cottenceau 0.23-5mdk - use snapshot, to work with Ruby 1.6 - experimental support for Gnome, GdkImlib, GdkPixbuf * Mon Aug 07 2000 Frederic Lepied 0.23-4mdk - automatically added BuildRequires * Wed Jul 19 2000 Pixel 0.23-3mdk - BM + macros * Sat Mar 25 2000 Pixel 0.23-2mdk - new group + cleanup * Mon Feb 14 2000 Pixel 0.23-1mdk - first release # end of file --------------B1D834A2FCB52CBC61E45E48--