2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/nagios
19 include $(INCLUDE_DIR
)/package.mk
25 TITLE
:=Daemon to execute Nagios
check commands on remote hosts
26 URL
:=http
://www.nagios.org
/download
29 define Package
/nrpe
/description
30 NOTE
: several assumptions are made
:
31 1) As openssl is used to generate some stuff during
"configure" it is
32 assumed that openssl is installed on compiling PC in its default
33 location
(i.e. accessible
as /usr
/bin
/openssl
).
34 2) "nagios" user and group should exist on your openwrt installation.
37 define Package
/nrpe
/postinst
46 # check if we are on real system
47 if
[ -z
"$${IPKG_INSTROOT}" ]; then
48 # create copies of passwd and group, if we use squashfs
49 rootfs
=`mount |awk '/root/ { print $$5 }'`
50 if
[ "$$rootfs" = "squashfs" ]; then
51 if
[ -h
/etc
/group
]; then
53 cp
-p
/rom
/etc
/group
/etc
/group
55 if
[ -h
/etc
/passwd
]; then
57 cp
-p
/rom
/etc
/passwd
/etc
/passwd
63 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
64 echo
"adding group $$name to /etc/group"
65 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
67 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
68 echo
"adding user $$name to /etc/passwd"
69 echo
"$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc
/passwd
74 --with-ssl
="$(STAGING_DIR)/usr" \
76 define Package
/nrpe
/install
77 $(INSTALL_DIR
) $(1)/usr
/sbin
78 $(INSTALL_DIR
) $(1)/etc
79 $(INSTALL_DIR
) $(1)/etc
/init.d
80 $(INSTALL_DATA
) .
/files
/nrpe.cfg
$(1)/etc
/nrpe.cfg
81 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/src
/nrpe
$(1)/usr
/sbin
82 $(INSTALL_BIN
) .
/files
/$(PKG_NAME
).init
$(1)/etc
/init.d
/$(PKG_NAME
)
85 $(eval
$(call BuildPackage
,nrpe
))