Update here,
1. Upgrade the port tree,
# portsnap fetch extract
# portsnap fetch update
2. Recommend line "LIB_DEPENDS+=usb-0.1.8:${PORTSDIR}/devel/libusb" and Enter the build/ports/nut directory,
Code:
# make clean install
...
===> Installing for nut-2.4.1
===> nut-2.4.1 depends on executable: pkg-config - found
===> Generating temporary packing list
===> Checking if sysutils/nut already installed
install: /usr/local/freenas/svn/build/ports/nut/work/nut-2.4.1/data/cmdvartab -> /usr/local/freenas/rootfs//usr/local/etc/nut/cmdvartab
install: /usr/local/freenas/svn/build/ports/nut/work/nut-2.4.1/data/driver.list -> /usr/local/freenas/rootfs//usr/local/etc/nut/driver.list
install: /usr/local/freenas/svn/build/ports/nut/work/nut-2.4.1/drivers/apcsmart -> /usr/local/freenas/rootfs//usr/local/libexec/nut/apcsmart
install: /usr/local/freenas/svn/build/ports/nut/work/nut-2.4.1/drivers/bcmxcp -> /usr/local/freenas/rootfs//usr/local/libexec/nut/bcmxcp
install: /usr/local/freenas/svn/build/ports/nut/work/nut-2.4.1/drivers/bcmxcp_usb: No such file or directory
It seems that bcmxcp_usb can not be found. I modify the makefile and set "--with-usb=yes" and try to make again.
Code:
#make clean install
...
checking whether to build serial drivers... yes
checking whether to build SNMP drivers... no
configure: error: "USB drivers requested, but libusb not found."
===> Script "configure" failed unexpectedly.
Please report the problem to votdev@gmx.de [maintainer] and attach the
"/usr/local/freenas/svn/build/ports/nut/work/nut-2.4.1/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. an `ls
/var/db/pkg`).
*** Error code 1
Stop in /usr/local/freenas/svn/build/ports/nut.
*** Error code 1
Stop in /usr/local/freenas/svn/build/ports/nut.
By google the error message, I find this page "http://www.root0.net/problem/index.html" which told me to install libusb or its devel package. It takes a about 20minutes to find the libusb-0.1.12_4.tbz.(You can download it from:
http://ftp2.za.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/devel/), Install the package and later nut.
Code:
# pkg_add libusb-0.1.12_4.tbz
# pkg_info | grep libusb
libusb-0.1.12_4 Library giving userland programs access to USB devices
# make clean install
...
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for nut-2.4.1
Nut is built successfully!
Summary.
1. Check your BSD version. If it is higher enough(as my 800170), I suggest you recommend the following two lines in its included file.
In /usr/ports/devel/libusb/Makefile
Code:
#.if ${OSVERSION} >= 800069
#IGNORE= has been already included into base system
# .endif
In build/port/nut/Makefile
Code:
#LIB_DEPENDS+= usb-0.1.8:${PORTSDIR}/devel/libusb
--with-usb=yes (change the default "auto" to "yes")
2. Check libusb package has been installed.
# pkg_info | grep libusb
3. Build nut.
Hope this helpful for some guys(like me, a BSD newbie) future reference,
Phillip