11
if (@ARGV && $ARGV[0] eq 'update') {
12
@packages = `ls -1d debian/*/DEBIAN`;
13
foreach $dir (@packages) {
16
foreach $file (qw{postinst postrm preinst prerm}) {
17
next if (! -f "$dir/$file");
19
open(IN, "$dir/$file");
20
open(OUT, ">/tmp/kde.dpkg");
24
if (-d $dir . "/../usr/lib/mime/packages") {
25
if ($file eq 'postinst') {
26
print OUT "# added by kderules\n";
27
print OUT 'case "$1" in' . "\n";
28
print OUT " configure)\n";
29
print OUT " if [ -x /usr/sbin/update-mime ]; then\n";
30
print OUT " update-mime\n";
34
} elsif ($file eq 'postrm') {
35
print OUT "# added by kderules\n";
36
print OUT 'case "$1" in' . "\n";
37
print OUT " remove|purge)\n";
38
print OUT " if [ -x /usr/sbin/update-mime ]; then\n";
39
print OUT " update-mime\n";
57
mv("/tmp/kde.dpkg", "$dir/$file");
58
chown("root.root","dir/$file");
59
chmod(0755,"$dir/$file");
66
$QTDIR="/usr/lib/qt2";
11
if (@ARGV && $ARGV[0] eq 'cleanup') {
13
if (-d "debian/tmp/usr/share/config") {
14
if (! -d "debian/tmp/$kde_confdir") {
15
system("mv debian/tmp/usr/share/config debian/tmp/$kde_confdir");
18
system("rm -f `find debian/ -name \".anchors\"`");
19
system("chmod 755 debian/*preinst debian/*postinst");
24
$QTDIR="/usr/share/qt";
68
26
$kde_htmldir="$kde_prefix/share/doc/kde/HTML";
69
27
$kde_icondir="$kde_prefix/share/icons";
70
28
$kde_sounddir="$kde_prefix/share/sounds";
71
29
$kde_datadir="$kde_prefix/share/apps";
72
30
$kde_locale="$kde_prefix/share/locale";
73
$kde_confdir="etc/kde2";
31
$kde_confdir="/etc/kde2";
32
$kde_cgidir="$kde_prefix/lib/cgi-bin";
74
33
$kde_appsdir="$kde_prefix/share/applnk";
75
34
$kde_mimedir="$kde_prefix/share/mimelnk";
76
35
$kde_wallpaperdir="$kde_prefix/share/wallpapers";
79
38
$kde_servicetypesdir="$kde_prefix/share/servicetypes";
80
39
$kde_includedir="$kde_prefix/include/kde";
81
40
$kde_libdir="$kde_prefix/lib";
41
$kde_moduledir="$kde_prefix/lib/kde2";
82
42
$mandir="$kde_prefix/share/man";
83
43
$infodir="$kde_prefix/share/info";
84
$IDL="/$kde_bindir/cuteidl";
85
$DCOPIDL="/$kde_bindir/dcopidl";
86
$DCOPIDL2CPP="/$kde_bindir/dcopidl2cpp";
87
$KDB2HTML="/$kde_bindir/kdb2html";
88
$MCOPIDL="/$kde_bindir/mcopidl";
89
$ARTSCCONFIG="/$kde_bindir/artsc-config";
44
$IDL="$kde_bindir/cuteidl";
45
$DCOPIDL="$kde_bindir/dcopidl";
46
$DCOPIDL2CPP="$kde_bindir/dcopidl2cpp";
47
$KDB2HTML="$kde_bindir/kdb2html";
48
$MCOPIDL="$kde_bindir/mcopidl";
49
$ARTSCCONFIG="$kde_bindir/artsc-config";
91
51
if (@ARGV && $ARGV[0] eq 'echodirs') {
92
52
print STDOUT "export kde_htmldir=$kde_htmldir\n";
114
76
print STDOUT "export KDB2HTML=$KDB2HTML\n";
115
77
print STDOUT "export MCOPIDL=$MCOPIDL\n";
116
78
print STDOUT "export ARTSCCONFIG=$ARTSCCONFIG\n";
117
print STDOUT "configkde=--enable-debug --disable-rpath --prefix=/\$(kde_prefix) --libexecdir=/\$(kde_bindir) --with-qt-dir=\$(QTDIR) --mandir=/\$(mandir) --infodir=/\$(infodir)\n";
118
print STDOUT "configkdevelop=--enable-docbase --enable-kdoc2 --enable-debug --disable-rpath --libdir=/\$(kde_libdir) --includedir=/\$(kde_includedir) --with-qt-dir=\$(QTDIR) --mandir=/\$(mandir) --with-kdelibsdoc-dir=/usr/share/doc/kdelibs3-doc/html\n";
79
print STDOUT "configkde=--disable-debug --disable-rpath --prefix=\$(kde_prefix) --libexecdir=\$(kde_bindir) --with-qt-includes=/usr/include/qt --mandir=\$(mandir) --infodir=\$(infodir)\n";
80
print STDOUT "configkdevelop=--disable-debug --enable-docbase --enable-kdoc2 --disable-rpath --libdir=\$(kde_libdir) --includedir=\$(kde_includedir) --with-qt-includes=/usr/include/qt --mandir=\$(mandir) --with-kdelibsdoc-dir=/usr/share/doc/kdelibs3-doc/html\n";
81
print STDOUT "configkdepim=--disable-debug --with-extra-includes=/usr/include/libpisock --enable-shared --disable-rpath --prefix=\$(kde_prefix) --libexecdir=\$(kde_bindir) --with-qt-includes=/usr/include/qt --mandir=\$(mandir) --infodir=\$(infodir)\n";
122
if (@ARGV && $ARGV[0]) {
125
open(CHANGELOG,"debian/changelog")
126
or die "can't read debian/changelog : $!\n";
133
# Find documentation and install it
135
local $dir = $File::Find::dir;
136
$dir =~ s/^$origPwd//;
137
if ($dir =~ /debian/) { return 0 ; }
138
if ($dir =~ /build/) { return 0 ; }
139
if ( ( /debian/ ) or ( /^INSTALL$/ ) or ( /^LICENSE$/ )
140
or ( /^ARTISTIC$/ ) or ( /^COPYING$/ ) ) { return 0 ; }
142
and ( /^[A-Z]*$/ or /^README$/ or /^ChangeLog$/ or /lsm$/ or /SWALLOW/
143
or /^TODO$/ or /^kdedoc$/ or /Header/ or /Documentation/ or /Tutorial/ ) )
155
find(\&docwanted, $pwd);
156
if ($pwd =~ ?^(.*/)build_([^/]*)$?) {
159
find(\&docwanted, $pwd);
163
if (! -d "debian/tmp/usr/share/doc/$package") {
164
mkdir("-p", "debian/tmp/usr/share/doc/$package") ;
167
if (-d "debian/tmp/usr/share/config") {
168
if (! -d "debian/tmp/$kde_confdir") {
169
system("mv debian/tmp/usr/share/config debian/tmp/$kde_confdir");
176
cp( "-aP", @docs, "debian/tmp/usr/share/doc/$package") ;
177
if (-f "debian/tmp/usr/share/doc/$package/ChangeLog") {
178
mv("debian/tmp/usr/share/doc/$package/ChangeLog",
179
"debian/tmp/usr/share/doc/$package/changelog");
181
if (-f "debian/tmp/usr/share/doc/$package/CHANGES") {
182
mv("debian/tmp/usr/share/doc/$package/CHANGES",
183
"debian/tmp/usr/share/doc/$package/changelog");
187
# Create doc-base file
189
if (-d "debian/doc-base") {
190
if (! -d "debian/tmp/usr/share/doc-base") {
191
mkdir("-p", "debian/tmp/usr/share/doc-base");
193
while (<debian/doc-base/*>) {
194
cp( "-a", $_, "debian/tmp/usr/share/doc-base")
197
# cp( "-a", <debian/doc-base/*>, "debian/tmp/usr/share/doc-base") ;
201
# Create debian/menu files
204
/\.desktop$/ && push @lnkfiles, "$File::Find::dir/$_" ;
207
if (-d "debian/tmp/$kde_appsdir") {
208
find(\&findkdelnk,"debian/tmp/$kde_appsdir");
211
if (-e "debian/menu.in") {
212
open MENUIN, "debian/menu.in" ;
215
($prog,$type,$sect) = split / /;
222
open MENU, ">debian/menu" or die "can't open debian/menu : $!\n";
223
open MIME, ">debian/mailcap" or die "can't open debian/mailcap : $!\n";
225
foreach $file (@lnkfiles) {
230
/^\[KDE Desktop Entry\]/ && next ;
233
($what,$value) = split /=/ ;
234
$kdelnk{ucfirst lc $what}=$value;
237
if (defined $kdelnk{"Type"}) {
238
if ($kdelnk{"Type"} ne "Application" ) {
239
print STDERR "Type is not Application : $file !\n" ;
243
print STDERR "has no Type= defaults to Application : $file !\n" ;
245
if (! defined $kdelnk{"Exec"}) {
246
print STDERR "has no Exec= : $file !\n" ;
250
if (defined $kdelnk{"Mimetype"} && ! $kdelnk{"Mimetype"} eq '') {
252
$execline = $kdelnk{"Exec"};
253
$execline =~ s/%f/%s/;
254
$execline =~ s/%c/$kdelnk{"Name"}/;
257
$execline =~ s/%u/%s/;
258
$mimeline = $kdelnk{"Mimetype"};
259
@mimetypes = split(';', $mimeline);
260
foreach $mimetype (@mimetypes) {
261
print MIME "$mimetype; $execline;" . 'test=test "$DISPLAY" != ""; priority=7' . "\n";
266
($prog,)=split / /, $kdelnk{"Exec"} ;
267
if (! defined($type{$prog})) {
268
open MENUIN, ">>debian/menu.in" ;
269
print MENUIN "$prog x11 NONE\n";
273
if ($sect{$prog} eq "NONE") { next ; }
275
if (not defined $kdelnk{"Name"}) {
276
print STDERR "No Name : $package $kdelnk\n";
279
if (defined $kdelnk{"Icon"}) {
280
$icon=$kdelnk{"Icon"} ;
281
if (! -f "debian/tmp/$kde_icondir/mini/$prog.png" ) {
284
$icon="/$kde_icondir/mini/$prog.png";
287
($kdelnk=$file) =~ s/^.*tmp// ;
288
print MENU "?package($package):\\\n" ;
289
print MENU " needs=$type{$prog}\\\n" ;
290
print MENU " section=$sect{$prog}\\\n" ;
291
print MENU " title=\"$kdelnk{Name}\"\\\n" ;
292
print MENU " command=$prog\\\n" ;
293
print MENU " icon=\"$icon\"\n\n" ;
297
if (-e "debian/menu.add") {
298
open MENUADD, "debian/menu.add" ;
307
if (-z "debian/menu") {
313
if (-z "debian/mailcap") {
314
rm("debian/mailcap");
316
mkdir("-p", "debian/tmp/usr/lib/mime/packages");
317
cp("debian/mailcap", "debian/tmp/usr/lib/mime/packages/$package");