Blog Viewer

Scripting How-To: Install ANYCONF and JUISE on FreeBSD 9

By Erdem posted 08-05-2015 18:29

  

Installing ANYCONF and JUISE on FreeBSD 9

 

Some tools or libraries might be included in your installation depending on which options (such as development packages) you chose to install FreeBSD 9. The rest of the tools and libraries either need to be installed from ports or downloaded from the Internet as tar.gz archives, and then copied to the system, extracted, configured, and installed.

 

IMPORTANT: Because you will end up with more than one version of certain packages installed after the installation completes, you must rename or remove the legacy packages so that JUISE and ANYCONF can locate the correct binaries.

 

To make sure you have the necessary components installed, follow this process. If you are missing anything, you can run a dependency scan to find the missing components.

 

Prepare FreeBSD for JUISE and ANYCONF

Download and install the following either from ports or source:

bash

1

cd /usr/ports/shells/bash && make install clean

gcc

1

cd /usr/ports/lang/gcc && make install clean

gmake

1

cd /usr/ports/devel/gmake && make install clean

autoconf

1

cd /usr/ports/devel/autoconf && make install clean

automake

1

cd /usr/ports/devel/automake && make install clean

bison

1

cd /usr/ports/devel/bison && make install clean

Libxml2-dev 2.7.8

1

cd /usr/ports/textproc/libxml2 && make install clean

Libxslt-dev 1.1.26

1

cd /usr/ports/textproc/libxslt && make install clean

Libssl-dev 1.0.1

1

cd /usr/ports/security/openssl && make install clean

2

cd /usr/ports/devel/mingw32-openssl && make install clean

Libcurl 7.22.0

1

cd /usr/ports/ftp/curl && make install clean

 

FreeBSD ports is version 7.21 and will work but you can download it from http://curl.haxx.se/download.html and compile from source.

Libreadline6 6.2-8

1

cd /usr/ports/devel/readline && make install clean

 

Readline is shipped as a standard library on most GNU/Linux and FreeBSD systems.

Libslax-0.12.2

  1. Download LIBSLAX: http://code.google.com/p/libslax/.
  2. Copy the tar.gz archive to the system.
  3. Extract.

1

FreeBSDserver# tar –xvf libslax-0.12.2.tar.gz

2

cd libslax-0.12.2/

 

3

./configure

4

make install clean

Libssh2-1.4.3

1

cd /usr/ports/security/libssh2 && make install clean

Openssh 5.9p1

  1. Download the latest version from http://mirrors.nycbug.org/pub/OpenBSD/OpenSSH/portable/.
  2. Copy the tar.gz archive to the system.
  3. Extract.

1

FreeBSDserver# tar –xvf openssh-6.1p1.tar.gz

2

cd openssh-6.1p1\

 

3

./configure

4

make install clean

 

The ports version is OpenSSH 5.8 and would work as well.

GNU 1.1.5

  1. Download the latest version from http://software.frodo.looijaard.name/getopt/download.php.
  2. Copy the tar.gz archive to the system.
  3. Extract.

1

FreeBSDserver# tar –xvf getopt-1.1.5.tar.gz

2

cd getopt-1.1.5\

 

3

./configure

4

make install clean

 

Rename or Remove Binaries

 

You now have FreeBSD ports or base installation packages installed that conflict with newer versions you want to use with this platform.

 

For example, after installing OpenSSH 6.1p1:

 

1

FreeBSDserver# where ssh

2

/usr/bin/ssh (openssh 5.8)

 

3

/usr/local/bin/ssh (openssh 6.1)

 

Same thing for Getopt 1.1.5:

 

1

FreeBSDserver# where getopt

2

/usr/bin/getopt (ports getopt)

 

3

/usr/local/bin/getopt (GNU getopt)

 

You must rename or remove binaries for both getopt and ssh that reside in “/usr/bin” to avoid conflicts with the newer versions that are installed into /usr/local/bin. You can rename them whatever you like so long as the environment can no longer find it. In the example below, both have had ".base" appended to their names.

 

1

rename /usr/bin/getptopt > /usr/bin/getopt.base

2

rename /usr/bin/ssh > /usr/bin/ssh.base

 

Your environment should now be ready for ANYCONF and JUISE.

Install ANYCONF on FreeBSD

 

Once the FreeBSD environmnent is prepared, download and install ANYCONF.

 

  1. Copy the contents of the archive to /usr/local/anyconf.
  2. Add "/usr/local/anyconf/bin" to your path environment variable.
  3. Download from https://github.com/nemith/anyconf/.
  4. Verify that ANYCONF is working.

01

FreeBSDserver# anyconf --help

02

 

03

anyconf: Junos Anyconf "V12 Engine"

04

 

05

   OPTIONS:

06

      -t <template-file>     (REQ, upto 2)

07

      -d <data-file>         (upto 3)

08

      -o [<output-file>]

09

 

10

   CONTROLS:

11

      --show: will show the output file to the screen after merge

 

IMPORTANT: If you do not get the help description for any reason, then stop and resolve the issue before moving on, otherwise JUISE will not work without ANYCONF.

Install JUISE on FreeBSD

 

Once the FreeBSD environment is prepared and ANYCONF is working, download and install JUISE.

 

  1. Download JUISE from http://code.google.com/p/juise/.
  2. Download Version 0.3.17. Version 0.3.18 has a known installation bug and should not be used yet. For now use Version 0.3.17.
  3. Copy the tar.gz archive to the system.
  4. Extract.

1

FreeBSDserver# tar –xvf juise-0.3.17.tar.gz

2

cd juise-0.3.17\

3

./configure

4

make install clean

 

Verify that JUISE is working.

 

01

FreeBSDserver# juise --help

02

 

03

Usage: juise [@target] [options] [script] [param value]*

04

    --agent OR -A: enable ssh-agent forwarding

05

    --commit-script OR -c: test a commit script

06

    --debug OR -d: use the libslax debugger

07

    --directory <dir> OR -D <dir>: set the directory for server scripts

08

    --include <dir> OR -I <dir>: search directory for includes/imports

09

    --input <file> OR -i <file>: use given file for input

10

    --indent OR -g: indent output ala output-method/indent

11

    --junoscript OR -J: use junoscript API protocol

12

    --load OR -l: load commit script changes in test mode

13

    --lib <dir> OR -L <dir>: search directory for extension libraries

14

    --no-randomize: do not initialize the random number generator

15

    --param <name> <value> OR -a <name> <value>: pass parameters

16

    --protocol <name> OR -P <name>: use the given API protocol

17

    --run-server OR -R: run in juise server mode

18

    --script <name> OR -S <name>: run the given script

19

    --target <name> OR -T <name>: specify the default target device

20

    --trace <file> OR -t <file>: write trace data to a file

21

    --user <name> OR -u <name>: specify the user name for API connections

22

    --verbose OR -v: enable debugging output (slaxLog())

23

    --version OR -V: show version information (and exit)

24

    --wait <seconds>: wait after starting (for gdb to attach)

 

For more information, click the project JUISE home page: https://github.com/Juniper/juise/.

 


#juise
#ScriptingHow-To
#installation
#anyconf
#freebsd
#How-To

Permalink