]> andersk Git - gssapi-openssh.git/blob - setup/make_gpt_dist
The man2html from jbasney on pkilab2 works whereas the standard one doesn't.
[gssapi-openssh.git] / setup / make_gpt_dist
1 #!/usr/bin/env perl
2 #
3 # make_gpt_dist - adapted from GPT's make_gpt_dist script
4 #
5 # Create a GPT source package after deriving the necessary build files.
6 #
7
8 #
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).
12 #
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'.
16 #
17
18 $srcdirname = "gsi_openssh_setup-4.7-src";
19 $srcpkgname = $srcdirname;
20
21 #
22 # uncomment when we've got a better place to get the current version from
23 #
24 # determine gpt version number
25 #
26 #open (CFG, 'packaging_tools/configure.in');
27 #
28 #my $version;
29 #for (<CFG>) {
30 #  if (m!AM_INIT_AUTOMAKE\(\w+,([^,\)]+)!) {
31 #    $version = $1;
32 #    $version =~ s!\s+!!g;
33 #  }
34 #}
35
36 #
37 # test to make sure we're okay to
38 #   o create/use the $srcdirname directories
39 #   o create the source package
40 #
41
42 if ( (!defined($srcdirname)) || length($srcdirname) le 0 )
43 {
44     printf("\$srcdirname must be defined to a usable value!\n");
45     die;
46 }
47
48 if ( (!defined($srcpkgname)) || length($srcpkgname) le 0 )
49 {
50     printf("\$srcpkgname must be defined to a usable value!\n");
51     die;
52 }
53
54 if ( -e "../$srcdirname" )
55 {
56     printf("found existing '../$srcdirname'... please remove before continuing\n");
57     die;
58 }
59
60 if ( -e "./$srcdirname" )
61 {
62     printf("found existing './$srcdirname'... please remove before continuing\n");
63     die;
64 }
65
66 if ( -e "./$srcpkgname.tar" )
67 {
68     printf("found existing './$srcpkgname.tar'... please remove before continuing\n");
69     die;
70 }
71
72 if ( -e "./$srcpkgname.tar.gz" )
73 {
74     printf("found existing './$srcpkgname.tar.gz'... please remove before continuing\n");
75     die;
76 }
77
78 #
79 # prep the source directory by creating a temp directory containing all of the
80 # required files.
81 #
82
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 ./: $?";
87
88 chdir("./$srcdirname");
89
90 #
91 # remove any 'unnecessary' files from the source directory.
92 #
93
94 printf("pruning source directory of extraneous files...\n");
95
96 system("rm -rf `find . -name CVS -print`")==0 or die "Unable to remove cvs directories: $?";
97 system("rm -f ./todo")==0 or die "Unable to remove todo file: $?";
98
99 #
100 # #
101 # # run the standard development tools to get the necessary derived files.
102 # #
103
104 # printf("running autoheader...\n");
105 # system("autoheader")==0 or die "Could not run autoheader: $?";
106
107 # printf("running autoconf...\n");
108 # system("autoconf")==0 or die "Could not run autoheader: $?";
109 #
110
111 chdir("../");
112
113 #
114 # create the source package from the source directory.
115 #
116
117 printf("creating source tarball '$srcpkgname.tar.gz'...\n");
118 system("tar -cf ./$srcpkgname.tar ./$srcdirname")==0 or die "Unable to create $srcpkgname.tar: $?";
119 system("gzip -f ./$srcpkgname.tar")==0 or die "Unable to gzip $srcpkgname.tar: $?";
120
121 printf("cleaning up after myself...\n");
122 system("rm -rf ./$srcdirname")==0 or die "Unable to remove ./$srcdirname: $?";
123
124 #
125 # done.
126 #
127
128 printf("done.\n");
This page took 0.069938 seconds and 5 git commands to generate.