]> andersk Git - gssapi-openssh.git/blame - openssh/make_gpt_dist
#include "pathnames.h" for declaration of init_pathmames()
[gssapi-openssh.git] / openssh / make_gpt_dist
CommitLineData
828950b9 1#!/usr/bin/env perl
d9b15fdd 2#
86a5a1db 3# make_gpt_dist - adapted from GPT's make_gpt_dist script
4#
0cb125e6 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'.
d9b15fdd 16#
17
b42503b3 18$srcdirname = "gsi_openssh-1.8-src";
19$srcpkgname = "gsi_openssh-1.8-src";
828950b9 20
87352be3 21#
22# uncomment when we've got a better place to get the current version from
23#
828950b9 24# determine gpt version number
87352be3 25#
828950b9 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
87352be3 36#
6c5269cc 37# test to make sure we're okay to
64ac5841 38# o create/use the $srcdirname directories
6c5269cc 39# o create the source package
87352be3 40#
03f2799b 41
64ac5841 42if ( (!defined($srcdirname)) || length($srcdirname) le 0 )
87352be3 43{
64ac5841 44 printf("\$srcdirname must be defined to a usable value!\n");
87352be3 45 die;
46}
03f2799b 47
64ac5841 48if ( (!defined($srcpkgname)) || length($srcpkgname) le 0 )
61ccb2b4 49{
64ac5841 50 printf("\$srcpkgname must be defined to a usable value!\n");
61ccb2b4 51 die;
52}
53
64ac5841 54if ( -e "../$srcdirname" )
87352be3 55{
64ac5841 56 printf("found existing '../$srcdirname'... please remove before continuing\n");
87352be3 57 die;
58}
7a19f317 59
64ac5841 60if ( -e "./$srcdirname" )
87352be3 61{
64ac5841 62 printf("found existing './$srcdirname'... please remove before continuing\n");
6c5269cc 63 die;
64}
65
64ac5841 66if ( -e "./$srcpkgname.tar" )
6c5269cc 67{
64ac5841 68 printf("found existing './$srcpkgname.tar'... please remove before continuing\n");
6c5269cc 69 die;
70}
71
64ac5841 72if ( -e "./$srcpkgname.tar.gz" )
6c5269cc 73{
64ac5841 74 printf("found existing './$srcpkgname.tar.gz'... please remove before continuing\n");
87352be3 75 die;
76}
7a19f317 77
87352be3 78#
79# prep the source directory by creating a temp directory containing all of the
80# required files.
81#
82
83printf("copying files into source directory...\n");
64ac5841 84system("mkdir ../$srcdirname")==0 or die "Unable to create ../$srcdirname: $?";
85system("cp -rf * ../$srcdirname")==0 or die "Unable to copy . into ../$srcdirname: $?";
86system("mv ../$srcdirname ./$srcdirname")==0 or die "Unable to move $srcdirname from ../ to ./: $?";
87352be3 87
64ac5841 88chdir("./$srcdirname");
87352be3 89
90#
91# remove any 'unnecessary' files from the source directory.
92#
828950b9 93
03f2799b 94printf("pruning source directory of extraneous files...\n");
95system("rm -rf `find . -name CVS -print`")==0 or die "Unable to remove cvs directories: $?";
03f2799b 96system("rm -rf ./gpt")==0 or die "Unable to remove gpt directory: $?";
97
87352be3 98#
99# run the standard development tools to get the necessary derived files.
100#
101
102printf("running autoheader...\n");
103system("autoheader")==0 or die "Could not run autoheader: $?";
104
105printf("running autoconf...\n");
106system("autoconf")==0 or die "Could not run autoheader: $?";
107
03f2799b 108chdir("../");
109
87352be3 110#
111# create the source package from the source directory.
112#
113
64ac5841 114printf("creating source tarball '$srcpkgname.tar.gz'...\n");
115system("tar -cf ./$srcpkgname.tar ./$srcdirname")==0 or die "Unable to create $srcpkgname.tar: $?";
116system("gzip -f ./$srcpkgname.tar")==0 or die "Unable to gzip $srcpkgname.tar: $?";
87352be3 117
118printf("cleaning up after myself...\n");
64ac5841 119system("rm -rf ./$srcdirname")==0 or die "Unable to remove ./$srcdirname: $?";
87352be3 120
121#
122# done.
123#
124
125printf("done.\n");
This page took 0.072621 seconds and 5 git commands to generate.