Opened 9 years ago

Closed 7 years ago

#47801 closed request (fixed)

Proposal for adding more recent rpcgen (from FreeBSD2007)

Reported by: pmusumeci@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: kurthindenburg (Kurt Hindenburg), mojca (Mojca Miklavec)
Port: rpcgen

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hi,

I have been helping the maintainer of the Octave package for Instrument Control get his software building on OS-X. The major issue was that rpcgen in OS-X is an older version that does not support the '-M' thread-safe code generation option. I found that a relatively recent (but not the most recent) copy of the FreeBSD sources for Sun Microsystems' rpcgen will build as-is so I would like to ask if we can have this rpcgen available as a MacPort. Could the more recent rpcgen be added to MacPorts?

Below is a small script that downloads and builds rpcgen from a 2007 era FreeBSD-current. To show the difference in use options, I have also included the help message from both rpcgen - the first is for OS-X rpcgen which mentions that it is has a SunOS 4.1 compatibility mode and the second is the more recent FreeBSD version which has the new '-M' switch and mentions FreeBSD 4.X compatibility.

Thanks,
Phillip Musumeci

#
# Simply download FreeBSD-current rpcgen sources and build for OS-X
# - Some octave packages require a more modern version of rpcgen. The
#   Sun Microsystems version of rpcgen as found in FreeBSD in 2007 will
#   build as-is, so we use it to replace a much earlier OS-X version.
#
# p.musumeci@ieee.org 21-May-2015
#

SRV=http://mirror.ancl.hawaii.edu/pub/FreeBSD/FreeBSD-current/src/usr.bin/rpcgen

SRC="Makefile rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c rpc_parse.c rpc_parse.h rpc_sample.c rpc_scan.c rpc_scan.h rpc_svcout.c rpc_tblout.c rpc_util.c rpc_util.h rpcgen.1"

mkdir -p sun_rpcgen
cd sun_rpcgen

for x in $SRC ; do
  echo "Downloading $x"
  fetch -m $SRV/$x
  done

########################################
mv Makefile Makefile.sun
echo '# Simple build of rpcgen

all:
        cc -O -o rpcgen *.c
' > Makefile

########################################
echo 'These files for Sun Microsystems rpcgen were downloaded from

http://mirror.ancl.hawaii.edu/pub/FreeBSD/FreeBSD-current/src/usr.bin/rpcgen

and used as-is to build an rpcgen on OS-X.' > README.txt

########################################
ls -l
echo 'Build command: cc -O -o rpcgen *.c'

Current OS-X

giotto $ /usr/bin/rpcgen 
usage:  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/rpcgen infile
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/rpcgen [-a][-b][-C][-Dname[=value]] -i size  [-I [-K seconds]] [-A][-L][-M toolkit][-N][-T] infile
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/rpcgen [-c | -h | -l | -m | -t | -Sc | -Ss] [-o outfile] [infile]
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/rpcgen [-s nettype]* [-o outfile] [infile]
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/rpcgen [-n netid]* [-o outfile] [infile]
options:
-A              generate svc_caller() function
-a              generate all files, including samples
-b              backward compatibility mode (generates code for SunOS 4.1)
-c              generate XDR routines
-C              ANSI C mode
-Dname[=value]  define a symbol (same as #define)
-h              generate header file
-i size         size at which to start generating inline code
-I              generate code for inetd support in server (for SunOS 4.1)
-K seconds      server exits after K seconds of inactivity
-l              generate client side stubs
-L              server errors will be printed to syslog
-m              generate server side stubs
-n netid        generate server code that supports named netid
-N              supports multiple arguments and call-by-value
-o outfile      name of the output file
-s nettype      generate server code that supports named nettype
-Sc             generate sample client code that uses remote procedures
-Ss             generate sample server code that defines remote procedures
-t              generate RPC dispatch table
-T              generate code to support RPC dispatch tables
-Y path         directory name to find C preprocessor (cpp)

FreeBSD from around 2007

giotto $ rpcgen
usage: rpcgen infile
       rpcgen [-abCLNTM] [-Dname[=value]] [-i size][-I -P [-K seconds]] [-Y path] infile
       rpcgen [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm][-o outfile] [infile]
       rpcgen [-s nettype]* [-o outfile] [infile]
       rpcgen [-n netid]* [-o outfile] [infile]
options:
-a              generate all files, including samples
-b              backward compatibility mode (generates code for FreeBSD 4.X)
-c              generate XDR routines
-C              ANSI C mode
-Dname[=value]  define a symbol (same as #define)
-h              generate header file
-i size         size at which to start generatinginline code
-I              generate code for inetd support in server
-K seconds      server exits after K seconds ofinactivity
-l              generate client side stubs
-L              server errors will be printed to syslog
-m              generate server side stubs
-M              generate MT-safe code
-n netid        generate server code that supportsnamed netid
-N              supports multiple arguments andcall-by-value
-o outfile      name of the output file
-P              generate code for port monitoring support in server
-s nettype      generate server code that supports namednettype
-Sc             generate sample client code that uses remoteprocedures
-Ss             generate sample server code that definesremote procedures
-Sm             generate makefile template 
-t              generate RPC dispatch table
-T              generate code to support RPC dispatch tables
-Y path         path where cpp is found

Attachments (2)

sh.get_sun_rpcgen (1.1 KB) - added by pmusumeci@… 9 years ago.
This script will download and build rpcgen from FreeBSD
rpcgen_help_messages_from_OSXandFreeBSD.txt (3.7 KB) - added by pmusumeci@… 9 years ago.
Did not realise ticket text was reformatted - here are the respective rpcgen help messages

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by pmusumeci@…

Attachment: sh.get_sun_rpcgen added

This script will download and build rpcgen from FreeBSD

Changed 9 years ago by pmusumeci@…

Did not realise ticket text was reformatted - here are the respective rpcgen help messages

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: rpcgen removed
Port: rpcgen added
Version: 2.3.3

You have to use WikiFormatting.

comment:2 Changed 8 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

comment:3 Changed 8 years ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:5 Changed 7 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed

In 2f0c840119972d5a3579d6ee38423eb0c0a2e2de/macports-ports:

rpcgen-mt: new port

Mac ships its own rpcgen, but without support for the "-M" flag.

Upstream version of this software might not be available,
so we fetch it from FreeBSD's repository.

The '-mt' suffix was added to avoid a conflict with developer_cmds.

Closes: #47801

Note: See TracTickets for help on using tickets.