2018-03-16 06:07:09 +01:00
|
|
|
# Installing flawfinder
|
2017-09-03 03:03:02 +02:00
|
|
|
|
|
|
|
You can install flawfinder a number of different ways.
|
|
|
|
Choose the approach that's most convenient for you!
|
2018-03-16 06:07:09 +01:00
|
|
|
The options (described below) are (1) pip, (2) package for Unix-like system, (3) source install, and (4) run directly.
|
2017-09-03 03:03:02 +02:00
|
|
|
|
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
## 1. PIP
|
2017-09-03 03:03:02 +02:00
|
|
|
|
|
|
|
For many, the simple approach is to first install Python
|
2018-10-01 03:15:03 +02:00
|
|
|
(2.7 or something reasonable in the 3.X series).
|
|
|
|
Then use `pip` to install flawfinder
|
2017-09-03 03:03:02 +02:00
|
|
|
(this will normally download the package):
|
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
`pip install flawfinder`
|
2017-09-03 03:03:02 +02:00
|
|
|
|
|
|
|
One advantage for using pip is that you'll generally get the
|
|
|
|
*current* released version.
|
|
|
|
|
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
## 2. PACKAGE FOR UNIX-LIKE SYSTEM (including Cygwin):
|
2007-01-16 03:44:45 +01:00
|
|
|
|
|
|
|
If you use an RPM-based system (e.g., Red Hat) or deb-based system
|
2017-09-03 03:03:02 +02:00
|
|
|
(e.g., Debian), you can use their respective RPM or debian installation
|
|
|
|
program and just install it; then ignore the rest of these instructions.
|
2007-01-16 03:44:45 +01:00
|
|
|
For a ports-based system where you have a current port, just use that.
|
|
|
|
|
2017-09-03 03:03:02 +02:00
|
|
|
This will work out-of-the-box; it may not be the most recent version.
|
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
One way to accomplish this is:
|
|
|
|
`sudo apt install flawfinder`
|
2017-09-03 03:03:02 +02:00
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
|
|
|
|
## 3. TARBALL (SOURCE INSTALL)
|
2017-09-03 03:03:02 +02:00
|
|
|
|
2014-07-29 03:41:02 +02:00
|
|
|
QUICK START:
|
|
|
|
The quick way to install flawfinder from the tarball is to
|
2018-10-01 03:15:03 +02:00
|
|
|
unpack the tarball and type in something like this on the command line:
|
2017-09-03 03:03:02 +02:00
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
`sudo make prefix=/usr install`
|
2017-09-03 03:03:02 +02:00
|
|
|
|
2014-07-29 03:41:02 +02:00
|
|
|
Omit prefix=/usr to install in /usr/local instead.
|
|
|
|
Omit "sudo" if you are already root.
|
2017-09-03 03:03:02 +02:00
|
|
|
Note that this installation approach follows the usual install conventions
|
|
|
|
as described below, including prefix= and DESTDIR.
|
2014-07-29 03:41:02 +02:00
|
|
|
|
|
|
|
Not enough? Here are more detailed step-by-step instructions and options.
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2014-07-29 03:24:36 +02:00
|
|
|
* Download the "tarball" and uncompress it.
|
2018-03-16 06:07:09 +01:00
|
|
|
GNU-based systems can run `tar xvzf flawfinder-<version>.tar.gz` to do so,
|
|
|
|
then move into the newly created directory with `cd flawfinder-<version>`
|
|
|
|
If that doesn't work (e.g., you have an old tar program), use:
|
|
|
|
`gunzip flawfinder-<version>.tar.gz`
|
|
|
|
`tar xvf flawfinder-<version>.tar`
|
|
|
|
`cd flawfinder-<version>`
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2014-07-28 19:09:44 +02:00
|
|
|
* Decide where you want to put it. Flawfinder normally installs everything
|
2014-07-29 03:41:02 +02:00
|
|
|
in /usr/local, with the program in /usr/local/bin and the man page in
|
2014-07-28 19:09:44 +02:00
|
|
|
/usr/local/share/man/man1, per GNU conventions. You can override this
|
|
|
|
when installing (with "make install") by setting some environment
|
|
|
|
variables. You can do this by setting traditional GNU variables, e.g.,
|
2014-07-29 03:24:36 +02:00
|
|
|
"prefix" = prefix of all files, default /usr/local
|
|
|
|
"bindir" = directory for binaries, default $(prefix)/bin
|
|
|
|
(the program "flawfinder" is put here)
|
2014-07-29 03:41:02 +02:00
|
|
|
"datarootdir" = data for shared data, by default $(prefix)/share
|
|
|
|
"mandir" = directory for all man pages, default $(datarootdir)/man
|
|
|
|
"man1dir" = directory for all man1 pages, default $(mandir)/man1
|
|
|
|
(the man page "flawfinder.1" is put here). Given the
|
|
|
|
previous definitions, its default is $(prefix)/share/man/man1
|
2014-07-29 03:24:36 +02:00
|
|
|
It is common to override "prefix" with "/usr" instead.
|
2014-07-28 19:09:44 +02:00
|
|
|
|
|
|
|
You can also use the older flawfinder makefile variables to control
|
2014-07-29 03:24:36 +02:00
|
|
|
installation; you can set:
|
2018-10-01 03:15:03 +02:00
|
|
|
`INSTALL_DIR` = prefix, default $(prefix);
|
|
|
|
`INSTALL_DIR_BIN` = program location, default `$(bindir)`;
|
|
|
|
`INSTALL_DIR_MAN` = manual location, default `$(man1dir)`.
|
|
|
|
Note that the default of `INSTALL_DIR_MAN` has changed; at one time
|
|
|
|
it was `$(prefix)/man/man1`, but now it is `$(prefix)/share/man/man1`
|
2007-01-16 03:44:45 +01:00
|
|
|
|
|
|
|
* If you're using Cygwin on Windows, you can install it using "make install"
|
|
|
|
but you need to tell the makefile to use the .py extension
|
|
|
|
whenever you use make. This will be another make install override.
|
|
|
|
If you'll just install it, do this:
|
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
`make PYTHONEXT=.py install`
|
2007-01-16 03:44:45 +01:00
|
|
|
|
|
|
|
If you don't want to pass the "PYTHONEXT" extension each time,
|
|
|
|
you can change the file "makefile" to remember this. Just change
|
|
|
|
the line beginning with "PYTHONEXT=" so that it reads as follows:
|
|
|
|
PYTHONEXT=.py
|
|
|
|
|
2014-07-29 03:41:02 +02:00
|
|
|
* Now install it, giving whatever overrides you need. Currently it really
|
|
|
|
only installs two files, an executable and a man page (documentation).
|
2007-01-16 03:44:45 +01:00
|
|
|
In most cases, you'll need to be root, so run this first:
|
2018-03-16 06:07:09 +01:00
|
|
|
`su`
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
Then give the `make install` command appropriate for your system.
|
2007-01-16 03:44:45 +01:00
|
|
|
For an all-default installation, which is what you need for most cases:
|
|
|
|
make install
|
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
(you need to be root; `make uninstall` reverses it).
|
2007-01-16 03:44:45 +01:00
|
|
|
|
|
|
|
To install in /usr (the program in /usr/bin, the manual in /usr/man):
|
2018-03-16 06:07:09 +01:00
|
|
|
`make prefix=/usr install`
|
2014-07-29 03:24:36 +02:00
|
|
|
or alternatively, using the older flawfinder conventions:
|
2018-03-16 06:07:09 +01:00
|
|
|
`make INSTALL_DIR=/usr install`
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2014-07-29 03:41:02 +02:00
|
|
|
To install in /usr on Cygwin:
|
2018-03-16 06:07:09 +01:00
|
|
|
`make prefix=/usr PYTHONEXT=.py install`
|
2014-07-29 03:41:02 +02:00
|
|
|
|
|
|
|
To put the binaries in /usr/bin, and the manuals under /usr/local/share/man
|
2007-01-16 03:44:45 +01:00
|
|
|
(common for Red Hat Linux), do:
|
2018-03-16 06:07:09 +01:00
|
|
|
`make prefix=/usr mandir=/usr/local/share/man install`
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
The installer and uninstaller honor `DESTDIR`.
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
## 4. DIRECT EXECUTION
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2017-09-03 03:03:02 +02:00
|
|
|
You can also simply run the program in the directory you've unpacked it
|
|
|
|
into. It's a simple Python program, just type into a command line:
|
2007-01-16 03:44:45 +01:00
|
|
|
|
2018-03-16 06:07:09 +01:00
|
|
|
`./flawfinder files_or_directory`
|