|
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
9
|
9
|
|
10
|
10
|
PKG_NAME:=nut
|
11
|
11
|
PKG_VERSION:=2.7.3
|
12
|
|
-PKG_RELEASE:=1
|
|
12
|
+PKG_RELEASE:=2
|
13
|
13
|
|
14
|
14
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
15
|
15
|
PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
|
|
@@ -28,11 +28,10 @@ PKG_CONFIG_DEPENDS:= \
|
28
|
28
|
CONFIG_NUT_CLIENTS_UPSMON \
|
29
|
29
|
CONFIG_NUT_CLIENTS_UPSRW \
|
30
|
30
|
CONFIG_NUT_CLIENTS_UPSSCHED \
|
31
|
|
- CONFIG_NUT_DRIVER_SERIAL \
|
32
|
31
|
CONFIG_NUT_DRIVER_SNMP \
|
33
|
32
|
CONFIG_NUT_DRIVER_USB \
|
34
|
33
|
CONFIG_NUT_SERVER \
|
35
|
|
- CONFIG_NUT_SSL \
|
|
34
|
+ CONFIG_NUT_SSL
|
36
|
35
|
|
37
|
36
|
include $(INCLUDE_DIR)/package.mk
|
38
|
37
|
|
|
@@ -78,7 +77,6 @@ endef
|
78
|
77
|
define Package/nut/install
|
79
|
78
|
$(INSTALL_DIR) $(1)/etc/nut
|
80
|
79
|
$(INSTALL_DIR) $(1)/usr/bin
|
81
|
|
- $(INSTALL_DIR) $(1)/usr/bin
|
82
|
80
|
$(INSTALL_DIR) $(1)/usr/lib
|
83
|
81
|
$(INSTALL_DIR) $(1)/usr/sbin
|
84
|
82
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/nut.conf.sample $(1)/etc/nut/nut.conf
|
|
@@ -102,7 +100,7 @@ define Package/nut/install
|
102
|
100
|
$(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.users.sample $(1)/etc/nut/upsd.users)
|
103
|
101
|
$(if $(CONFIG_NUT_CLIENTS_UPSC),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin/)
|
104
|
102
|
$(if $(CONFIG_NUT_CLIENTS_UPSCMD),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin/)
|
105
|
|
- $(if $(CONFIG_NUT_CLIENTS_LOG),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/)
|
|
103
|
+ $(if $(CONFIG_NUT_CLIENTS_UPSLOG),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/)
|
106
|
104
|
$(if $(CONFIG_NUT_CLIENTS_UPSRW),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin/)
|
107
|
105
|
$(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) ./files/nut-monitor.init $(1)/etc/init.d/)
|
108
|
106
|
$(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/)
|
|
@@ -112,13 +110,62 @@ define Package/nut/install
|
112
|
110
|
$(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf)
|
113
|
111
|
endef
|
114
|
112
|
|
|
113
|
+define Package/nut-web-cgi
|
|
114
|
+ $(call Package/nut/Default)
|
|
115
|
+ TITLE+= Web CGI interface
|
|
116
|
+ DEPENDS+=+libgd
|
|
117
|
+endef
|
|
118
|
+
|
|
119
|
+define Package/nut-web-cgi/description
|
|
120
|
+The CGI programs are clients that run through your web server.
|
|
121
|
+They allow you to see UPS status and perform certain administrative
|
|
122
|
+commands from any web browser. Javascript and cookies are not required.
|
|
123
|
+endef
|
|
124
|
+
|
|
125
|
+define Package/nut-web-cgi/conffiles
|
|
126
|
+ /etc/nut/hosts.conf
|
|
127
|
+ /etc/nut/upsset.conf
|
|
128
|
+ /etc/nut/upsstats.html
|
|
129
|
+ /etc/nut/upsstats-single.html
|
|
130
|
+endef
|
|
131
|
+
|
|
132
|
+define Package/nut-web-cgi/install
|
|
133
|
+ $(INSTALL_DIR) $(1)/etc/nut
|
|
134
|
+ $(INSTALL_DIR) $(1)/usr/share/www/cgi-bin
|
|
135
|
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/hosts.conf.sample $(1)/etc/nut/hosts.conf
|
|
136
|
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf
|
|
137
|
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html
|
|
138
|
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html
|
|
139
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/www/nut $(1)/usr/share/www/
|
|
140
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/www/cgi-bin/nut $(1)/usr/share/www/cgi-bin/
|
|
141
|
+endef
|
|
142
|
+
|
|
143
|
+define Package/nut-avahi-service
|
|
144
|
+ $(call Package/nut/Default)
|
|
145
|
+ TITLE+= (Avahi service)
|
|
146
|
+ DEPENDS+=+avahi-daemon
|
|
147
|
+endef
|
|
148
|
+
|
|
149
|
+define Package/nut-avahi-service/description
|
|
150
|
+This package contains the service definition for announcing the
|
|
151
|
+attached UPS via mDNS/DNS-SD.
|
|
152
|
+endef
|
|
153
|
+
|
|
154
|
+define Package/nut-avahi-service/conffiles
|
|
155
|
+ /etc/avahi/services/nut.service
|
|
156
|
+endef
|
|
157
|
+
|
|
158
|
+define Package/nut-avahi-service/install
|
|
159
|
+ $(INSTALL_DIR) $(1)/etc/avahi/services
|
|
160
|
+ $(INSTALL_CONF) ./files/nut.service $(1)/etc/avahi/services/
|
|
161
|
+endef
|
|
162
|
+
|
115
|
163
|
# Dealing with all of the drivers is very repetitive, but the previous
|
116
|
164
|
# maintainer had a neat solution which just needed some tweaking.
|
117
|
165
|
define DriverPackage
|
118
|
166
|
define Package/nut-driver-$(2)
|
119
|
167
|
$(call Package/nut/Default)
|
120
|
168
|
TITLE:=$(2) (NUT $(1) driver)
|
121
|
|
- $(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL)
|
122
|
169
|
$(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP)
|
123
|
170
|
$(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB)
|
124
|
171
|
endef
|
|
@@ -270,24 +317,36 @@ $(eval $(call DriverDescription,usb,nutdrv_qx,\
|
270
|
317
|
Driver for Q* protocol serial and USB based UPS equipment))
|
271
|
318
|
|
272
|
319
|
CONFIGURE_ARGS += \
|
273
|
|
- --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
|
|
320
|
+ --sysconfdir=/etc/nut \
|
|
321
|
+ --datadir=/usr/share/nut \
|
|
322
|
+ --with-dev \
|
274
|
323
|
--$(if $(CONFIG_NUT_DRIVER_USB),with,without)-usb \
|
|
324
|
+ --without-avahi \
|
275
|
325
|
--$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
|
276
|
326
|
--without-neon \
|
277
|
327
|
--without-powerman \
|
278
|
328
|
--without-ipmi \
|
279
|
329
|
--without-freeipmi \
|
280
|
330
|
--$(if $(CONFIG_NUT_SSL),with,without)-ssl $(if $(CONFIG_NUT_SSL),--with-openssl) \
|
281
|
|
- --without-avahi \
|
282
|
331
|
--without-libltdl \
|
283
|
|
- --with-user=root \
|
284
|
|
- --with-group=root \
|
285
|
|
- --sysconfdir=/etc/nut \
|
286
|
|
- --with-drvpath=/lib/nut \
|
|
332
|
+ --$(if $(CONFIG_PACKAGE_nut-web-cgi),with,without)-cgi \
|
287
|
333
|
--with-statepath=/var/run \
|
288
|
|
- --datadir=/usr/share/nut
|
|
334
|
+ --with-drvpath=/lib/nut \
|
|
335
|
+ --with-cgipath=/usr/share/www/cgi-bin/nut \
|
|
336
|
+ --with-htmlpath=/usr/share/www/nut \
|
|
337
|
+ --with-user=root \
|
|
338
|
+ --with-group=root
|
|
339
|
+
|
|
340
|
+define Build/InstallDev
|
|
341
|
+ $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
|
|
342
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
|
|
343
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
|
344
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
|
|
345
|
+endef
|
289
|
346
|
|
290
|
347
|
$(eval $(call BuildPackage,nut))
|
|
348
|
+$(eval $(call BuildPackage,nut-web-cgi))
|
|
349
|
+$(eval $(call BuildPackage,nut-avahi-service))
|
291
|
350
|
$(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call BuildPackage,nut-driver-$(d))))
|
292
|
351
|
$(foreach d,$(SNMP_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
|
293
|
352
|
$(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
|