let ipkg fail when a package file to be installed is not found
[openwrt/svn-archive/archive.git] / openwrt / package / monit / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=monit
6 PKG_VERSION:=4.6
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=4e53aa44e4ca264e61c7c401cee4e697
9
10 PKG_SOURCE_URL:=http://www.tildeslash.com/monit/dist/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15
16 include $(TOPDIR)/package/rules.mk
17
18 $(eval $(call PKG_template,MONIT,monit,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
19 $(eval $(call PKG_template,MONIT_NOSSL,monit-nossl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20
21 $(PKG_BUILD_DIR)/.configured:
22 touch $@
23
24 $(PKG_BUILD_DIR)/.built:
25 ifneq ($(BR2_PACKAGE_MONIT),)
26 ( cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
27 $(TARGET_CONFIGURE_OPTS) \
28 CFLAGS="$(TARGET_CFLAGS)" \
29 ./configure \
30 --target=$(GNU_TARGET_NAME) \
31 --host=$(GNU_TARGET_NAME) \
32 --build=$(GNU_HOST_NAME) \
33 --program-prefix="" \
34 --program-suffix="" \
35 --prefix=/usr \
36 --exec-prefix=/usr \
37 --bindir=/usr/sbin \
38 --datadir=/usr/share \
39 --includedir=/usr/include \
40 --infodir=/usr/share/info \
41 --libdir=/usr/lib \
42 --libexecdir=/usr/lib \
43 --localstatedir=/var \
44 --mandir=/usr/share/man \
45 --sbindir=/usr/sbin \
46 --sysconfdir=/etc \
47 $(DISABLE_LARGEFILE) \
48 $(DISABLE_NLS) \
49 --with-ssl \
50 --with-ssl-dir="$(STAGING_DIR)/usr" \
51 );
52 $(MAKE) -C $(PKG_BUILD_DIR)
53 ( cd $(PKG_BUILD_DIR); mv monit monit-ssl; )
54 endif
55 ifneq ($(BR2_PACKAGE_MONIT),)
56 ( cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
57 $(TARGET_CONFIGURE_OPTS) \
58 CFLAGS="$(TARGET_CFLAGS)" \
59 ./configure \
60 --target=$(GNU_TARGET_NAME) \
61 --host=$(GNU_TARGET_NAME) \
62 --build=$(GNU_HOST_NAME) \
63 --program-prefix="" \
64 --program-suffix="" \
65 --prefix=/usr \
66 --exec-prefix=/usr \
67 --bindir=/usr/sbin \
68 --datadir=/usr/share \
69 --includedir=/usr/include \
70 --infodir=/usr/share/info \
71 --libdir=/usr/lib \
72 --libexecdir=/usr/lib \
73 --localstatedir=/var \
74 --mandir=/usr/share/man \
75 --sbindir=/usr/sbin \
76 --sysconfdir=/etc \
77 $(DISABLE_LARGEFILE) \
78 $(DISABLE_NLS) \
79 --without-ssl \
80 );
81 $(MAKE) -C $(PKG_BUILD_DIR)
82 ( cd $(PKG_BUILD_DIR); mv monit monit-nossl; )
83 $(MAKE) -C $(PKG_BUILD_DIR) clean
84 endif
85 touch $@
86
87 $(IPKG_MONIT):
88 install -d -m0755 $(IDIR_MONIT)/etc
89 install -m0600 $(PKG_BUILD_DIR)/monitrc $(IDIR_MONIT)/etc/
90 install -d -m0755 $(IDIR_MONIT)/etc/init.d
91 install -m0755 ./files/monit.init $(IDIR_MONIT)/etc/init.d/monit
92 install -d -m0755 $(IDIR_MONIT)/usr/sbin
93 install -m0755 $(PKG_BUILD_DIR)/monit-ssl $(IDIR_MONIT)/usr/sbin/monit
94 $(RSTRIP) $(IDIR_MONIT)
95 $(IPKG_BUILD) $(IDIR_MONIT) $(PACKAGE_DIR)
96
97 $(IPKG_MONIT_NOSSL):
98 install -d -m0755 $(IDIR_MONIT_NOSSL)/etc
99 install -m0600 $(PKG_BUILD_DIR)/monitrc $(IDIR_MONIT_NOSSL)/etc/
100 install -d -m0755 $(IDIR_MONIT_NOSSL)/etc/init.d
101 install -m0755 ./files/monit.init $(IDIR_MONIT_NOSSL)/etc/init.d/monit
102 install -d -m0755 $(IDIR_MONIT_NOSSL)/usr/sbin
103 install -m0755 $(PKG_BUILD_DIR)/monit-nossl $(IDIR_MONIT_NOSSL)/usr/sbin/monit
104 $(RSTRIP) $(IDIR_MONIT_NOSSL)
105 $(IPKG_BUILD) $(IDIR_MONIT_NOSSL) $(PACKAGE_DIR)