summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST1
-rw-r--r--Makefile.PL33
-rw-r--r--perl-MDV-Distribconf.spec46
3 files changed, 75 insertions, 5 deletions
diff --git a/MANIFEST b/MANIFEST
index 69e879d..ccbebec 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4,6 +4,7 @@ lib/MDV/Distribconf.pm
Makefile.PL
MANIFEST
META.yml Module meta-data (added by MakeMaker)
+perl-MDV-Distribconf.spec
t/01distribconf.t
t/02distribconf.t
test/media/media_info/media.cfg
diff --git a/Makefile.PL b/Makefile.PL
index c065851..f4f95cd 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,18 +1,41 @@
# $Id$
-# use 5.008;
+use 5.008;
+use strict;
use ExtUtils::MakeMaker;
-use Getopt::Long;
+
+# where to find the rpm utility
+my $rpm_path = $ENV{RPM_PATH}; # this overrides
+unless (defined $rpm_path) {
+ for (qw(/bin/rpm /usr/bin/rpm)) {
+ if (-x) {
+ $rpm_path = $_;
+ last;
+ }
+ }
+}
+my $rpmtopdir = $rpm_path ? `$rpm_path --eval '%{_topdir}'` : '';
+chomp $rpmtopdir;
sub MY::postamble {
- <<MAKECHANGELOG;
-.PHONY: ChangeLog
+ <<MAKE;
+.PHONY: ChangeLog rpmdist srpm rpm
ChangeLog: ../common/username
cvs2cl -W 400 -I ChangeLog --accum -U ../common/username
rm -f *.bak
-MAKECHANGELOG
+rpmdist: dist
+ cp -f perl-MDV-Distribconf.spec $rpmtopdir/SPECS
+ bzme MDV-Distribconf-*.tar.gz
+ mv -f MDV-Distribconf-*.tar.bz2 $rpmtopdir/SOURCES
+
+srpm: rpmdist
+ rpmbuild -bs --clean --rmsource $rpmtopdir/SPECS/perl-MDV-Distribconf.spec
+
+rpm: rpmdist
+ rpmbuild -ba --clean --rmsource $rpmtopdir/SPECS/perl-MDV-Distribconf.spec
+MAKE
}
WriteMakefile(
diff --git a/perl-MDV-Distribconf.spec b/perl-MDV-Distribconf.spec
new file mode 100644
index 0000000..ce24475
--- /dev/null
+++ b/perl-MDV-Distribconf.spec
@@ -0,0 +1,46 @@
+%define dist MDV-Distribconf
+%define version 1.00
+%define release 1mdk
+
+Summary: Perl module to get config from a Mandriva Linux distribution tree
+Name: perl-%{dist}
+Version: %{version}
+Release: %{release}
+License: GPL
+Group: Development/Perl
+Source0: %{dist}-%{version}.tar.bz2
+Url: http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/soft/perl-%{dist}/
+BuildRoot: %{_tmppath}/%{name}-buildroot/
+BuildArch: noarch
+
+%description
+MDV::Distribconf is a module to get/write the configuration of a Mandriva Linux
+distribution tree.
+
+%prep
+%setup -q -n %{dist}-%{version}
+
+%build
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+%{__make}
+
+%check
+%{__make} test
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%makeinstall_std
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%doc ChangeLog
+%{_mandir}/*/*
+%{perl_vendorlib}/MDV/Distribconf
+%{perl_vendorlib}/MDV/Distribconf.pm
+
+%changelog
+* Fri Oct 28 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 1.00-1mdk
+- Initial MDV release