[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Puff 2.1: Ham package candidate



Added it to the debian/ directory and modified Makefile to generate a
puff.real

Could someone convert the attached to a dpatch series?

I will if I get the time to do so...

Where should I be committing this?  Should I log in to alioth and create
a new git repo in the co-maintained area?

C.J.


On Wed, 2013-02-13 at 18:35 -0800, Kiavash F wrote:
> Looks like I sent my email a little late and I see you maybe having an
> amd64 distro.
> 
> b/c puff always looking for a file to load on its start, if you don't
> setup a name, it will try to load setup.puf, I made this sript and put
> it in /usr/bin. I have plenty of comments on it while I was writing
> it.
> 
> 73,
> 
> On Wed, Feb 13, 2013 at 6:29 PM, C.J. Adams-Collier KF7BMP
> <cjac@colliertech.org> wrote:
>         Okay.  compiled with a minor modification to the Makefile.  I
>         have not
>         yet built the debian/ directory.
>         
>         
>         On Wed, 2013-02-13 at 18:02 -0800, C.J. Adams-Collier KF7BMP
>         wrote:
>         > depends on fpc.  written in pascal, eh?  That was my first
>         ever
>         > language.  I even did some libsvga stuff with it.
>          Interacted with the
>         > mouse using assembler and raising interrupts.  Good times.
>          Good times.
>         >
>         > I am building now.  I will see if I can build a debian/
>         directory.
>         >
>         >
>         > On Mon, 2013-01-21 at 14:08 -0800, Kiavash F wrote:
>         > > Hi Dear Debian ham team,
>         > >
>         > > I have recently noticed that PUFF 2.1 CAD Microwave
>         Software has been
>         > > GPL'd as of 2010. I was introduced to this useful small
>         program, back
>         > > in undergrad. At that time, It was only available on DOS
>         and microwave
>         > > tools were sparse and "GUI based OS's" weren't that
>         popular. For many
>         > > years I used DOSBOX to continue using PUFF for my HAM
>         designs and
>         > > calculations.
>         > >
>         > > Now back in 2013, this tool is opened sourced and ported
>         to Linux
>         > > (http://wwwhome.cs.utwente.nl/~ptdeboer/ham/puff/). I
>         followed the
>         > > readme file and successfully built the executables under
>         Ubuntu (I
>         > > know it is not Debian!), thinking this tool is missing in
>         the wider
>         > > world of Linux users (there is no good open sourced
>         industrial grade
>         > > Microwave cad tool that I am aware of). Having said that,
>         it would be
>         > > great if PUFF can be added to Debian ham programs, but....
>         My
>         > > knowledge of programing and packing and ... is very very
>         limited and I
>         > > wish I could picked up the task by myself. That is where
>         your help
>         > > comes in. Would you mind to take a look at PUFF and think
>         about
>         > > packaging it for (at least) x86/64 Debian releases?
>         > >
>         > > Thanks in advance,
>         > > Kiavash
>         >
>         
> 

commit 7e74ff7ef4bb57e018b17bfde28a732b6afeeb6e
Author: C.J. Adams-Collier <cjac@colliertech.org>
Date:   Wed Feb 13 20:06:41 2013 -0800

    added a wrapper script, made it compile on my system - x86_64 only at this time

diff --git a/Makefile b/Makefile
index 9c3627f..26923e7 100644
--- a/Makefile
+++ b/Makefile
@@ -5,20 +5,22 @@ CFLAGS = -O2 -g
 
 POBJS =	puff.o pfart.o pffft.o pfmsc.o pfrw.o pfst.o pfun1.o pfun2.o pfun3.o xgraph.o
 
-puff:	$(POBJS) puff_c.o ppas.sh
-	sed 's/link.res/link.res puff_c.o \/usr\/lib\/libX11.so/' <ppas.sh  >ppasx.sh
-	sh ppasx.sh
+# /usr/lib/x86_64-linux-gnu/libX11.so
+puff.real:	$(POBJS) puff_c.o ppas.sh
+	sed 's/link.res/-T link.res puff_c.o \/usr\/lib\/x86_64-linux-gnu\/libX11.so/' <ppas.sh  >ppasx.sh
+	sed 's/-o puff/-o puff.real/' <ppasx.sh  >ppasy.sh
+	sh ppasy.sh
 
 %.o:	%.pas
 	$(PASCALCOMPILER) -g $< -Cn
 
 ppas.sh:	puff.pas
-	$(PASCALCOMPILER) -g -s -a -T puff.pas
+	$(PASCALCOMPILER) -g -s -a puff.pas
 
 # version: 20100115
 
 clean:
-	rm -rf puff
+	rm -rf puff.real
 	rm -rf *.o
 	rm -rf *.s
 	rm -rf *.ppu
diff --git a/debian/puff b/debian/puff
new file mode 100644
index 0000000..7587e15
--- /dev/null
+++ b/debian/puff
@@ -0,0 +1,52 @@
+#!/bin/bash
+# This script makes sure that the design file is passed correctly to puff
+
+# important parameters
+PUFFexecLocation=/opt/puff
+PUFFuserFolder=.puff
+setupfile=setup.puf
+
+#let's see if we are aksed to open a design file
+if [ ! -z "${1}" ];
+	then
+		#yes we are asked to open something
+		# $1 arg will tell us what design file we need to pass along
+		if [ -f $1 ]; 		# Let's first check if it exists
+			then
+				designfilepath=`readlink -f $1`
+				echo $designfilepath
+				designfilebase=`dirname $designfilepath`
+				echo $designfilebase
+				cd $designfilebase
+				ls
+				# If the design file is there, then we will load into puff
+    			exec $PUFFexecLocation/puff $designfilepath
+    			exit 		# let's get out of here
+			else
+				# but if it is not there we will stop
+				echo "File not found."
+				exit -1		# reporting error!
+		fi
+	else
+		# no arg was passed.
+
+		# do we have ~/.puff folder?
+		if [ ! -d "$HOME/$PUFFuserFolder" ]
+			then		# no we don't have the folder
+				# I guess it is the 1st time that we are running puff (or maybe not)
+				# let's make the folder
+				mkdir $HOME/$PUFFuserFolder		
+				# and copy the default files there (no overwrite)
+				cp -n --no-preserve=ownership $PUFFexecLocation/share/* $HOME/$PUFFuserFolder/
+		fi
+		# now we have the puff default folder for sure.
+		
+		# do we have default setup file in defaul folder?
+		if [ ! -f "$HOME/$PUFFuserFolder/$setupfile" ];
+			then				# no we don't
+				# let's copy the default setup file there
+				cp --no-preserve=ownership $PUFFexecLocation/share/$setupfile $HOME/$PUFFuserFolder/$setupfile
+		fi
+		# and run puff normally
+		exec $PUFFexecLocation/puff $HOME/$PUFFuserFolder/$setupfile
+fi

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: