do not use rpath with staging dir information
[openadk.git] / package / nut / Makefile
blob833f271e73bebc6dfdf128735ac2f8b25e3ab179
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include ${TOPDIR}/rules.mk
6 PKG_NAME:= nut
7 PKG_VERSION:= 2.4.1
8 PKG_RELEASE:= 1
9 PKG_MD5SUM:= 609ebaf2123fc7171d25a6c742dd7d66
10 PKG_DESCR:= Network UPS Tools
11 PKG_SECTION:= net/misc
12 PKG_URL:= http://www.networkupstools.org/
13 PKG_SITES:= http://www.networkupstools.org/source/2.4/
15 PKG_FLAVOURS:= SSL SNMP USB
16 PKGFD_SNMP:= enable SNMP support
17 PKGFS_SNMP:= libnetsnmp
18 PKGFB_SNMP:= net-snmp
19 PKGFD_USB:= enable USB support
20 PKGFS_USB:= libusb
21 PKGFB_USB:= libusb
22 PKGFD_SSL:= enable SSL support
23 PKGFS_SSL:= libopenssl
24 PKGFB_SSL:= openssl
26 include ${TOPDIR}/mk/package.mk
28 $(eval $(call PKG_template,NUT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
30 define DRIVER_template
32 DRIVERS_$${ADK_PACKAGE_NUT_DRIVER_${1}}+=${2}
34 endef
36 DRIVERS_y:=
37 $(eval $(call DRIVER_template,BESTUPS,bestups))
38 $(eval $(call DRIVER_template,APCSMART,apcsmart))
39 $(eval $(call DRIVER_template,EVERUPS,everups))
40 $(eval $(call DRIVER_template,BELKIN,belkin))
41 $(eval $(call DRIVER_template,MASTERGUARD,masterguard))
42 $(eval $(call DRIVER_template,POWERCOM,powercom))
43 $(eval $(call DRIVER_template,POWERPANEL,powerpanel))
44 $(eval $(call DRIVER_template,CYBERPOWER,cyberpower))
45 $(eval $(call DRIVER_template,TRIPPLITE,tripplite))
46 $(eval $(call DRIVER_template,VICTRONUPS,victronups))
47 $(eval $(call DRIVER_template,GENERICUPS,genericups))
48 $(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
49 $(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
50 $(eval $(call DRIVER_template,ISBMEX,isbmex))
51 $(eval $(call DRIVER_template,ETAPRO,etapro))
52 $(eval $(call DRIVER_template,LIEBERT,liebert))
53 $(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
54 $(eval $(call DRIVER_template,SAFENET,safenet))
55 $(eval $(call DRIVER_template,BELKINUNV,belkinunv))
56 $(eval $(call DRIVER_template,ONEAC,oneac))
57 $(eval $(call DRIVER_template,METASYS,metasys))
58 $(eval $(call DRIVER_template,BESTFCOM,bestfcom))
59 $(eval $(call DRIVER_template,UPSCODE2,upscode2))
60 $(eval $(call DRIVER_template,SOLIS,solis))
61 $(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
62 $(eval $(call DRIVER_template,MEGATEC,megatec))
63 $(eval $(call DRIVER_template,RHINO,rhino))
65 CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
67 INSTALL_DRIVERS_tmp=${DRIVERS_y}
68 ifneq (${ADK_PACKAGE_NUT_USB},)
69 INSTALL_DRIVERS_tmp+= usbhid-ups tripplite_usb
70 endif
71 ifneq (${ADK_PACKAGE_NUT_SNMP},)
72 INSTALL_DRIVERS_tmp+= snmp-ups
73 endif
74 INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
76 CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
77 --without-cgi \
78 --with-drivers=${INSTALL_DRIVERS} \
79 --with-group=0 \
80 --with-user=0
82 ifneq (${ADK_PACKAGE_NUT_SSL},)
83 CONFIGURE_ARGS+= --with-ssl
84 CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
85 MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
86 endif
88 ALL_TARGET:= all
89 INSTALL_TARGET:= install
91 ifneq (${ADK_PACKAGE_NUT_USB},)
92 ALL_TARGET+= usb
93 INSTALL_TARGET+= install-usb
94 endif
95 ifneq (${ADK_PACKAGE_NUT_SNMP},)
96 ALL_TARGET+= snmp
97 INSTALL_TARGET+= install-snmp
98 endif
100 post-install:
101 ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin ${IDIR_NUT}/etc
102 ${INSTALL_DIR} ${IDIR_NUT}/usr/lib
103 ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
104 ${IDIR_NUT}/usr/sbin/
105 ${CP} ${WRKINST}/usr/lib/lib*.so* ${IDIR_NUT}/usr/lib
106 ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
107 ${IDIR_NUT}/usr/bin/
108 ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
109 ${IDIR_NUT}/usr/bin/
110 ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
111 ifneq (${ADK_PACKAGE_NUT_VARDESC},)
112 ${INSTALL_DIR} ${IDIR_NUT}/usr/share
113 ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
114 ${IDIR_NUT}/usr/share/
115 endif
117 include ${TOPDIR}/mk/pkg-bottom.mk