3 ## Written 2006 by Julia Dubenskaya
4 ## for the OpenXPKI project
5 ## (C) Copyright 2006 by The OpenXPKI Project
14 my ${PORT_NAME
}=$ARGV[0];
15 my ${PKGNAME_PREFIX
}="p5-";
18 open(SOURCE_FILE
,"<${PORT_PATH}/pkg-plist.0");
19 open(TARGET_FILE
,">${PORT_PATH}/pkg-plist");
20 while ($line = <SOURCE_FILE
>) {
23 $line =~ s/lib\/perl5\/5.8.8\
/man\/man
3\
//\t/;
24 $line =~ s/man\/man1\//\t/;
25 $line =~ s/lib\/perl5\/site_perl\
/5.8.8/\
%\
%SITE_PERL\
%\
%/;
26 $line =~ s/\/mach\//\/\
%\
%PERL_ARCH\
%\
%\
//;
27 $line =~ s/share\/${PORT_NAME}/\
%\
%DATADIR\
%\
%/;
28 $line =~ s/(dirrm)([^t])/$1try$2/;
29 $line =~ s/share\/examples\/${PORT_NAME
}/\%\%EXAMPLESDIR\%\%/;
30 $line =~ s/share\/doc\/${PORT_NAME
}/\%\%DOCSDIR\%\%/;
32 $line =~ s/\A(.*\%\%DOCSDIR\%\%)/\%\%PORTDOCS\%\%$1/;
33 $line =~ s/\A(.*\%\%DATADIR\%\%)/\%\%PORTDATA\%\%$1/;
34 $line =~ s/\A(.*\%\%EXAMPLESDIR\%\%)/\%\%PORTEXAMPLES\%\%$1/;
36 if ($line =~ m/\.1$/) {
37 $man1 .= $line." \\\n";
39 elsif ($line =~ m/\.3$/) {
40 $man3 .= $line." \\\n" if ($line =~ m/\.3$/);
43 print TARGET_FILE
"$line\n" if (($line !~ m/share\/nls
/) and
44 (($line !~ m/dirrm/) or
45 ($line =~ m/openxpki/i) or ($line =~ m/DATADIR/i) or
46 ($line =~ m/DOCSDIR/i) or
47 ($line =~ m/EXAMPLESDIR/) or ($line =~ m/share/)
58 open(SOURCE_MAKEFILE
,"<${PORT_PATH}/Makefile.bak");
59 open(TARGET_MAKEFILE
,">${PORT_PATH}/Makefile");
61 my $MAKEFILE_DATA = "";
62 while ($line = <SOURCE_MAKEFILE
>) {
64 $MAKEFILE_DATA .= $line."\n";
67 $MAKEFILE_DATA =~ s/MAN1=(.*\s*)*\.1\s/$man1/m;
68 $MAKEFILE_DATA =~ s/MAN3=(.*\s*)*\.3\s/$man3/m;
70 print TARGET_MAKEFILE
$MAKEFILE_DATA;
72 close(SOURCE_MAKEFILE
);
73 close(TARGET_MAKEFILE
);