-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·89 lines (74 loc) · 2.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-banner
PKG_VERSION:=1
PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/gluon-banner
SECTION:=FFFr
CATEGORY:=Customization
TITLE:=Banner file replacement, and miniscripts
DEPENDS:=+gluon-core +busybox
MAINTAINER:=FFFr freiburg.freifunk.net fuzzle
URL:=https://github.com/viisauksena/gluon-banner
SOURCE:=https://github.com/viisauksena/gluon-banner.git
endef
define Package/gluon-banner/description
Banner file replacement - with plenty of information on login
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-banner/preinst
#!/bin/sh
cd "$${IPKG_INSTROOT}/etc/"
if [ -h "./banner" ] ; then
/bin/rm "./banner"
elif [ -f "./banner" ] ; then
/bin/mv "./banner" "./banner.openwrt"
fi
/bin/ln -s "./banner.openwrt" "./banner"
if [ -h "./profile" ] ; then
/bin/rm "./profile"
elif [ -f "./profile" ] ; then
/bin/mv "./profile" "./profile.openwrt"
fi
/bin/ln -s "./profile.gluon" "./profile"
exit 0
endef
define Package/gluon-banner/postinst
#!/bin/sh
cd "$${IPKG_INSTROOT}/etc/"
[ -h "./banner" ] && /bin/rm -f "./banner"
/bin/ln -s "./banner.gluon" "./banner"
[ -h "./profile" ] && /bin/rm -f "./profile"
/bin/ln -s "./profile.gluon" "./profile"
exit $$?
endef
define Package/gluon-banner/prerm
#!/bin/sh
cd "$${IPKG_INSTROOT}/etc/"
if [ -h "./banner" ] ; then
[[ "$$(readlink -n ./banner)" == "./banner.gluon" ]] && \
/bin/rm -f "./banner" && \
[ -f "./banner.openwrt" ] && \
/bin/ln -s "./banner.openwrt" "./banner"
fi
if [ -h "./profile" ] ; then
[[ "$$(readlink -n ./profile)" == "./profile.gluon" ]] && \
/bin/rm -f "./profile" && \
[ -f "./profile.openwrt" ] && \
/bin/ln -s "./profile.openwrt" "./profile"
fi
exit 0
endef
define Package/gluon-banner/install
$(INSTALL_DIR) $(1)/etc/
$(INSTALL_DATA) ./files/etc/banner.gluon $(1)/etc/
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,gluon-banner))