]> andersk Git - gssapi-openssh.git/blobdiff - openssh/make_gpt_dist
o Add comment blurb about Announcement.txt to make_gpt_dist.
[gssapi-openssh.git] / openssh / make_gpt_dist
index c65725951ba5eb40749792c3289cef702661828f..4a661854735d4bd4ed4853420ff5bda78afee530 100755 (executable)
@@ -1,39 +1,28 @@
 #!/usr/bin/env perl
+#
+# make_gpt_dist - adapted from GPT's make_gpt_dist script
+#
+# Create a GPT source package after deriving the necessary build files.
+#
 
-#GPT_LOCATION and/or GLOBUS_LOCATION must be specified for most scripts
-#in the globus packages.  for this reason, this script tests to see if
-#one of the two locations is defined.
-
-my $gpath=$ENV{GPT_LOCATION};
-
-if(!defined($gpath))
-{
-  $gpath=$ENV{GLOBUS_LOCATION};
-}
-
-if(!defined($gpath))
-{
-  die "GPT_LOCATION or GLOBUS_LOCATION needs to be set before running this script";
-}
+#
+# You can define the source directory and package names to suit your needs.  It's
+# important to remember that GPT needs the source package name to be similar to
+# the name of the package as defined in the package metadata (pkg_data_src.gpt).
+#
+# Failing to do this correctly will not affect bundle-creation, but will affect
+# globus-build's ability to select and untar the correct package corresponding
+# to the name gpt-bundle gives in its 'packaging_list'.
+#
 
-#uncomment when we're more mature
-#for my $subdir ('packaging_tools', 'package_management', 'archive_compress') {
-#  chdir "$subdir" or die "Unable to cd to $subdir: $?";
-#  if(-e "config.cache")
-#    {
-#      #config.cache is tested for because it is generated when ./configure is executed
-#      #if config.cache is present, then a make distclean must be performed in order
-#      #to remove the cache.  if a make distclean is run and config.cache is not 
-#      #present, then this script will recieve a zero from the system and error.
-#      
-#      system("make distclean");
-#    }
-#
-#  chdir ".."  or die "Unable to cd to packaging: $?";
-#}
+$srcdirname = "gsi_openssh-3.0-src";
+$srcpkgname = "gsi_openssh-3.0-src";
 
+#
+# uncomment when we've got a better place to get the current version from
+#
 # determine gpt version number
-#uncomment when we've got a better place to get the current version from
+#
 #open (CFG, 'packaging_tools/configure.in');
 #
 #my $version;
@@ -44,23 +33,100 @@ if(!defined($gpath))
 #  }
 #}
 
-#uncomment when we've got a better directory layout
-printf("running autoheader...\n");
-system("autoheader")==0 or die "Could not run autoheader: $?";
+#
+# test to make sure we're okay to
+#   o create/use the $srcdirname directories
+#   o create the source package
+#
+
+if ( (!defined($srcdirname)) || length($srcdirname) le 0 )
+{
+    printf("\$srcdirname must be defined to a usable value!\n");
+    die;
+}
+
+if ( (!defined($srcpkgname)) || length($srcpkgname) le 0 )
+{
+    printf("\$srcpkgname must be defined to a usable value!\n");
+    die;
+}
+
+if ( -e "../$srcdirname" )
+{
+    printf("found existing '../$srcdirname'... please remove before continuing\n");
+    die;
+}
+
+if ( -e "./$srcdirname" )
+{
+    printf("found existing './$srcdirname'... please remove before continuing\n");
+    die;
+}
+
+if ( -e "./$srcpkgname.tar" )
+{
+    printf("found existing './$srcpkgname.tar'... please remove before continuing\n");
+    die;
+}
+
+if ( -e "./$srcpkgname.tar.gz" )
+{
+    printf("found existing './$srcpkgname.tar.gz'... please remove before continuing\n");
+    die;
+}
+
+#
+# prep the source directory by creating a temp directory containing all of the
+# required files.
+#
+
+printf("copying files into source directory...\n");
+system("mkdir ../$srcdirname")==0 or die "Unable to create ../$srcdirname: $?";
+system("cp -rf * ../$srcdirname")==0 or die "Unable to copy . into ../$srcdirname: $?";
+system("mv ../$srcdirname ./$srcdirname")==0 or die "Unable to move $srcdirname from ../ to ./: $?";
+
+chdir("./$srcdirname");
+
+#
+# remove any 'unnecessary' files from the source directory.
+#
+
+printf("pruning source directory of extraneous files...\n");
+system("rm -rf `find . -name CVS -print`")==0 or die "Unable to remove cvs directories: $?";
+
+#
+# Originally, we were going to include the MD5 sums in the Announcement 
+# file.  Among other virtues, this complicated the process of distributing 
+# the Announcement to users since it would get included in the package 
+# itself.  We decided to keep the announcement in the package, and got 
+# around the Catch-22 by not including MD5 sums in that file.
+#
+# So, keep this line commented!:
+# system("rm -f Announcement.txt")==0 or die "Unable to remove Announcement.txt: $?";
+#
+
+#
+# run the standard development tools to get the necessary derived files.
+#
 
-printf("running autoconf...\n");
-system("autoconf")==0 or die "Could not run autoheader: $?";
+printf("running make distprep...\n");
+system("make -f Makefile.in distprep")==0 or die "Could not run make distprep: $?";
 
-printf("moving files into source directory...\n");
-system("mkdir ../gpt-gsi-openssh")==0 or die "Unable to create gpt_bundle.tar: $?";
-system("cp -rf * ../gpt-gsi-openssh")==0 or die "Unable to create gpt_bundle.tar: $?";
-system("mv ../gpt-gsi-openssh ./gpt-gsi-openssh")==0 or die "Unable to move directory: $?";
+chdir("../");
 
-#system("tar -cf gpt-$version.tar gpt-$version")==0 or die "Unable to create gpt_bundle.tar: $?";
-#system("gzip -f gpt-$version.tar")==0 or die "Unable to gzip gpt_bundle.tar: $?";
-#system("rm -rf gpt-$version")==0 or die "Unable to create gpt_bundle.tar: $?";
+#
+# create the source package from the source directory.
+#
+
+printf("creating source tarball '$srcpkgname.tar.gz'...\n");
+system("tar -cf ./$srcpkgname.tar ./$srcdirname")==0 or die "Unable to create $srcpkgname.tar: $?";
+system("gzip -f ./$srcpkgname.tar")==0 or die "Unable to gzip $srcpkgname.tar: $?";
+
+printf("cleaning up after myself...\n");
+system("rm -rf ./$srcdirname")==0 or die "Unable to remove ./$srcdirname: $?";
+
+#
+# done.
+#
 
-printf("creating source tarball... gsi-openssh.\n");
-system("tar -cf gsi-openssh.tar ./gpt-gsi-openssh")==0 or die "Unable to create gpt_bundle.tar: $?";
-system("gzip -f gsi-openssh.tar")==0 or die "Unable to gzip gpt_bundle.tar: $?";
-system("rm -rf ./gpt-gsi-openssh")==0 or die "Unable to create gpt_bundle.tar: $?";
+printf("done.\n");
This page took 0.044362 seconds and 4 git commands to generate.