Update file for automatically generating a release
[Samba.git] / packaging / SGI / spec.pl
blob93aa8632d98af905a03d17c02acddff089cd53b4
1 #!/usr/bin/perl
3 # This perl script generates the samba.spec file based on the version
4 # information in the version.h file in the source tree
6 open (VER,'../../source/version.h');
7 ($_ = <VER>) =~ s/"//g;
8 close (VER);
9 @foo = split(' ');
10 splice(@foo,0,2);
11 $_ = $foo[0];
13 # create the package name
14 $vername = " id \"Samba Version ".$_."\"\n";
16 #create the subsystem version numbers
17 if (/alpha/) {
18 $_ =~ s/alpha/.00./;
20 elsif (/p/) {
21 $_ =~ s/p/./;
22 $_ .= '.00';
24 ($v1,$v2,$v3,$v4,$v5) = split('\.');
25 $vernum = sprintf " version %02d%02d%02d%02d%02d\n",$v1,$v2,$v3,$v4,$v5;
27 # generate the samba.spec file
28 open(SPEC,">samba.spec");
29 print SPEC "product samba\n";
30 print SPEC $vername;
31 print SPEC " image sw\n";
32 print SPEC " id \"Samba Execution Environment\"\n";
33 print SPEC $vernum;
34 print SPEC " order 0\n";
35 print SPEC " subsys base default\n";
36 print SPEC " id \"Samba Execution Environment\"\n";
37 print SPEC " replaces fw_samba.sw.base 0 9999999999\n";
38 print SPEC " replaces fw_samba.sw.samba 0 9999999999\n";
39 print SPEC " exp samba.sw.base\n";
40 print SPEC " endsubsys\n";
41 print SPEC " endimage\n";
42 print SPEC " image man\n";
43 print SPEC " id \"Samba Online Documentation\"\n";
44 print SPEC $vernum;
45 print SPEC " order 1\n";
46 print SPEC " subsys manpages default\n";
47 print SPEC " id \"Samba Man Page\"\n";
48 print SPEC " replaces fw_samba.man.manpages 0 9999999999\n";
49 print SPEC " replaces fw_samba.man.samba 0 9999999999\n";
50 print SPEC " exp samba.man.manpages\n";
51 print SPEC " endsubsys\n";
52 print SPEC " subsys doc default\n";
53 print SPEC " id \"Samba Documentation\"\n";
54 print SPEC " replaces fw_samba.man.doc 0 9999999999\n";
55 print SPEC " exp samba.man.doc\n";
56 print SPEC " endsubsys\n";
57 print SPEC " subsys relnotes default\n";
58 print SPEC " id \"Samba Release Notes\"\n";
59 print SPEC " replaces fw_samba.man.relnotes 0 9999999999\n";
60 print SPEC " exp samba.man.relnotes\n";
61 print SPEC " endsubsys\n";
62 print SPEC " endimage\n";
63 print SPEC " image src\n";
64 print SPEC " id \"Samba Source Code\"\n";
65 print SPEC $vernum;
66 print SPEC " order 2\n";
67 print SPEC " subsys samba\n";
68 print SPEC " id \"Samba Source Code\"\n";
69 print SPEC " replaces fw_samba.src.samba 0 9999999999\n";
70 print SPEC " exp samba.src.samba\n";
71 print SPEC " endsubsys\n";
72 print SPEC " endimage\n";
73 print SPEC "endproduct\n";
74 close SPEC;
76 print "\nsamba.spec file has been created\n\n";