Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 81324 invoked from network); 22 Jun 2005 19:41:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jun 2005 19:41:09 -0000 Received: (qmail 7493 invoked by uid 500); 22 Jun 2005 19:41:01 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 7379 invoked by uid 500); 22 Jun 2005 19:41:00 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 7286 invoked by uid 99); 22 Jun 2005 19:41:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2005 12:41:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of gozer@ectoplasm.org designates 66.34.202.202 as permitted sender) Received: from [66.34.202.202] (HELO minerva.ectoplasm.org) (66.34.202.202) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2005 12:41:00 -0700 Received: from minerva.ectoplasm.org (localhost.localdomain [127.0.0.1]) by pmx.secure.ectoplasm.org (Postfix) with SMTP id 0C7D35F50E for ; Wed, 22 Jun 2005 12:40:58 -0700 (PDT) Received: from [192.168.10.200] (unknown [192.168.10.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by minerva.ectoplasm.org (Postfix) with ESMTP id AAFEF5EB34 for ; Wed, 22 Jun 2005 12:40:57 -0700 (PDT) Message-ID: <42B9BEC0.5020806@ectoplasm.org> Date: Wed, 22 Jun 2005 12:40:48 -0700 From: "Philippe M. Chiasson" User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@perl.apache.org Subject: [mp2 patch] RPM friendly build X-Enigmail-Version: 0.91.0.0 Content-Type: multipart/signed; micalg=pgp-ripemd160; protocol="application/pgp-signature"; boundary="------------enigA5D5AA86DAF4A60F3A313F56" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------enigA5D5AA86DAF4A60F3A313F56 Content-Type: multipart/mixed; boundary="------------040104080106080604020009" This is a multi-part message in MIME format. --------------040104080106080604020009 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Here is a suggested patch to add rpm building bits to our build process. Basically, this patch achieves 2 things. 1. It makes sure that distribution tarballs contains a mod_perl.spec file so anybody can just do: $> wget http://perl.apache.org/dist/mod_perl.2.x.tar.gz $> rpmbuild -ta mod_perl.2.x.tar.gz And they'll have nice RPMs for whatever RPM-based distro they run 2. It adds the 'rpm' make target, so that developers can quickly publish RPMs if they want (basically does make dist && rpmbuild -ta like above) : $> perl Makefile.PL [...] $> make rpm perl build/make_rpm_spec perl -Ilib "-MModPerl::Manifest=mkmanifest" -e mkmanifest [...] rm -rf mod_perl-2.0.2-dev gzip -9f mod_perl-2.0.2-dev.tar rpmbuild -ta [...] mod_perl-2.0.2-dev.tar.gz [...] $> ls rpm/ mod_perl-2.0.2-192962.i386.rpm mod_perl-2.0.2-192962.src.rpm mod_perl-debuginfo-2.0.2-192962.i386.rpm mod_perl-devel-2.0.2-192962.i386.rpm The bulk of the RPM spec file was grabbed from Fedora's -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 --------------040104080106080604020009 Content-Type: text/x-patch; name="rpm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rpm.patch" Property changes on: . ___________________________________________________________________ Name: svn:ignore - WrapXS Makefile Makefile.old blib blibdirs blibdirs.ts pm_to_blib pm_to_blib.ts scraps diff.txt smoke-report-*.txt MANIFEST glue_pods .mypacklist + WrapXS Makefile Makefile.old blib blibdirs blibdirs.ts mod_perl.spec pm_to_blib pm_to_blib.ts rpm scraps diff.txt smoke-report-*.txt MANIFEST glue_pods .mypacklist Index: Makefile.PL =================================================================== --- Makefile.PL (revision 192962) +++ Makefile.PL (working copy) @@ -789,8 +789,19 @@ my $string = $self->ModPerl::BuildMM::MY::postamble; $string .= <<'EOF'; -mydist : Apache-Test/META.yml manifest tardist +mydist : Apache-Test/META.yml mod_perl.spec manifest tardist +rpm: dist + @[ -d $(PWD)/rpm ] || mkdir $(PWD)/rpm + rpmbuild -ta --define "_rpmdir $(PWD)/rpm" \ + --define "_srcrpmdir $(PWD)/rpm" \ + $(DISTVNAME).tar.gz + @mv $(PWD)/rpm/*/*.rpm $(PWD)/rpm/ + @rm -rf $(PWD)/rpm/*/ + +mod_perl.spec: build/make_rpm_spec + $(PERL) build/make_rpm_spec + Apache-Test/META.yml: cd Apache-Test && make metafile Index: build/make_rpm_spec =================================================================== --- build/make_rpm_spec (revision 0) +++ build/make_rpm_spec (revision 0) @@ -0,0 +1,146 @@ +#!perl +use strict; + +require "lib/mod_perl2.pm"; + +my $dev_build = is_dev_build(); +my $release = $dev_build ? svn_release() : 1; +my $version = $mod_perl2::VERSION_TRIPLET; +my $path = $dev_build ? "mod_perl-$version-dev" : "mod_perl-$version"; +my $tarname = "$path.tar.gz"; + +my $httpd_ver = min_httpd_ver(); + +open(my $spec, ">mod_perl.spec") || die "Can't open mod_perl.spec $!"; + +print $spec <<"EOF"; +%define _version $mod_perl2::VERSION_TRIPLET +%define _release $release +%define _source http://perl.apache.org/dist/$tarname +%define _dirname $path +%define _httpd_min_ver $httpd_ver +%define _perl_min_ver 5.6.1 +EOF + +print $spec <<'EOF'; +Name: mod_perl +Version: %{_version} +Release: %{_release} +Summary: An embedded Perl interpreter for the Apache Web server +Group: System Environment/Daemons +License: Apache License, Version 2.0 +Packager: Philippe M. Chiasson +URL: http://perl.apache.org/ +Source: %{_source} +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires: httpd >= %{_httpd_min_ver} +BuildRequires: perl >= %{_perl_min_ver} +BuildRequires: httpd-devel >= %{_httpd_min_ver} +BuildRequires: apr-devel, apr-util-devel + +%description +Mod_perl incorporates a Perl interpreter into the Apache web server, +so that the Apache web server can directly execute Perl code. +Mod_perl links the Perl runtime library into the Apache web server and +provides an object-oriented Perl interface for Apache's C language +API. The end result is a quicker CGI script turnaround process, since +no external Perl interpreter has to be started. + +Install mod_perl if you're installing the Apache web server and you'd +like for it to directly incorporate a Perl interpreter. + +%package devel +Summary: Files needed for building XS modules that use mod_perl +Group: Development/Libraries +Requires: mod_perl = %{version}-%{release}, httpd-devel + +%description devel +The mod_perl-devel package contains the files needed for building XS +modules that use mod_perl. + +%prep +%setup -q -n %{_dirname} + +%build +CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL /dev/null ';' + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc Changes LICENSE README* STATUS SVN-MOVE docs/ +%{_bindir}/* +%{_libdir}/httpd/modules/mod_perl.so +%{perl_vendorarch}/auto/* +%{perl_vendorarch}/Apache/ +%{perl_vendorarch}/Apache2/ +%{perl_vendorarch}/Bundle/ +%{perl_vendorarch}/APR/ +%{perl_vendorarch}/ModPerl/ +%{perl_vendorarch}/*.pm +%{_mandir}/man?/* + +%files devel +%defattr(-,root,root,-) +%{_includedir}/httpd/* + +%changelog +EOF + +sub min_httpd_ver { + my $min_httpd_ver; + open my $mk, 'Makefile.PL'; + while (<$mk>) { + if (/MIN_HTTPD_VERSION_DYNAMIC\s*=>\s*'(.*)'/) { + $min_httpd_ver = $1; + last; + } + } + close $mk; + $min_httpd_ver; +} + +sub svn_release { + open my $svn, "<.svn/entries"; + my $revision; + while (<$svn>) { + if (/revision="(\d+)"/) { + $revision = $1; + last; + } + } + close $svn; + $revision; +} + +sub is_dev_build { + my $dev; + open my $fh, 'Changes'; + while (<$fh>) { + if (/^=item.*-dev/) { + $dev = 1; + last; + } + last if /^=item/; + } + close $fh; + $dev; +} Property changes on: build/make_rpm_spec ___________________________________________________________________ Name: svn:executable + * Index: lib/ModPerl/Manifest.pm =================================================================== --- lib/ModPerl/Manifest.pm (revision 192962) +++ lib/ModPerl/Manifest.pm (working copy) @@ -31,6 +31,7 @@ #anything else to be added should go here: my @add_files = qw{ MANIFEST + mod_perl.spec Apache-Test/META.yml }; --------------040104080106080604020009-- --------------enigA5D5AA86DAF4A60F3A313F56 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFCub7GyzKhB4jDpaURAxE2AKCaeCqEa3e8i21hY/Tw8f+tgOX+OgCeKcMj YcZNPrKIRgOd42Xe9dnFnkk= =oCfw -----END PGP SIGNATURE----- --------------enigA5D5AA86DAF4A60F3A313F56--