source: packages/net/nrpe/Makefile @ 9313

Last change on this file since 9313 was 9313, checked in by blogic, 9 years ago

added nrpe from #2498

File size: 2.3 KB
Line 
1#
2# Copyright (C) 2007 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7#
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=nrpe
12PKG_VERSION:=2.8.1
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=@SF/nagios
17PKG_MD5SUM:=
18
19include $(INCLUDE_DIR)/package.mk
20
21define Package/nrpe
22  SECTION:=net
23  CATEGORY:=Network
24  DEPENDS:=+libopenssl
25  TITLE:=Daemon to execute Nagios check commands on remote hosts
26  URL:=http://www.nagios.org/download
27endef
28
29define 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.
35endef
36
37define Package/nrpe/postinst
38#!/bin/sh
39
40id=50
41name=nagios
42home=/var/run/nagios
43shell=/bin/false
44
45# do not change below
46# check if we are on real system
47if [ -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
52                        rm /etc/group
53                        cp -p /rom/etc/group /etc/group
54                fi
55                if [ -h /etc/passwd ]; then
56                        rm /etc/passwd
57                        cp -p /rom/etc/passwd /etc/passwd
58                fi
59        fi
60fi
61
62echo ""
63if [ -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
66fi
67if [ -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
70fi
71endef
72
73CONFIGURE_ARGS += \
74        --with-ssl="$(STAGING_DIR)/usr" \
75
76define 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)
83endef
84
85$(eval $(call BuildPackage,nrpe))
Note: See TracBrowser for help on using the repository browser.