build-pspp: Update for spread-sheet-widget 0.3.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 27 Jun 2020 17:33:35 +0000 (17:33 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 27 Jun 2020 17:33:35 +0000 (17:33 +0000)
build-pspp

index 16c19cf0e8c781910c9724fcf83b164fee6c9903..cf8fb0f5bbad0577a6b7c7df5cc2275df1b7e999 100755 (executable)
@@ -125,11 +125,12 @@ sub ref_to_commit {
     return $commit;
 }
 
-my $ssw = "spread-sheet-widget-0.1";
+my $ssw = "spread-sheet-widget-0.3";
 if (@ARGV == 2) {
     my ($repo, $branch) = @ARGV;
 
     my $ssw_tar = "$topdir/$ssw.tar.gz";
+    #save_result ("spread-sheet-widget source", $ssw_tar);
     start_step ("Extract spread-sheet-widget");
     run ("tar xzf $ssw_tar");
 
@@ -318,9 +319,10 @@ if ($build_binary) {
     start_step ("Configuring");
     run ("chmod -R a-w $builddir/$tarball_dir");
     run ("chmod u+w $builddir/$tarball_dir");
+    run ("chmod -R u+w $builddir/$tarball_dir/perl-module");
     run ("mkdir $builddir/$tarball_dir/_build");
     run ("chmod a-w $builddir/$tarball_dir");
-    my $ok = try_run ("cd $builddir/$tarball_dir/_build && ../configure --enable-relocatable --prefix='' PKG_CONFIG_PATH=\$PWD/../../../source/$ssw/inst/lib/pkgconfig CPPFLAGS=\"-I\$PWD/../../../source/$ssw/inst/include\" LDFLAGS=\"-L\$PWD/../../../source/$ssw/inst/lib\"", "bin-configure");
+    my $ok = try_run ("cd $builddir/$tarball_dir/_build && ../configure --with-perl-module --enable-relocatable --prefix='' PKG_CONFIG_PATH=\$PWD/../../../source/$ssw/inst/lib/pkgconfig CPPFLAGS=\"-I\$PWD/../../../source/$ssw/inst/include\" LDFLAGS=\"-L\$PWD/../../../source/$ssw/inst/lib\"", "bin-configure");
     for my $basename ("config.h", "config.log") {
        save_result_if_exists ("build configuration",
                               "$builddir/$tarball_dir/_build/$basename");
@@ -329,10 +331,13 @@ if ($build_binary) {
 
     start_step ("Build");
     run ("cd $builddir/$tarball_dir/_build && make -j10", "build");
+    run ("cd $builddir/$tarball_dir/_build/perl-module && perl Makefile.PL && make -j10", "build Perl module");
 
     start_step ("Install");
     run ("cd $builddir/$tarball_dir/_build && make install DESTDIR=\$PWD/pspp-$binary_version", "install");
     run ("cd ../source/$ssw && make -j10 install DESTDIR=$builddir/$tarball_dir/_build/pspp-$binary_version");
+    run ("cd $builddir/$tarball_dir/_build/perl-module && make install DESTDIR=$builddir/$tarball_dir/_build/pspp-$binary_version", "install Perl module");
+    run ("cd $builddir/$tarball_dir/_build/perl-module && make install DESTDIR=\$PWD/inst");
 
     start_step ("Make binary distribution");
     run ("cd $builddir/$tarball_dir/_build && tar cfz pspp-$binary_version.tar.gz pspp-$binary_version");
@@ -350,6 +355,7 @@ if ($build_binary) {
     run ("cd $builddir/$tarball_dir/_build && make uninstall DESTDIR=\$PWD/pspp-$binary_version", "uninstall");
 
     start_step ("Check uninstall");
+    run ("(cd $builddir/$tarball_dir/_build/perl-module/inst && find -type f -print) | (cd $builddir/$tarball_dir/_build/pspp-$binary_version && xargs rm)", "uninstall Perl module");
     run ("cd $builddir/$tarball_dir/_build && make distuninstallcheck distuninstallcheck_dir=\$PWD/pspp-$binary_version", "distuninstallcheck");
 
     # distcleancheck