On Tue, 2018-05-15 at 16:32 +0100, Daniel P. Berrangé wrote:
The Module::Build system is nicer than ExtUtils::MakeMaker as it
allows
for better cross-platform portability by only relying on Perl, rather
than both Perl and system 'make' binary.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitignore | 17 +++----
Build.PL | 102 +++++++++++++++++++++++++++++++++++++
MANIFEST | 73 ++++++++++++++++++++++++++
MANIFEST.SKIP | 20 --------
META.yml.PL | 55 --------------------
Makefile.PL | 85 -------------------------------
autobuild.sh | 55 +++-----------------
Virt.xs => lib/Sys/Virt.xs | 0
perl-Sys-Virt.spec.PL | 45 ++++++++--------
t/030-api-coverage.t | 2 +-
10 files changed, 210 insertions(+), 244 deletions(-)
create mode 100755 Build.PL
create mode 100644 MANIFEST
delete mode 100644 MANIFEST.SKIP
delete mode 100644 META.yml.PL
delete mode 100644 Makefile.PL
rename Virt.xs => lib/Sys/Virt.xs (100%)
Disclaimer: I know nothing about Perl.
[...]
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..d425ef1
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,73 @@
+.gitignore
+.gitpublish
+AUTHORS
+Build.PL
+Changes
+HACKING
+INSTALL
+LICENSE
+README
+autobuild.sh
We renamed this script a week or so ago. Please make sure you
pull before hacking next time ;)
[...]
diff --git a/autobuild.sh b/autobuild.sh
index 9a6d102..597b9bf 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -7,53 +7,18 @@ NAME=Sys-Virt
set -e
-test -n "$1" && RESULTS=$1 || RESULTS=results.log
-: ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
+rm -rf blib _build Build $NAME-*.tar.gz
-make -k realclean ||:
-rm -rf MANIFEST blib pm_to_blib
+test -z "$AUTOBUILD_INSTALL_ROOT" &&
AUTOBUILD_INSTALL_ROOT=$HOME/builder
export TEST_MAINTAINER=1
-perl Makefile.PL PREFIX=$AUTOBUILD_INSTALL_ROOT
+perl Build.PL install_base=$AUTOBUILD_INSTALL_ROOT
-rm -f MANIFEST
-
-# Build the RPM.
-make
-make manifest
-
-if [ -z "$USE_COVER" ]; then
- perl -MDevel::Cover -e '' 1>/dev/null 2>&1 && USE_COVER=1 ||
USE_COVER=0
-fi
-
-if [ -z "$SKIP_TESTS" -o "$SKIP_TESTS" = "0" ]; then
- if [ "$USE_COVER" = "1" ]; then
- cover -delete
- export HARNESS_PERL_SWITCHES=-MDevel::Cover
- fi
-
- # set -o pipefail is a bashism; this use of exec is the POSIX alternative
- exec 3>&1
- st=$(
- exec 4>&1 >&3
- { make test 2>&1 3>&- 4>&-; echo $? >&4; } | tee
"$RESULTS"
- )
- exec 3>&-
- test "$st" = 0
-
- if [ "$USE_COVER" = "1" ]; then
- cover
- mkdir blib/coverage
- cp -a cover_db/*.html cover_db/*.css blib/coverage
- mv blib/coverage/coverage.html blib/coverage/index.html
- fi
-fi
-
-make install
-
-rm -f $NAME-*.tar.gz
-make dist
+./Build
+./Build test
+./Build install
+./Build dist
if [ -f /usr/bin/rpmbuild ]; then
if [ -n "$AUTOBUILD_COUNTER" ]; then
@@ -65,10 +30,4 @@ if [ -f /usr/bin/rpmbuild ]; then
rpmbuild --nodeps -ta --define "extra_release $EXTRA_RELEASE" --clean
$NAME-*.tar.gz
fi
-# Skip debian pkg for now
exit 0
-
-if [ -f /usr/bin/fakeroot ]; then
- fakeroot debian/rules clean
- fakeroot debian/rules DESTDIR=$HOME/packages/debian binary
-fi
This hunk doesn't apply at all now, of course...
Lastly, the RPM build fails with
RPM build errors:
Empty %files file
/home/test/libvirt-perl/rpmbuild/BUILD/Sys-Virt-v4.4.0/debugsourcefiles.list
on Fedora. It passes on CentOS 7, though.
--
Andrea Bolognani / Red Hat / Virtualization