~ubuntu-branches/ubuntu/hardy/texlive-base/hardy-updates

« back to all changes in this revision

Viewing changes to debian/tpm2deb.pl

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2006-10-26 11:59:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061026115906-prkkn1ej2hhfpbfn
Tags: 2005.dfsg.2-3
* alternative dependencies for teTeX changed to tetex-bin to get
  mktexlsr (Closes: #395270)
* set urgency to medium as this is RC and present in testing
* upgrade prosper relation back to recommends in tl-latex-recommended
  as we have an updated package now.
* adjust version numbers in the relation to jadetex, xmltex, passivetex

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl
2
2
#
3
3
# tpm2deb.pl
4
 
# machinery to create debian packages from TeX live depot
 
4
# machinery to create debian packages from TeX Live depot
5
5
# (c) 2005, 2006 Norbert Preining
6
6
#
7
 
# $Id: tpm2deb.pl 1537 2006-07-29 19:06:51Z preining-guest $
 
7
# $Id: tpm2deb.pl 1914 2006-10-26 09:39:15Z preining-guest $
8
8
#
9
9
# configuration is done via the file tpm2deb.cfg
10
10
#
44
44
use File::Path;
45
45
use File::Temp qw/ tempfile tempdir /;
46
46
use Storable;
 
47
## not needed, atm we are calling eperl binary use Parse::ePerl;
47
48
#use XML::DOM;
48
49
use Cwd;
49
50
#use FileUtils qw(canon_dir cleandir make_link newpath member
80
81
my %Conflicts;
81
82
my %Suggests;
82
83
my %Recommends;
 
84
my %Provides;
83
85
my %Replaces;
84
86
my %SourcePackageMapping;
85
87
my @SpecialActions;
96
98
my %Title;
97
99
my %BuildDep;
98
100
my %BuildDepIndep;
 
101
my %Maintainer;
 
102
my %Priority;
 
103
my %Uploaders;
 
104
my %Section;
 
105
my %Standards;
 
106
my $AllMaintainer;
 
107
my $AllPriority;
 
108
my $AllUploaders;
 
109
my $AllSection;
 
110
my $AllStandards;
 
111
my $texlivecommonversion;
 
112
my %LatestVersion;
99
113
 
100
114
my $arch;
101
115
 
 
116
# pre set $opt_master to ./LocalTPM which contains also the Tools dir
 
117
$opt_master = "./LocalTPM";
102
118
$opt_debug=0;
103
119
$opt_nosource=0;
104
120
$opt_nosrcpkg=0;
105
121
$opt_noremove=0;
106
122
$globalreclevel=1;
107
 
$oldsrcdir="";
 
123
$oldsrcdir="./src";
108
124
$optdestination="";
109
125
 
110
126
$result = GetOptions ("debug!",         # debug mode
128
144
my $DataGlobalPath = $Master;
129
145
 
130
146
#
131
 
# put Master/Tools/ into the include path to find TeX live perl modules
 
147
# put Master/Tools/ into the include path to find TeX Live perl modules
132
148
#
133
149
unshift (@INC, "$Master/Tools");
134
150
#
166
182
        initialize_config_file_data();
167
183
        if (-r "tpm.data") {
168
184
                print "loading tpm data from dump ...\n";
169
 
        $tpmdataref = retrieve("tpm.data");
170
 
        %TpmData = %{$tpmdataref};
171
 
        print " ... done\n";
 
185
                $tpmdataref = retrieve("tpm.data");
 
186
                %TpmData = %{$tpmdataref};
 
187
                print " ... done\n";
172
188
        } else {
173
189
                load_collection_tpm_data();
174
190
        }
203
219
                print "Working on $package, arch=$arch\n";
204
220
                if ("$cmd" eq "get-packages") {
205
221
                        get_internal_deps($package,0);
 
222
                } elsif ("$cmd" eq "make-deb-rules") {
 
223
                        create_rules_file("$package.rules",$package);
206
224
                } elsif ("$cmd" eq "make-deb-control") {
207
225
                        make_deb_control($package,"$package.control");
208
226
                } elsif ("$cmd" eq "make-deb-source") {
227
245
                                print "RunFile-> $f\n";
228
246
                        }
229
247
                        foreach my $f (@{$h{BinFiles}}) {
230
 
                        print "BinFile-> $f\n";
231
 
                }
232
 
                foreach my $f (@{$h{DocFiles}}) {
233
 
                        print "DocFile-> $f\n";
234
 
                }
235
 
                foreach my $f (@{$h{SourceFiles}}) {
236
 
                        print "SourceFile-> $f\n";
237
 
                }
238
 
                foreach my $f (@{$h{RemoteFiles}}) {
239
 
                        print "RemoteFile-> $f\n";
240
 
                }
 
248
                                print "BinFile-> $f\n";
 
249
                        }
 
250
                        foreach my $f (@{$h{DocFiles}}) {
 
251
                                print "DocFile-> $f\n";
 
252
                        }
 
253
                        foreach my $f (@{$h{SourceFiles}}) {
 
254
                                print "SourceFile-> $f\n";
 
255
                        }
 
256
                        foreach my $f (@{$h{RemoteFiles}}) {
 
257
                                print "RemoteFile-> $f\n";
 
258
                        }
241
259
                } else {
242
260
                        print "cmd >$cmd< undefined!\n";
243
261
                }
292
310
                        $changelogrevision = "$2";
293
311
                        return;
294
312
                } else {
295
 
                  print STDERR "$l\n";
 
313
                        print STDERR "$l\n";
296
314
                        die("cannot parse changelog file $package.changelog\n");
297
315
                }
298
316
        }
329
347
                        foreach $l (@loglines) {
330
348
                                $changelog .= $l;
331
349
                        }
332
 
                        $changelog .= "\n -- Norbert Preining <preining\@logic.at>  $date\n\n";
 
350
                        $changelog .= "\n -- Norbert Preining <preining\@debian.org>  $date\n\n";
333
351
                        last;
334
352
                }
335
353
 
336
354
                if ($l =~ m/^version ([^-]*)-(\S*) (\S*) (.*)$/) {
337
355
                        if ($version ne "" || $extraversion ne "") {
338
 
                        if ($version eq "") { 
339
 
                        $date = `822-date`;
340
 
                        chomp($date);
341
 
                        $version = "$1" ; 
 
356
                                if ($version eq "") { 
 
357
                                        $date = `822-date`;
 
358
                                        chomp($date);
 
359
                                        $version = "$1" ; 
 
360
                                        $distribution = $3;
 
361
                                        $revision = 1; 
 
362
                                }
 
363
                                if ($changelogversion eq "") {
 
364
                                $changelogversion = $version;
 
365
                                $changelogextraversion = $extraversion;
 
366
                                        $changelogrevision = $revision; 
 
367
                                }
 
368
                                $changelog .= "$package ($version$extraversion-$revision) $distribution; urgency=low\n\n";
 
369
                                foreach $l (@loglines) {
 
370
                                        $changelog .= $l;
 
371
                                }
 
372
                                $changelog .= "\n -- Norbert Preining <preining\@debian.org>  $date\n\n";
 
373
                                # reset everything
 
374
                                @loglines = ();
 
375
                        }
 
376
                        $version = $1;
 
377
                        $revision = $2;
342
378
                        $distribution = $3;
343
 
                        $revision = 1; 
344
 
                }
345
 
                        if ($changelogversion eq "") {
346
 
                            $changelogversion = $version;
347
 
                            $changelogextraversion = $extraversion;
348
 
                            $changelogrevision = $revision; 
349
 
                }
350
 
                        $changelog .= "$package ($version$extraversion-$revision) $distribution; urgency=low\n\n";
351
 
                        foreach $l (@loglines) {
352
 
                                $changelog .= $l;
353
 
                        }
354
 
                        $changelog .= "\n -- Norbert Preining <preining\@logic.at>  $date\n\n";
355
 
                        # reset everything
356
 
                        @loglines = ();
357
 
                        }
358
 
                        $version = $1;
359
 
                $revision = $2;
360
 
                $distribution = $3;
361
 
                $extraversion = "";
 
379
                        $extraversion = "";
362
380
                        $date = $4;
363
381
                        next;
364
382
                }
365
383
 
366
384
                if ($l =~ m/^..\...\...../) {
367
 
                if ($version eq "") {
368
 
                        # we have a first entry without a preceding version, make
369
 
                # extraversion entry!
370
 
                $extraversion = `date +"%y%m%d"`;
371
 
                chomp($extraversion);
372
 
                $extraversion = "ts$extraversion";
373
 
                }
 
385
                        if ($version eq "") {
 
386
                                # we have a first entry without a preceding version, make
 
387
                                # extraversion entry!
 
388
                                $extraversion = `date +"%y%m%d"`;
 
389
                                chomp($extraversion);
 
390
                                $extraversion = "ts$extraversion";
 
391
                        }
374
392
                        push @loglines, "  $l";
375
393
                        next;
376
394
                }
392
410
 
393
411
        # don't regenerate an already existing tarball
394
412
        if ( -f "${package}_${version}.orig.tar.gz" ) {
395
 
          print "${package}_${version}.orig.tar.gz already exists, skipping.\n";
 
413
                print "${package}_${version}.orig.tar.gz already exists, skipping.\n";
396
414
        }
397
415
 
398
416
        #$texlivedest = "$tmpdir/Master";
421
439
        }
422
440
        #
423
441
        if ($package eq "texlive-bin") {
424
 
        # copy special binaries which are not installed from source.tar.bz2
 
442
                # copy special binaries which are not installed from source.tar.bz2
425
443
                `mkdir -p $texlivedest/bin.special`;
426
444
                `cp -a $DataGlobalPath/bin/i386-linux/getnonfreefonts* $texlivedest/bin.special`;
427
 
                `mkdir $texlivedest/source`;
428
 
                `cp -a $DataGlobalPath/source/source.tar.bz2 $texlivedest/source`;
 
445
                # we ship the unpacked source now, and do not include the packed
 
446
                # one! IMPORTANT: the rules file has to be changed, too!
 
447
                #`mkdir $texlivedest/source`;
 
448
                #`cp -a $DataGlobalPath/source/source.tar.bz2 $texlivedest/source`;
 
449
                `mkdir -p $texlivedest/build`;
 
450
                `cd $texlivedest/build && tar -xjf $DataGlobalPath/source/source.tar.bz2`;
 
451
                `touch $texlivedest/unpack-stamp`;
 
452
                # end of changes to use unpacked sources
429
453
                `rm -f $texlivedest/texmf/web2c/*.pool`;
430
454
        }
431
455
        # 
466
490
        my @binlines;
467
491
        my @sourcelines;
468
492
        foreach (@locont) {
469
 
                if (m/^(\S*) source: /) {
470
 
                if ($1 eq $sourcepkg) {
471
 
                        push @sourcelines, $_;
472
 
                }
473
 
        } elsif (m/^(\S*): /) {
474
 
                if ($1 eq $package) {
475
 
                        push @binlines, $_;
476
 
                }
477
 
        } else {
478
 
                push @binlines, "$package: $_";
479
 
        }
 
493
                if (m/^(\S*)#/) {
 
494
                        next;
 
495
                } elsif (m/^(\S*) source: /) {
 
496
                        if ($1 eq $sourcepkg) {
 
497
                                push @sourcelines, $_;
 
498
                        }
 
499
                } elsif (m/^(\S*): /) {
 
500
                        if ($1 eq $package) {
 
501
                                push @binlines, $_;
 
502
                        }
 
503
                } else {
 
504
                        push @binlines, "$package: $_";
 
505
                }
480
506
        }
481
507
        if ($#binlines >= 0) {
482
508
                myopen(BINOVER,">$debdest/$package.override");
483
 
        foreach (@binlines) {
484
 
                print BINOVER $_;
485
 
        }
486
 
        close(BINOVER);
 
509
                foreach (@binlines) {
 
510
                        print BINOVER $_;
 
511
                }
 
512
                close(BINOVER);
487
513
        }
488
514
        if ($#sourcelines >= 0) {
489
515
                myopen(SOURCEOVER,">$debdest/source.lintian-overrides");
490
 
        foreach (@sourcelines) {
491
 
                print SOURCEOVER $_;
492
 
        }
493
 
        close(SOURCEOVER);
 
516
                foreach (@sourcelines) {
 
517
                        print SOURCEOVER $_;
 
518
                }
 
519
                close(SOURCEOVER);
494
520
        }
495
521
}
496
522
 
510
536
#
511
537
PACKAGES=@{$SourcePackages{$package}}
512
538
 
 
539
SHELL=/bin/bash
 
540
 
513
541
include /usr/share/dpatch/dpatch.make
514
542
 
515
543
build: build-stamp
527
555
 
528
556
build-stamp: patch-stamp
529
557
        cd build && bash ../debian/Build.debian
 
558
        # the following works also on non-i386 arch as the Tpm arch is set
 
559
        # to i386-linux in the tpm2deb.pl file. So the build binaries (of any
 
560
        # architecture) will be found in bin/i386-linux.
530
561
        mkdir -p bin/i386-linux
531
562
        cp -a build/inst/bin/*/* bin/i386-linux/
532
563
        cp -a bin.special/* bin/i386-linux/
551
582
EOF
552
583
        if ($package eq "texlive-bin") {
553
584
                print RULES <<'EOF';
554
 
        rm -rf build
555
 
        rm -f unpack-stamp
 
585
        # do not remove the unpack-stamp as we are now working with the
 
586
        # pre unpacked sources, don't remove the build dir, only the relevant
 
587
        # subdirectories
 
588
        # rm -rf build
 
589
        rm -rf build/Work build/inst
 
590
        # rm -f unpack-stamp
556
591
        rm -rf bin
557
592
        rm -f texmf/web2c/*.pool
558
593
        rm -f texmf-dist/source/plain/pdcmac/config.status
573
608
          rm -rf debian/$$i/usr/share/texmf-texlive/tpm ; \
574
609
          install -D --mode=644 debian/$$i.override debian/$$i/usr/share/lintian/overrides/$$i ; \
575
610
          install -D --mode=755 debian/bug.script debian/$$i/usr/share/bug/$$i/script ; \
 
611
          install -D --mode=644 debian/bug.control debian/$$i/usr/share/bug/$$i/control ; \
576
612
          bash debian/create-doc-links $$i texlive-doc > debian/$$i.links ; \
577
613
          if [ -r debian/$$i.links.dist ] ; then cat debian/$$i.links.dist >> debian/$$i.links ; fi ; \
578
614
          if [ -r debian/$$i.README ] ; then cat debian/$$i.README > debian/$$i.README.Debian ; fi ; \
648
684
        $version = "$changelogversion$changelogextraversion";
649
685
        $revision = $changelogrevision;
650
686
        print "PACKAGE=$package ARCH=$arch VERSION=$version REVISION=$revision\n";
651
 
        $oldorig = "$oldsrcdir/${package}_${version}.orig.tar.gz";
652
 
        if (-r $oldorig) {
 
687
        # check for different places of old sources
 
688
        $sourcedone = 0;
 
689
        if (-r "./${package}_${version}.orig.tar.gz") {
 
690
                $oldorig = "./${package}_${version}.orig.tar.gz";
 
691
                $sourcedone = 1;
 
692
        } elsif (-r "$oldsrcdir/${package}_${version}.orig.tar.gz") {
 
693
                $oldorig = "$oldsrcdir/${package}_${version}.orig.tar.gz";
 
694
                `cp $oldorig .` and die("Cannot cp $oldorig .!\n");
 
695
                $sourcedone = 1;
 
696
        }
 
697
        if ($sourcedone) {
653
698
                print "Reusing $oldorig file for source package building!\n";
654
 
                `cp $oldorig .` and die("Cannot cp $oldorig .!\n");
655
 
        `tar -xzf $oldorig`;
656
 
        $sourcedone = 1;
 
699
                `tar -xzf $oldorig`;
657
700
        } else {
658
 
                #
659
 
        # we create a new directory with full stuff
660
 
        #
661
 
        print "Generating new orig.tar.gz and source package!\n";
662
 
        $sourcedone = 0;
 
701
                # we create a new directory with full stuff
 
702
                print "Generating new orig.tar.gz and source package!\n";
663
703
        }
664
704
        $tmpdir = "${package}-${version}";
665
705
        mkpath($tmpdir);
669
709
        $texlivedest = "$tmpdir";
670
710
 
671
711
        if (!$sourcedone) {
672
 
        # don't remove the build dir we want to fill it
673
 
        $opt_noremove = 1;
674
 
        make_orig_tar($package);
 
712
                # don't remove the build dir we want to fill it
 
713
                $opt_noremove = 1;
 
714
                make_orig_tar($package);
675
715
        } 
676
716
        #
677
717
        # DEBIAN FILES
685
725
        # do not writeout changelog as it is installed via addons-per-source
686
726
        # for source package specific changelogs!
687
727
        #writeout_changelog("$debdest/changelog");
688
 
        create_rules_file($debdest,$package);
 
728
        # old version of creating rules file
 
729
        #create_rules_file($debdest,$package);
 
730
        # new version using ePerl and rules.in
 
731
        `eperl -d arch=$arch -d srcpackage=$package -dbinpackages="@{$SourcePackages{$package}}" $mydir/rules.in > $debdest/rules`;
 
732
        #myopen(RULESIN,"<$mydir/rules.in");
 
733
        #my @rulesin = <RULESIN> ; close(RULESIN);
 
734
        #my $rulesintxt = "@rulesin";
 
735
        #if (! Parse::ePerl::Expand({
 
736
        #       Script => $rulesintxt,
 
737
        #       Result => \$rulesintxt
 
738
        #       })) {
 
739
        #       printf STDERR "Cannot create rules file! Exiting\n";
 
740
        #       exit 1;
 
741
        #}
 
742
        #myopen (RULESOUT,  ">$debdest/rules");
 
743
        #print RULESOUT $rulesintxt;
 
744
        #close (RULESOUT);
689
745
        `chmod ugo+x $debdest/rules`;
690
746
        make_deb_control($package,"$debdest/control");
691
747
        #
694
750
        # speciality: the prefix all. is also recognized and installed
695
751
        #
696
752
        if (-d "$mydir/addons-per-source") {
697
 
        foreach $f (<$mydir/addons-per-source/$package.*>) {
698
 
                $nn = basename($f);
699
 
                $nn =~ s/^$package\.//;
700
 
                mycopy("$f", "$debdest/$nn");
701
 
        }
702
 
        foreach $f (<$mydir/addons-per-source/all.*>) {
703
 
                $nn = basename($f);
704
 
                $nn =~ s/^all\.//;
705
 
                mycopy("$f", "$debdest/$nn");
706
 
        }
 
753
                foreach $f (<$mydir/addons-per-source/$package.*>) {
 
754
                        $nn = basename($f);
 
755
                        $nn =~ s/^$package\.//;
 
756
                        mycopy("$f", "$debdest/$nn");
 
757
                }
 
758
                foreach $f (<$mydir/addons-per-source/all.*>) {
 
759
                        $nn = basename($f);
 
760
                        $nn =~ s/^all\.//;
 
761
                        mycopy("$f", "$debdest/$nn");
 
762
                }
707
763
        }
708
764
        #
709
765
        # Things from addons-per-bin
723
779
        my @locont = <OVERRIDE>;
724
780
        close(OVERRIDE);
725
781
        foreach $coll (@{$SourcePackages{$package}}) {
726
 
        create_override_file($coll,$package,$debdest,@locont);
 
782
                create_override_file($coll,$package,$debdest,@locont);
727
783
        } 
728
784
        #
729
785
        # dpatch handling
730
786
        #
731
787
        if (-d "$mydir/dpatch/" && -d "$mydir/dpatch/$package" ) {
732
788
                &mkpath("$tmpdir/debian/patches");
733
 
        foreach $f (<$mydir/dpatch/$package/*>) {
734
 
                mycopy ($f,"$tmpdir/debian/patches/");
735
 
        }
 
789
                foreach $f (<$mydir/dpatch/$package/*>) {
 
790
                        mycopy ($f,"$tmpdir/debian/patches/");
 
791
                }
736
792
        }
737
793
        #
738
794
        # clean all svn stuff from debian
758
814
        local $foo;
759
815
        myopen(CONTROL,">$destfname") || die("Cannot open $destfname!\n");
760
816
        print CONTROL "Source: $package\n";
761
 
        print CONTROL "Section: tex\n";
762
 
        print CONTROL "Priority: optional\n";
763
 
        print CONTROL 'Maintainer: Debian TeX Maintainers <debian-tex-maint@lists.debian.org>'."\n";
764
 
        print CONTROL 'Uploaders: Norbert Preining <preining@logic.at>', "\n";
 
817
        print CONTROL "Section: ",
 
818
                defined($Section{$package}) ? "$Section{$package}" : "$AllSection",
 
819
                "\n";
 
820
        print CONTROL "Priority: ",
 
821
                defined($Priority{$package}) ? "$Priority{$package}" : "$AllPriority",
 
822
                "\n";
 
823
        print CONTROL "Maintainer: ",
 
824
                defined($Maintainer{$package}) ? "$Maintainer{$package}" : "$AllMaintainer",
 
825
                "\n";
 
826
        print CONTROL "Uploaders: ",
 
827
                defined($Uploaders{$package}) ? "$Uploaders{$package}" : "$AllUploaders",
 
828
                "\n";
765
829
        if (defined($BuildDep{$package})) {
766
830
                print CONTROL "Build-Depends: $BuildDep{$package}\n";
767
831
        }
768
832
        if (defined($BuildDepIndep{$package})) {
769
833
                print CONTROL "Build-Depends-Indep: $BuildDepIndep{$package}\n";
770
834
        }
771
 
        print CONTROL "Standards-Version: 3.7.2\n";
 
835
        print CONTROL "Standards-Version: ",
 
836
                defined($Standards{$package}) ? "$Standards{$package}" : "$AllStandards",
 
837
                "\n";
772
838
        #
773
839
        # now start the individual packages
774
840
        #
776
842
        foreach $pkg (@{$SourcePackages{$package}}) {
777
843
                my %lists = %{&get_all_files($pkg,$globalreclevel)};
778
844
                my $title = $TeXLive{$pkg}{'title'};
779
 
        if (defined($Title{$pkg})) {
780
 
                $title = $Title{$pkg};
781
 
        }
 
845
                if (defined($Title{$pkg})) {
 
846
                        $title = $Title{$pkg};
 
847
                }
782
848
                my @lop = @{$TeXLive{$pkg}{'includedpackages'}};
783
849
                my $description = $TeXLive{$pkg}{'description'};
784
 
        if (defined($Description{$pkg})) {
785
 
                $description = $Description{$pkg};
786
 
        }
 
850
                if (defined($Description{$pkg})) {
 
851
                        $description = $Description{$pkg};
 
852
                }
787
853
                print CONTROL "\nPackage: $pkg\n";
788
854
                print CONTROL "Architecture: $arch\n";
789
 
        my @AllDepends = @{$TeXLive{$pkg}{'depends'}};
 
855
                my @AllDepends = @{$TeXLive{$pkg}{'depends'}};
790
856
                if ($arch eq "any") {
791
857
                        push (@AllDepends, '${shlibs:Depends}');
792
858
                }
793
 
        my @AllConflicts;
794
 
        @AllConflicts = @{$TeXLive{$pkg}{'conflicts'}};
795
 
        # if we do *not* have a *unversioned* conflict with tetex, we make 
796
 
        # various texlive packages optionally depend on tetex:
797
 
        # so we have to replace
798
 
        #       texlive-base    ->      texlive-base | tetex-base
799
 
        #       texlive-latex-base ->   texlive-latex-base | tetex-base
800
 
        if (!unversioned_tetex_conflict(@AllConflicts)) {
801
 
                my @newdep = ();
802
 
                foreach $d (@AllDepends) {
803
 
                        if ($d =~ m/^texlive-base$/) { 
804
 
                        $o = "texlive-base | tetex-base"; 
805
 
                } elsif ($d =~ m/^texlive-latex-base$/) {
806
 
                        $o = "texlive-latex-base | tetex-base";
807
 
                } else {
808
 
                        $o = $d;
809
 
                }
810
 
                push @newdep, $o;
811
 
                }
812
 
                @AllDepends = @newdep;
813
 
        }
814
 
        print CONTROL "Depends: ";
815
 
        makeuniq(\@AllDepends);
816
 
        print CONTROL join(", ",@AllDepends), "\n";
817
 
        $opt_debug && print  "\nDependencies for $package: ", join(", ",@AllDepends), "\n";
818
 
        #
819
 
        # Conflicts
820
 
        #
821
 
        if ($#AllConflicts >= 0) {
822
 
                makeuniq(\@AllConflicts);
823
 
                print CONTROL "Conflicts: ", join(", ", @AllConflicts), "\n";
824
 
        }
825
 
        #
826
 
        # Recommends
827
 
        #
828
 
        my @AllRecommends = @{$TeXLive{$pkg}{'recommends'}};
829
 
        if ($#AllRecommends >= 0) {
830
 
                makeuniq(\@AllRecommends);
831
 
                print CONTROL "Recommends: ", join(", ", @AllRecommends), "\n";
832
 
        }
833
 
        #
834
 
        # Suggests
835
 
        #
836
 
        my @AllSuggests = @{$TeXLive{$pkg}{'suggests'}};
837
 
        if ($#AllSuggests >= 0) {
838
 
                makeuniq(\@AllSuggests);
839
 
                print CONTROL "Suggests: ", join(", ", @AllSuggests), "\n";
840
 
        }
841
 
        #
842
 
        # Replaces
843
 
        #
844
 
        my @AllReplaces = @{$TeXLive{$pkg}{'replaces'}};
845
 
        if ($#AllReplaces >= 0) {
846
 
                makeuniq(\@AllReplaces);
847
 
                print CONTROL "Replaces: ", join(", ", @AllReplaces), "\n";
848
 
        }
849
 
        #
850
 
        # Provides of virtual packages
851
 
        #
852
 
        if ($pkg eq "texlive-base-bin") {
853
 
                print CONTROL "Provides: dvipdfm\n";
854
 
        }
855
 
        if ($pkg eq "texlive-extra-utils") {
856
 
                print CONTROL "Provides: cweb, ctie, texdoctk\n";
857
 
        }
 
859
                my @AllConflicts;
 
860
                @AllConflicts = @{$TeXLive{$pkg}{'conflicts'}};
 
861
                # if we do *not* have a *unversioned* conflict with tetex, we make 
 
862
                # various texlive packages optionally depend on tetex:
 
863
                # so we have to replace
 
864
                #       texlive-base    ->      texlive-base | tetex-bin
 
865
                #       texlive-latex-base ->   texlive-latex-base | tetex-bin
 
866
                if (!unversioned_tetex_conflict(@AllConflicts)) {
 
867
                        my @newdep = ();
 
868
                        foreach $d (@AllDepends) {
 
869
                                if ($d =~ m/^texlive-base$/) { 
 
870
                                        $o = "texlive-base | tetex-bin"; 
 
871
                                } elsif ($d =~ m/^texlive-latex-base$/) {
 
872
                                        $o = "texlive-latex-base | tetex-bin";
 
873
                                } else {
 
874
                                        $o = $d;
 
875
                                }
 
876
                                push @newdep, $o;
 
877
                        }
 
878
                        @AllDepends = @newdep;
 
879
                }
 
880
                print CONTROL "Depends: ";
 
881
                makeuniq(\@AllDepends);
 
882
                print CONTROL join(", ",@AllDepends), "\n";
 
883
                $opt_debug && print  "\nDependencies for $package: ", join(", ",@AllDepends), "\n";
 
884
                #
 
885
                # Conflicts
 
886
                #
 
887
                if ($#AllConflicts >= 0) {
 
888
                        makeuniq(\@AllConflicts);
 
889
                        print CONTROL "Conflicts: ", join(", ", @AllConflicts), "\n";
 
890
                }
 
891
                #
 
892
                # Recommends
 
893
                #
 
894
                my @AllRecommends = @{$TeXLive{$pkg}{'recommends'}};
 
895
                if ($#AllRecommends >= 0) {
 
896
                        makeuniq(\@AllRecommends);
 
897
                        print CONTROL "Recommends: ", join(", ", @AllRecommends), "\n";
 
898
                }
 
899
                #
 
900
                # Provides
 
901
                #
 
902
                my @AllProvides = @{$TeXLive{$pkg}{'provides'}};
 
903
                if ($#AllProvides >= 0) {
 
904
                        makeuniq(\@AllProvides);
 
905
                        print CONTROL "Provides: ", join(", ", @AllProvides), "\n";
 
906
                }
 
907
                #
 
908
                # Suggests
 
909
                #
 
910
                my @AllSuggests = @{$TeXLive{$pkg}{'suggests'}};
 
911
                if ($#AllSuggests >= 0) {
 
912
                        makeuniq(\@AllSuggests);
 
913
                        print CONTROL "Suggests: ", join(", ", @AllSuggests), "\n";
 
914
                }
 
915
                #
 
916
                # Replaces
 
917
                #
 
918
                my @AllReplaces = @{$TeXLive{$pkg}{'replaces'}};
 
919
                if ($#AllReplaces >= 0) {
 
920
                        makeuniq(\@AllReplaces);
 
921
                        print CONTROL "Replaces: ", join(", ", @AllReplaces), "\n";
 
922
                }
 
923
                #
858
924
                print CONTROL "Description: TeX Live: $title\n";
859
925
                #
860
926
                @deslines = split(/\n/, $description);
861
927
                $firstline = 1;
862
928
                foreach $l (@deslines) {
863
929
                        if ($l =~ m/^\s*$/) {
864
 
                        if ($firstline) { $firstline = 0; next; }
865
 
                        print CONTROL " .\n";
866
 
                } else { 
867
 
                        #$shortl = shortenline($l);
868
 
                        #print CONTROL " $shortl\n";
869
 
                $shortl = $l;
870
 
                write CONTROL;
871
 
                }
 
930
                                if ($firstline) { $firstline = 0; next; }
 
931
                                print CONTROL " .\n";
 
932
                        } else { 
 
933
                                #$shortl = shortenline($l);
 
934
                                #print CONTROL " $shortl\n";
 
935
                                $shortl = $l;
 
936
                                write CONTROL;
 
937
                        }
872
938
                }
873
939
                @foo = ();
874
940
                foreach $p (@lop) {
875
941
                        $subtype = $TeXLive{$p}{'type'};
876
 
                if (($subtype eq "Package") || ($subtype eq "Documentation")) {
877
 
                        push @foo, $p;
878
 
                }
 
942
                        if (($subtype eq "Package") || ($subtype eq "Documentation")) {
 
943
                                push @foo, $p;
 
944
                        }
879
945
                }
880
946
                if ($#foo < 0) {
881
 
                next;
 
947
                        next;
882
948
                }
883
949
                print CONTROL " .\n This package includes the following CTAN packages:\n";
884
950
                foreach $p (@foo) {
885
 
                $tit = $TeXLive{$p}{'title'};
886
 
                if (defined($Title{$p})) {
887
 
                        $tit = $Title{$p};
888
 
                }
889
 
                chomp($tit);
890
 
                # add an extra space at the beginning to have a real list
891
 
                $shortl = " $p -- $tit";
892
 
                write CONTROL;
 
951
                        $tit = $TeXLive{$p}{'title'};
 
952
                        if (defined($Title{$p})) {
 
953
                                $tit = $Title{$p};
 
954
                        }
 
955
                        chomp($tit);
 
956
                        # add an extra space at the beginning to have a real list
 
957
                        $shortl = " $p -- $tit";
 
958
                        write CONTROL;
893
959
                }
894
960
        }
895
961
        close CONTROL;
908
974
        @SymLinkPairs = ();
909
975
        @SpecialActions = ();
910
976
        if ($optdestination ne "") {
911
 
        $tmpdir = $optdestination;
 
977
                $tmpdir = $optdestination;
912
978
        } else {
913
 
        $tmpdir = ".";
 
979
                $tmpdir = ".";
914
980
        }
915
981
        $opt_debug && print "tmpdir = $tmpdir\n";
916
982
        $foo="\$debdest = \"$sysdebdest\""; eval $foo;
921
987
        $foo="\$etcdest = \"$sysetcdest\""; eval $foo;
922
988
        $opt_debug && print "\nProcess $package\n";
923
989
        if ($opt_debug) {
924
 
        print "debdest = $debdest\n";
925
 
        print "basedir = $basedir\n";
926
 
        print "bindest = $bindest\n";
927
 
        print "rundest = $rundest\n";
928
 
        print "docdest = $docdest\n";
929
 
        print "etcdest = $etcdest\n";
 
990
                print "debdest = $debdest\n";
 
991
                print "basedir = $basedir\n";
 
992
                print "bindest = $bindest\n";
 
993
                print "rundest = $rundest\n";
 
994
                print "docdest = $docdest\n";
 
995
                print "etcdest = $etcdest\n";
930
996
        }
931
997
        my %lists = %{&get_all_files($package,$globalreclevel)};
932
998
        my $title = $TeXLive{$package}{'title'};
933
999
        my $description = $TeXLive{$package}{'description'};
934
1000
        eval { mkpath($rundest) };
935
1001
        if ($@) {
936
 
        die "Couldn't create $dir: $@";
 
1002
                die "Couldn't create $dir: $@";
937
1003
        }  
938
1004
        if ($opt_debug) {
939
1005
                print "SOURCEFILES: ", @{$lists{'SourceFiles'}}, "\n";
942
1008
        &mkpath($docdest);
943
1009
        if (!$opt_nosource) {
944
1010
                DOSFILE: foreach $f (@{$lists{'SourceFiles'}}) {
945
 
                foreach $pat (@FileBlackList) { 
946
 
                        if ($f =~ m|^${pat}$|) { next DOSFILE ; }
947
 
                }
948
 
                $ret = do_remap_and_copy($f,$rundest);
949
 
                do_special($f,$ret);
 
1011
                        foreach $pat (@FileBlackList) { 
 
1012
                                if ($f =~ m|^${pat}$|) { next DOSFILE ; }
 
1013
                        }
 
1014
                        $ret = do_remap_and_copy($f,$rundest);
 
1015
                        do_special($f,$ret);
950
1016
                }
951
1017
        }
952
1018
        DORFILE: foreach $f (@{$lists{'RunFiles'}}) {
953
1019
                foreach $pat (@FileBlackList) {
954
 
                if ($f =~ m|^${pat}$|) { next DORFILE ; }
 
1020
                        if ($f =~ m|^${pat}$|) { next DORFILE ; }
955
1021
                }
956
1022
                $ret = do_remap_and_copy($f,$rundest);
957
1023
                do_special($f,$ret);
981
1047
                $ret = do_remap_and_copy($f,$bindest,'^bin/[^/]*/(.*)$','$bindest/$1');
982
1048
                do_special($f,$ret);
983
1049
        }
984
 
        # now done via addons-per-bin/tex-common.links.dist
985
 
        #if ($package eq 'texlive-common') {
986
 
        #       foreach $i (<README.?? debian/README.Debian debian/README.Debian-source debian/CHANGES.packaging tl4deb-deptree.pdf>) {
987
 
        #               $j = basename($i);
988
 
        #               add_symlink("usr/share/doc/texlive-common/$j", "$unifieddocdir/$j");
989
 
        #       }
990
 
        #}
991
1050
        if ($package eq 'texlive-base') {
992
1051
                # now activate the language.us file!
993
1052
                &mkpath("$basedir/var/lib/tex-common/language-cnf/");
1582
1641
                        # direct tpm dependencies
1583
1642
                        my @depends = tpm2debname(@{$TpmData{$t}{$c}{'TLCore'}});
1584
1643
                        if ($p ne "texlive-common") {
1585
 
                                push @depends, "texlive-common";
 
1644
                                push @depends, "texlive-common (>= $texlivecommonversion)";
1586
1645
                        }
1587
1646
                        if (defined($Depends{$p})) {
1588
1647
                                push @depends, @{$Depends{$p}};
1604
1663
                        if (defined($Recommends{$p})) {
1605
1664
                                $TeXLive{$p}{'recommends'} = [ @{$Recommends{$p}} ];
1606
1665
                        }
 
1666
                        if (defined($Provides{$p})) {
 
1667
                                $TeXLive{$p}{'provides'} = [ @{$Provides{$p}} ];
 
1668
                        }
1607
1669
                        if (defined($Replaces{$p})) {
1608
1670
                                $TeXLive{$p}{'replaces'} = [ @{$Replaces{$p}} ];
1609
1671
                        }
1615
1677
                foreach $p (@{$SourcePackages{$s}}) {
1616
1678
                        next if ($p eq "texlive-full");
1617
1679
                        next if ($p eq "texlive");
1618
 
                        push @allpkgs, $p;
 
1680
                        push @allpkgs, "$p (>= $LatestVersion{$s})";
1619
1681
                }
1620
1682
        }
1621
1683
        $TeXLive{"texlive-common"}{'type'} = "TLCore" ;
1668
1730
of TeX documents in many different languages, and a large collection
1669
1731
of TeX macros and font libraries.
1670
1732
 
 
1733
This metapackage provides a decent selection of the TeX Live packages
 
1734
which should suffice for the most common tasks.
 
1735
 
1671
1736
The distribution also includes extensive general documentation about
1672
1737
TeX, as well as the documentation accompanying the included software
1673
1738
packages.";
1674
 
        $TeXLive{"texlive"}{'title'} = "A decent selection of the TeX live packages";
 
1739
        $TeXLive{"texlive"}{'title'} = "A decent selection of the TeX Live packages";
1675
1740
 
1676
1741
        print " ... done\n";
1677
1742
}
1876
1941
                        $Recommends{$a} = [ @{$Recommends{$a}}, split(/[ \t]*,[ \t]*/,$b) ];
1877
1942
                        next;
1878
1943
                }
 
1944
                if ($type eq "provides") {
 
1945
                        my ($b) = @rest;
 
1946
                        $opt_debug && print "b=$b.\n";
 
1947
                        $Provides{$a} = [ @{$Provides{$a}}, split(/[ \t]*,[ \t]*/,$b) ];
 
1948
                        next;
 
1949
                }
1879
1950
                if ($type eq "suggests") {
1880
1951
                        my ($b) = @rest;
1881
1952
                        $opt_debug && print "b=$b.\n";
1981
2052
                        $BuildDepIndep{$a} = "$b";
1982
2053
                        next;
1983
2054
                }
 
2055
                if ($type eq "texlive-common-version") {
 
2056
                        $texlivecommonversion = "$a";
 
2057
                        next;
 
2058
                }
 
2059
                if ($type eq "latest-version") {
 
2060
                        my ($b) = @rest;
 
2061
                        $opt_debug && print "b=$b.\n";
 
2062
                        $LatestVersion{$a} = "$b";
 
2063
                        next;
 
2064
                }
 
2065
                if ($type eq "maintainer") {
 
2066
                        my ($b) = @rest;
 
2067
                        $opt_debug && print "b=$b.\n";
 
2068
                        if ("$a" eq "*") {
 
2069
                                $AllMaintainer = "$b";
 
2070
                        } else {
 
2071
                                $Maintainer{$a} = "$b";
 
2072
                        }
 
2073
                        next;
 
2074
                }
 
2075
                if ($type eq "priority") {
 
2076
                        my ($b) = @rest;
 
2077
                        $opt_debug && print "b=$b.\n";
 
2078
                        if ("$a" eq "*") {
 
2079
                                $AllPriority = "$b";
 
2080
                        } else {
 
2081
                                $Priority{$a} = "$b";
 
2082
                        }
 
2083
                        next;
 
2084
                }
 
2085
                if ($type eq "uploaders") {
 
2086
                        my ($b) = @rest;
 
2087
                        $opt_debug && print "b=$b.\n";
 
2088
                        if ("$a" eq "*") {
 
2089
                                $AllUploaders = "$b";
 
2090
                        } else {
 
2091
                                $Uploaders{$a} = "$b";
 
2092
                        }
 
2093
                        next;
 
2094
                }
 
2095
                if ($type eq "section") {
 
2096
                        my ($b) = @rest;
 
2097
                        $opt_debug && print "b=$b.\n";
 
2098
                        if ("$a" eq "*") {
 
2099
                                $AllSection = "$b";
 
2100
                        } else {
 
2101
                                $Section{$a} = "$b";
 
2102
                        }
 
2103
                        next;
 
2104
                }
 
2105
                if ($type eq "standards") {
 
2106
                        my ($b) = @rest;
 
2107
                        $opt_debug && print "b=$b.\n";
 
2108
                        if ("$a" eq "*") {
 
2109
                                $AllStandards = "$b";
 
2110
                        } else {
 
2111
                                $Standards{$a} = "$b";
 
2112
                        }
 
2113
                        next;
 
2114
                }
1984
2115
                print "tpm2deb.cfg: Unknown directive: $type. Exiting!\n"; 
1985
2116
                exit 1;
1986
2117
        }