Review: perl-DBD-SQLite (was: Re: Looking for a sponsor)

Michael Schwendt bugs.michael at gmx.net
Tue Apr 5 22:29:47 UTC 2005


On Sun, 20 Mar 2005 13:28:45 -0800, Michael Peters wrote:

> I'm still looking for a sponsor.
> I think slimserver needs to go into livna - but there are some perl
> modules that it needs that will need to be available in extras.
> 
> At this point I've packaged three of them (only tested in fc4t1)

> In future I will also be needing perl-DBD-SQLite (I have a spec file
> for it but I have not tested the package with slimserver yet)

> I'm willing to maintain these perl modules so I can get slimserver
> into livna - so a sponsor would be appreciated. Feedback on the perl
> package spec files would also be appreciated.

I've had a look at your perl-DBD-SQLite package and found the following:

 * Try to stay very close to the Fedora spectemplate for Perl packages
   as found in the fedora-rpmdevtools package in /usr/share/fedora/.
   Basically it's the result of what we've come up at fedora.us during
   Perl package QA and always finding the same packaging problems in
   Perl packages. As attached patch demonstrates, you should be able
   to take over the template for your package and also avoid things like
   overriding RPM's internal dependency generator or compressing manual
   pages yourself. The spec template also ensures that installed files
   (in particular DSOs) are writable and can be stripped automatically.

 * Missing directories: avoid creating file lists for the %files section.
   Often you need extra "find" expressions for missing %dir entries.
   Instead, include files via %perl_vendorarch or %perl_vendorlib which
   are the arch-specific/arch-independent root directories for Perl
   modules. Missing directories can be created with insufficient file
   access permissions depending on umask.

 * Missing perl :MODULE_COMPAT dependency, because it installs into
   Perl vendor locations. Fedora spec template has an example.

 * Avoid appearance of buildroot paths in the %build section. Buildroot
   should never get the chance to make it into compiled files. Specify
   buildroot paths in the %install section only.

 * /usr = %_prefix

 * Package builds without $RPM_OPT_FLAGS and hence creates a useless
   debuginfo package. "make OPTIMIZEFLAGS=$RPM_OPT_FLAGS" from Fedora
   spectemplate fixes that, too.

 * Move "make test" into the %check spec file section, so it could be
   disabled at build-time. Example in patch below.

 * Avoid setting the "Packager" line in the spec file, since you don't
   want your name appear in broken binary packages built by somebody
   else. Define the packager in your rpmrc.

--- perl-DBD-SQLite.spec.old	2005-03-22 04:30:40.000000000 +0100
+++ perl-DBD-SQLite.spec	2005-04-06 00:15:01.000000000 +0200
@@ -1,19 +1,16 @@
-%define _use_internal_dependency_generator 0
-
 %define real_name DBD-SQLite
-%define name perl-%{real_name}
 
 Summary: Self Contained RDBMS in a DBI Driver
-Name: %{name}
+Name: perl-%{real_name}
 Version: 1.08
-Release: 0.0.yjl.0.testing.2
+Release: 1
 License: GPL or Artistic
 Group: System Environment/Libraries
-Source: ftp://ftp.cpan.org/pub/CPAN/modules/by-module/DBD/%{real_name}-%{version}.tar.gz
+Source0: ftp://ftp.cpan.org/pub/CPAN/modules/by-module/DBD/%{real_name}-%{version}.tar.gz
 Url: http://search.cpan.org/~msergeant/DBD-SQLite-%{version}/
-Packager: Michael A. Peters <mpeters at mac.com>
 BuildRoot: %{_tmppath}/%{name}-buildroot/
 BuildRequires: perl-DBI
+Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 
 %description
 SQLite is a public domain RDBMS database engine that you can find at
@@ -28,32 +25,28 @@
 %setup -q -n %{real_name}-%{version}
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor < /dev/null
-make
+CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor < /dev/null
+make %{?_smp_mflags} OPTIMIZE="$RPM_OPT_FLAGS"
+
+%check || :
 make test
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make install
-
-[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
-
-find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;
-
-find $RPM_BUILD_ROOT/usr -type f -print | 
-        sed "s@^$RPM_BUILD_ROOT@@g" | 
-        grep -v perllocal.pod | 
-        grep -v "\.packlist" > %{name}-%{version}-filelist
-if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then
-    echo "ERROR: EMPTY FILE LIST"
-    exit -1
-fi
+make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
+find $RPM_BUILD_ROOT -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
+find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';'
+chmod -R u+w $RPM_BUILD_ROOT/*
 
 %clean 
 rm -rf $RPM_BUILD_ROOT
 
-%files -f %{name}-%{version}-filelist
-
+%files
+%defattr(-,root,root,-)
+%{perl_vendorarch}/DBD/
+%{perl_vendorarch}/auto/DBD/
+%{_mandir}/man3/*
 
 %changelog
 * Sun Mar 13 2005 Michael A. Peters <mpeters at mac.com>




More information about the fedora-extras-list mailing list