rename-instantfpc-to-ifpc
authorPascal Packaging Team <pkg-pascal-devel@lists.alioth.debian.org>
Sun, 22 Apr 2018 14:10:23 +0000 (15:10 +0100)
committerAbou Al Montacir <abou.almontacir@sfr.fr>
Sun, 22 Apr 2018 14:10:23 +0000 (15:10 +0100)
This patch renames instantfpc to ifpc (Instant Free Pascal Compiler) and adds
man files for it.

Gbp-Pq: Name rename-instantfpc-to-ifpc.patch

fpcsrc/utils/instantfpc/Makefile.fpc
fpcsrc/utils/instantfpc/fpmake.pp
fpcsrc/utils/instantfpc/ifpc.pas [new file with mode: 0644]
fpcsrc/utils/instantfpc/instantfpc.pas
install/man/man1/ifpc.1 [new file with mode: 0644]

index bea9df11c2396ac4010efb789b719c9005d64036..3105fd050340edcc97b402e4ce1de2676e564ada 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 [package]
-name=instantfpc
+name=ifpc
 version=3.0.4
 
 [require]
index e908814ae37d697e3873fa97749b7c4e1f22a8c1..d1152ed68c98309bbdb9a0eda4b7fae2bb8726f5 100644 (file)
@@ -15,7 +15,7 @@ begin
   With Installer do
     begin
     P:=AddPackage('utils-instantfpc');
-    P.ShortName:='instantfpc';
+    P.ShortName:='ifpc';
 
     P.Author := '<various>';
     P.License := 'LGPL with modification';
@@ -32,7 +32,7 @@ begin
 
     P.OSes := [win32,win64,wince,haiku,linux,freebsd,openbsd,netbsd,darwin,iphonesim,solaris,aix];
 
-    T:=P.Targets.AddProgram('instantfpc.pas');
+    T:=P.Targets.AddProgram('ifpc.pas');
     T.Dependencies.AddUnit('instantfptools');
 
     P.Targets.AddUnit('instantfptools.pas').Install:=False;
diff --git a/fpcsrc/utils/instantfpc/ifpc.pas b/fpcsrc/utils/instantfpc/ifpc.pas
new file mode 100644 (file)
index 0000000..c15c9ae
--- /dev/null
@@ -0,0 +1 @@
+{$INCLUDE instantfpc.pas}
index b8dd584601dffcec487229b2cbf0496af91ad69b..7296ce8b57a6ba4ee26c4ca00bf30d3a7aa31bfa 100644 (file)
@@ -28,39 +28,40 @@ const
   Version = '1.3';
   // 1.3 compile in a separate directory, so that parallel invocations do not overwrite link.res files
 
+var
+  BinPath, BinName: string;
 
 Procedure Usage(Err : string);
-
 begin
   if (Err<>'') then
     Writeln('Error : ',Err);
-  writeln('instantfpc '+Version);
+  writeln(BinName, ' ', Version);
   writeln;
   writeln('Run pascal source files as scripts.');
   writeln('Normal usage is to add to a program source file a first line');
-  writeln('("shebang") "#!/usr/bin/instantfpc".');
+  writeln('("shebang") "#!', BinPath, BinName, '".');
   writeln('Then you can execute the source directly in the terminal/console.');
   writeln;
-  writeln('instantfpc -h');
+  writeln(BinName, ' -h');
   writeln('      Print this help message and exit.');
   writeln;
-  writeln('instantfpc -v');
+  writeln(BinName, ' -v');
   writeln('      Print version and exit.');
   writeln;
-  writeln('instantfpc [compiler options] <source file> [program parameters]');
+  writeln(BinName, ' [compiler options] <source file> [program parameters]');
   writeln('      Compiles source and runs program.');
   writeln('      Source is compared with the cache. If cache is not valid then');
   writeln('      source is copied to cache with the shebang line commented and');
   writeln('      cached source is compiled.');
   writeln('      If compilation fails the fpc output is written to stdout and');
-  writeln('      instantfpc exits with error code 1.');
+  writeln('      ', BinName, ' exits with error code 1.');
   writeln('      If compilation was successful the program is executed.');
   writeln('      If the compiler options contains -B the program is always');
   writeln('      compiled.');
   writeln('      If the environment option INSTANTFPCOPTIONS is set it is');
   writeln('      passed to the compiler as first parameters.');
   writeln;
-  writeln('instantfpc --get-cache');
+  writeln(BinName, ' --get-cache');
   writeln('      Prints current cache directory and exit.');
   writeln;
   writeln('Options:');
@@ -106,7 +107,7 @@ begin
   if (P='') then exit;
   if p='-v' then 
     begin
-    writeln('instantfpc '+Version);
+    writeln(BinName, ' ', Version);
     Halt(1);
     end
   else if p='-h' then 
@@ -139,6 +140,8 @@ begin
   { For example:
       /usr/bin/instantfpc -MObjFpc -Sh ./envvars.pas param1
   }
+  BinPath := ExtractFilePath(ParamStr(0));
+  BinName := 'ifpc';
   for i:=1 to Paramcount do 
     begin
     p:=ParamStr(i);
diff --git a/install/man/man1/ifpc.1 b/install/man/man1/ifpc.1
new file mode 100644 (file)
index 0000000..0e12e0b
--- /dev/null
@@ -0,0 +1,54 @@
+.TH ifpc 1 "18 May 2013" "Free Pascal" "Instant pascal code interpreter"
+.SH NAME
+ifpc \- The Free Pascal Interpreter.
+
+.SH SYNOPSIS
+
+.B ifpc
+[\fI\-h\fR] [\fI\-v\fR] [\fIcompiler options\fR] <\fIsource file\fR>
+[\fIprogram parameters\fR]
+
+.SH DESCRIPTION
+
+.B ifpc
+This is a pascal code interpreter program. It compiles source and runs the
+ generated program.
+
+Source is compared with the cache. If cache is not valid then then source is
+copied to cache with the shebang line commented and cached source is compiled.
+If compilation fails the fpc output is written to stdout and and exit code 1
+is returned
+If compilation was successful the program is executed.
+If the compiler options contains \-B the program is always recompiled.
+If the environment option INSTANTFPCOPTIONS is set it is passed to compiler as
+the first parameters.
+
+.SH USAGE
+
+.B ifpc
+takes the following arguments:
+.TP
+.B \-h
+Prints this help message and exit.
+.TP
+.B \-v
+Prints version and exit.
+.TP
+.B \-\-get\-cache
+Prints current cache directory and exit.
+.TP
+.B \-\-set\-cache=<path to cache>
+Set the cache to be used. Otherwise using environment variable INSTANTFPCCACHE.
+.TP
+.B \-\-compiler=<path to compiler>
+Normally fpc is searched in PATH and used as compiler.
+.TP
+.B \-\-skip\-run
+Do not execute the program. Useful to test if script compiles
+.TP
+.B \-B
+Always recompile.
+
+.SH SEE ALSO
+.IP
+.BR  fpc (1)