libgee: moved to github
[packages.git] / admin / ostiary / Makefile
1 #
2 # Copyright (C) 2008-2011 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 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ostiary
11 PKG_VERSION:=4.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://ingles.homeunix.net/software/ost/latest/
16 PKG_MD5SUM:=420d1fda246097d7e4d1277f39069578
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/ostiary
21   SECTION:=admin
22   CATEGORY:=Administration
23   TITLE:=Simple, Secure Remote Script Execution
24   URL:=http://ingles.homeunix.net/software/ost/index.html
25 endef
26
27 define Package/ostiary/description
28  Designed to allow you to run a fixed set of commands remotely,
29  without giving everyone else access to the same commands.
30
31  Provides - ostiaryd daemon (~25kb)
32           - ostclient (~9kb)
33 endef
34
35 EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
36
37 CONFIGURE_ARGS += \
38     --prefix="/usr/bin" \
39     --sysconfdir="/etc/ostiaryd" \
40     CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)"
41
42 define Build/Compile
43         $(MAKE) -C $(PKG_BUILD_DIR) \
44                 DESTDIR="$(PKG_INSTALL_DIR)" \
45                 INSTALL_OPTS="" \
46                 STRIP="" \
47                 ostiaryd ostclient
48 endef
49
50 define Package/ostiary/install
51         $(INSTALL_DIR) $(1)/etc/ostiaryd
52         $(INSTALL_CONF) $(PKG_BUILD_DIR)/tests/ostiary.cfg $(1)/etc/ostiaryd/ostiary.cfg
53         $(INSTALL_DIR) $(1)/etc/ostiaryd/scripts
54         $(INSTALL_BIN) ./files/{ssh_enable,ssh_disable} $(1)/etc/ostiaryd/scripts
55         $(INSTALL_DIR) $(1)/etc/init.d/
56         $(INSTALL_BIN) ./files/ostiaryd.init $(1)/etc/init.d/ostiaryd
57         $(INSTALL_DIR) $(1)/usr/bin
58         $(INSTALL_BIN) $(PKG_BUILD_DIR)/{ostiaryd,ostclient} $(1)/usr/bin/
59 endef
60
61
62
63
64 define Package/ostiary/postinst
65 #!/bin/sh
66 # check if we are on real system
67 if [ -z "$${IPKG_INSTROOT}" ]; then
68         echo "Enabling rc.d symlink for ostiaryd"
69         /etc/init.d/ostiaryd enable
70 fi
71 exit 0
72 endef
73
74 define Package/ostiary/prerm
75 #!/bin/sh
76 # check if we are on real system
77 if [ -z "$${IPKG_INSTROOT}" ]; then
78         /etc/init.d/ostiaryd stop
79         echo "Removing rc.d symlink for ostiaryd"
80         /etc/init.d/ostiaryd disable
81         echo "Any config backups and scripts you created are not removed automatically."
82         echo "To finish cleanup, backup any files you want to keep, then run rm -f /etc/ostiaryd"
83 fi
84 exit 0
85 endef
86
87
88 $(eval $(call BuildPackage,ostiary))