%{?!ruby_sitelib:%define ruby_sitelib %(ruby -r rbconfig -le 'print ::Config::CONFIG["sitelibdir"]')} %{?!ruby_sitearch:%define ruby_sitearch %(ruby -r rbconfig -le 'print ::Config::CONFIG["sitearchdir"]')} %define lzo_major %(rpm -q --qf '%{VERSION}' lzo |cut -d. -f1) Name: qdbm Version: 1.8.75 Release: 1.n0i.4%{?dist} Summary: Quick Database Manager Group: System Environment/Libraries License: LGPL URL: http://qdbm.sourceforge.net/ Source0: http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pkgconfig zlib-devel bzip2-devel glibc-devel lzo-devel ruby-devel %description QDBM is an embeded database library compatible with GDBM and NDBM. It features hash database and B+ tree database and is developed referring to GDBM for the purpose of the following three points: higher processing speed, smaller size of a database file, and simpler API. This package includes APIs for C, C++, and Java. CGI scripts are also contained. APIs for Perl and Ruby should be installed with a source package. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package perl Summary: Perl interface for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description perl The %{name}-perl package contains modules for developing Perl applications that use %{name}. %package ruby Summary: Ruby interface for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: ruby %description ruby The %{name}-ruby package contains modules for developing Ruby applications that use %{name}. %prep %setup -q %if %lzo_major == 1 %{__sed} -i 's@lzo/@@' myconf.c %{__sed} -i 's@lzo2@lzo@g' configure */configure %endif %build export CFLAGS="$RPM_OPT_FLAGS -fPIC -I$(pwd)" for dir in . perl ruby ; do pushd $dir %configure --disable-static \ --enable-pthread \ --enable-zlib \ --enable-lzo \ --enable-bzip \ --enable-iconv LDENV='' %{__make} %{?_smp_mflags} -e popd done %install %{__rm} -rf $RPM_BUILD_ROOT %{__make} install DESTDIR=$RPM_BUILD_ROOT pushd perl %{__make} install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor popd # clean up perl installation find $RPM_BUILD_ROOT \( -name .packlist -o -name perllocal.pod \) -delete || : find $RPM_BUILD_ROOT -type f -name '*.bs' -a -empty -delete || : find $RPM_BUILD_ROOT -depth -type d -a -empty -delete || : find $RPM_BUILD_ROOT -name '*.so' -exec %{__chmod} 0755 {} \; pushd ruby %{__make} install DESTDIR=$RPM_BUILD_ROOT popd # drop docs (goto %doc) %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/qdbm %clean %{__rm} -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc COPYING ChangeLog NEWS README THANKS %doc spex.html %{_libdir}/*.so.* %{_bindir}/* %{_mandir}/man1/* %files devel %defattr(-,root,root,-) %{_includedir}/* %{_libdir}/*.a %{_libdir}/*.so %{_libdir}/pkgconfig/qdbm.pc %{_mandir}/man3/* %files perl %defattr(-,root,root,-) %doc perl/plspex.html perl/plapidoc %{perl_vendorarch}/* %exclude %dir %{perl_vendorarch}/auto %files ruby %defattr(-,root,root,-) %doc ruby/rbspex.html ruby/rbapidoc/ %{ruby_sitelib}/* %exclude %dir %{ruby_sitearch} %changelog * Sun Apr 22 2007 Marius FERARU - 1.8.75-1.n0i.4 - version 1.8.75 * Mon Aug 21 2006 Marius FERARU - 1.8.69-1.n0i.3 - version 1.8.69 - using "clean" lzo2 (but keep backward compatibility somehow) * Tue Jul 18 2006 Marius FERARU - 1.8.61-1.n0i.2 - version 1.8.61 * Sat Jul 01 2006 Marius FERARU - 1.8.60-1.n0i.1 - initial Fedora packaging