# possible to install pdftk?



## mabu (Feb 26, 2013)

I've got several FreeBSD boxes and I cannot seem to install pdftk on any of them (7.0-R, 6.2-R)

Installing pdftk from /usr/ports/print/pdftk generates numerous errors.
pkg_add -r pdftk fails, not being able to find the package.
Downloading and trying to manually compile the software also fails with bizarre "operator not found" errors in the Makefile.

Has ANYBODY managed to get this program running under any version of FreeBSD?   Any advice?


----------



## wblock@ (Feb 26, 2013)

This is a good news/bad news thing.

The good news is that print/pdftk just compiled for me on 9.1-STABLE.

The bad news is that the ports tree does not work on very old versions of FreeBSD.  I'm not sure exactly why, and it's hard to justify trying to fix it because those old versions are no longer supported.  It's time to upgrade.


----------



## SirDice (Feb 26, 2013)

mabu said:
			
		

> I've got several FreeBSD boxes and I cannot seem to install pdftk on any of them (7.0-R, 6.2-R)


Both are end-of-life and unsupported.

FreeBSD 7.0 End-of-Life April 2009
FreeBSD 6.2 End-of-Life May 2008

http://www.freebsd.org/security/#unsup


----------



## mabu (Feb 26, 2013)

Is there anybody who can help me get this installed on one of my existing servers without having to upgrade?  The boxes are running beautifully and I just want to install a port or package.. I'll paypal anybody who can help.

This is pretty frustrating that older versions are no longer supported.    I don't understand why there cannot be a somewhat version independent ports/packages system that works properly?


----------



## wblock@ (Feb 26, 2013)

mabu said:
			
		

> This is pretty frustrating that older versions are no longer supported.    I don't understand why there cannot be a somewhat version independent ports/packages system that works properly?



It's a common complaint with pretty much every type of technology.  You can choose a point to stop, but that's it--ports or new features will be compatible for a while, but not forever.

It is just not practical to keep support going for old versions forever.  FreeBSD does not have enough people to do that, and most users prefer ongoing improvement anyway.

Fortunately, FreeBSD upgrades are not bad at all compared to other operating systems.  Although it does get more difficult the longer you wait.


----------



## SirDice (Feb 27, 2013)

I'd update to 8.3, 7.4 is going to be end-of-life at the end of this month too. That will mark the end of the entire 7.x branch. FreeBSD 8.3 will at least be supported till April 2014. Plenty of time to test with 9.x.


----------



## mabu (Feb 27, 2013)

To be honest I've never upgraded the core OS.  I typically install the latest version, lock it up tight and then only update necessary systems like bind, mail, ssl, etc.   Is it possible to update the OS on a production server without interruption?


----------



## SirDice (Feb 27, 2013)

mabu said:
			
		

> Is it possible to update the OS on a production server without interruption?


You will have some downtime, the machine has to be rebooted at the very least.


----------



## wblock@ (Feb 27, 2013)

To reduce downtime to a minimum, back up and restore the backup on another system.  Then upgrade that one.

The alternate way is to install the latest FreeBSD on a new system, then transfer data and adjust configs so newer equivalents of all the old applications are running.  When that's complete, resync the data from the old server and swap them.


----------



## mabu (Feb 27, 2013)

I don't mind some downtime to reboot, but is there any possibility the upgrade could brick the device?  If unlikely, I'd be willing to try an upgrade.  It may sound silly but I have never done it.  I haven't had a need to.  I've found the kernel to be solid for my apps and I only update the apps that are exposed or need updating.


----------



## wblock@ (Feb 27, 2013)

It is always possible that an upgrade could have undesired side effects.  That's why testing on a separate system is valuable.  It's particularly valuable when the upgrade is a big one, like going from FreeBSD 6 to 9.


----------



## SirDice (Feb 27, 2013)

Practice it a few times 

You should still be able to download the old ISOs. Set up a virtual machine, install one of the versions you have and try a couple of update runs. On the old machines you should be able to run pkg_create(1) and create packages of the things that are installed. With these packages it should be easy to replicate your production environment in a virtual machine. Then go nuts on it until you're comfortable enough to do it for real 

While you're at it, create another virtual machine with the desired version you hope to end with. Use that to build everything from ports and create packages from them. You can use those packages to set up your new servers. Build once, install many :e

If you plan and prepare things your downtime should be fairly minimal. I can set up a machine from scratch in about an hour, from nothing to a fully functioning server. But you will probably spend the most time transferring (and perhaps converting) your old data to the new servers.


----------



## mabu (Feb 28, 2013)

Is there a good source for info on upgrading the OS?  I have to admit I have not done this and it's a scary proposition... I still have production FreeBSD servers running 2.x and they're rock solid and never had a problem (of course they're running latest versions of ssl, bind, etc.)    What's the best reference on updating the OS for someone who's kinda scared of that?  Or is there a way to hack the ports and pkg system so it thinks it's the latest version?  maybe that's better?

Seriously... does pdftk give a shit whether I'm running FreeBSD 6, 7 or 9?


----------



## SirDice (Feb 28, 2013)

There have been several security bugs in the base OS, some of them quite serious. Running an old and unsupported version is just begging to get hacked. Sure, it's not accessible from the internet. But these days you have much more to fear from your own employees.


----------



## mabu (Feb 28, 2013)

Not an issue in my installation.  But if there's any additional resources on upgrading, or how to tell the ports and package system to draw from a newer set of files, let me know.


----------



## SirDice (Feb 28, 2013)

Upgrading can be done using freebsd-update(8) (binary update) or by building world (source update).


----------



## mabu (Mar 8, 2013)

Interestingly enough, I ran `# make update` on the ports collection as a whole and then ran make in /usr/ports/print/pdftk and it installed on one box, but not on the other.  Both servers should have identical configurations for the most part.

I get all these errors on one machine:


```
make
===>  Extracting for pdftk-1.45
=> SHA256 Checksum OK for pdftk-1.45-src.zip.
===>   pdftk-1.45 depends on file: /usr/local/bin/unzip - found
===>  Patching for pdftk-1.45
===>  Applying FreeBSD patches for pdftk-1.45
===>   pdftk-1.45 depends on executable: gmake - found
===>   pdftk-1.45 depends on executable: gcc47 - found
===>   pdftk-1.45 depends on file: /usr/local/bin/as - found
===>   pdftk-1.45 depends on shared library: iconv.3 - found
===>  Configuring for pdftk-1.45
===>  Building for pdftk-1.45
Makefile.Base:35: warning: overriding commands for target `javalib'
Makefile.Base:35: warning: ignoring old commands for target `javalib'
Makefile.Base:38: warning: overriding commands for target `attachments.o'
Makefile.Base:38: warning: ignoring old commands for target `attachments.o'
Makefile.Base:41: warning: overriding commands for target `report.o'
Makefile.Base:41: warning: ignoring old commands for target `report.o'
Makefile.Base:44: warning: overriding commands for target `pdftk.o'
Makefile.Base:44: warning: ignoring old commands for target `pdftk.o'
Makefile.Base:47: warning: overriding commands for target `pdftk'
Makefile.Base:47: warning: ignoring old commands for target `pdftk'
Makefile.Base:50: warning: overriding commands for target `install'
Makefile.Base:50: warning: ignoring old commands for target `install'
Makefile.Base:53: warning: overriding commands for target `uninstall'
Makefile.Base:53: warning: ignoring old commands for target `uninstall'
Makefile.Base:56: warning: overriding commands for target `clean'
Makefile.Base:56: warning: ignoring old commands for target `clean'
gmake -f Makefile -iC ../java all
gmake[1]: Entering directory `/usr/ports/print/pdftk/work/pdftk-1.45-dist/java'
cpp -C -P com/lowagie/text/pdf/PdfEncryption.java.c com/lowagie/text/pdf/PdfEncryption.java
/usr/local/bin/gcj47 -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc47 -w -Wall -Wextra -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." -C com/lowagie/text/Anchor.java
gcj47: error trying to exec 'ecj1': execvp: No such file or directory
gmake[1]: [com/lowagie/text/Anchor.class] Error 1 (ignored)
/usr/local/bin/gcjh47 -force --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." com/lowagie/text/Anchor
Exception in thread "main" java.io.IOException: can't find class file com/lowagie/text/Anchor.class in java.net.URLClassLoader{urls=[file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/,file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/./,file:/usr/local/share/java/libgcj-4.7.0.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at gnu.classpath.tools.javah.Main.getClass(Unknown Source)
   at gnu.classpath.tools.javah.Main.run(Unknown Source)
   at gnu.classpath.tools.javah.GcjhMain.main(Unknown Source)
gmake[1]: [com/lowagie/text/Anchor.h] Error 1 (ignored)
/usr/local/bin/gcj47 -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc47 -w -Wall -Wextra -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." -C com/lowagie/text/Annotation.java
gcj47: error trying to exec 'ecj1': execvp: No such file or directory
gmake[1]: [com/lowagie/text/Annotation.class] Error 1 (ignored)
/usr/local/bin/gcjh47 -force --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." com/lowagie/text/Annotation
Exception in thread "main" java.io.IOException: can't find class file com/lowagie/text/Annotation.class in java.net.URLClassLoader{urls=[file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/,file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/./,file:/usr/local/share/java/libgcj-4.7.0.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at gnu.classpath.tools.javah.Main.getClass(Unknown Source)
   at gnu.classpath.tools.javah.Main.run(Unknown Source)
   at gnu.classpath.tools.javah.GcjhMain.main(Unknown Source)
gmake[1]: [com/lowagie/text/Annotation.h] Error 1 (ignored)
/usr/local/bin/gcj47 -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc47 -w -Wall -Wextra -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." -C com/lowagie/text/BadElementException.java
gcj47: error trying to exec 'ecj1': execvp: No such file or directory
gmake[1]: [com/lowagie/text/BadElementException.class] Error 1 (ignored)
/usr/local/bin/gcjh47 -force --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." com/lowagie/text/BadElementException
Exception in thread "main" java.io.IOException: can't find class file com/lowagie/text/BadElementException.class in java.net.URLClassLoader{urls=[file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/,file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/./,file:/usr/local/share/java/libgcj-4.7.0.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at gnu.classpath.tools.javah.Main.getClass(Unknown Source)
   at gnu.classpath.tools.javah.Main.run(Unknown Source)
   at gnu.classpath.tools.javah.GcjhMain.main(Unknown Source)
gmake[1]: [com/lowagie/text/BadElementException.h] Error 1 (ignored)
/usr/local/bin/gcj47 -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc47 -w -Wall -Wextra -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." -C com/lowagie/text/Chunk.java
gcj47: error trying to exec 'ecj1': execvp: No such file or directory
gmake[1]: [com/lowagie/text/Chunk.class] Error 1 (ignored)
/usr/local/bin/gcjh47 -force --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." com/lowagie/text/Chunk
Exception in thread "main" java.io.IOException: can't find class file com/lowagie/text/Chunk.class in java.net.URLClassLoader{urls=[file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/,file:/usr/ports/print/pdftk/work/pdftk-1.45-dist/java/./,file:/usr/local/share/java/libgcj-4.7.0.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at gnu.classpath.tools.javah.Main.getClass(Unknown Source)
   at gnu.classpath.tools.javah.Main.run(Unknown Source)
   at gnu.classpath.tools.javah.GcjhMain.main(Unknown Source)
gmake[1]: [com/lowagie/text/Chunk.h] Error 1 (ignored)
/usr/local/bin/gcj47 -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc47 -w -Wall -Wextra -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/usr/ports/print/pdftk/work/pdftk-1.45-dist/java:." -C com/lowagie/text/DocListener.java
gcj47: error trying to exec 'ecj1': execvp: No such file or directory
gmake[1]: [com/lowagie/text/DocListener.class] Error 1 (ignored)



.etc.
```

Any idea what's wrong?  I tried `# make distclean` and that didn't help.


----------

