3 # make_gpt_dist - adapted from GPT's make_gpt_dist script
5 # Create a GPT source package after deriving the necessary build files.
9 # You can define the source directory and package names to suit your needs. It's
10 # important to remember that GPT needs the source package name to be similar to
11 # the name of the package as defined in the package metadata (pkg_data_src.gpt).
13 # Failing to do this correctly will not affect bundle-creation, but will affect
14 # globus-build's ability to select and untar the correct package corresponding
15 # to the name gpt-bundle gives in its 'packaging_list'.
18 $srcdirname = "gsi_openssh-3.1-src";
19 $srcpkgname = "gsi_openssh-3.1-src";
22 # uncomment when we've got a better place to get the current version from
24 # determine gpt version number
26 #open (CFG, 'packaging_tools/configure.in');
30 # if (m!AM_INIT_AUTOMAKE\(\w+,([^,\)]+)!) {
32 # $version =~ s!\s+!!g;
37 # test to make sure we're okay to
38 # o create/use the $srcdirname directories
39 # o create the source package
42 if ( (!defined($srcdirname)) || length($srcdirname) le 0 )
44 printf("\$srcdirname must be defined to a usable value!\n");
48 if ( (!defined($srcpkgname)) || length($srcpkgname) le 0 )
50 printf("\$srcpkgname must be defined to a usable value!\n");
54 if ( -e "../$srcdirname" )
56 printf("found existing '../$srcdirname'... please remove before continuing\n");
60 if ( -e "./$srcdirname" )
62 printf("found existing './$srcdirname'... please remove before continuing\n");
66 if ( -e "./$srcpkgname.tar" )
68 printf("found existing './$srcpkgname.tar'... please remove before continuing\n");
72 if ( -e "./$srcpkgname.tar.gz" )
74 printf("found existing './$srcpkgname.tar.gz'... please remove before continuing\n");
79 # prep the source directory by creating a temp directory containing all of the
83 printf("copying files into source directory...\n");
84 system("mkdir ../$srcdirname")==0 or die "Unable to create ../$srcdirname: $?";
85 system("cp -rf * ../$srcdirname")==0 or die "Unable to copy . into ../$srcdirname: $?";
86 system("mv ../$srcdirname ./$srcdirname")==0 or die "Unable to move $srcdirname from ../ to ./: $?";
88 chdir("./$srcdirname");
91 # remove any 'unnecessary' files from the source directory.
94 printf("pruning source directory of extraneous files...\n");
95 system("rm -rf `find . -name CVS -print`")==0 or die "Unable to remove cvs directories: $?";
98 # Originally, we were going to include the MD5 sums in the Announcement
99 # file. Among other virtues, this complicated the process of distributing
100 # the Announcement to users since it would get included in the package
101 # itself. We decided to keep the announcement in the package, and got
102 # around the Catch-22 by not including MD5 sums in that file.
104 # So, keep this line commented!:
105 # system("rm -f Announcement.txt")==0 or die "Unable to remove Announcement.txt: $?";
109 # run the standard development tools to get the necessary derived files.
112 printf("running make distprep...\n");
113 system("make -f Makefile.in distprep")==0 or die "Could not run make distprep: $?";
118 # create the source package from the source directory.
121 printf("creating source tarball '$srcpkgname.tar.gz'...\n");
122 system("tar -cf ./$srcpkgname.tar ./$srcdirname")==0 or die "Unable to create $srcpkgname.tar: $?";
123 system("gzip -f ./$srcpkgname.tar")==0 or die "Unable to gzip $srcpkgname.tar: $?";
125 printf("cleaning up after myself...\n");
126 system("rm -rf ./$srcdirname")==0 or die "Unable to remove ./$srcdirname: $?";