forked from libremesh/network-profiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.mk
50 lines (37 loc) · 1.33 KB
/
profile.mk
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
include $(TOPDIR)/rules.mk
PROFILE_NAME=$(notdir ${CURDIR})
PROFILE_COMMUNITY=$(lastword $(filter-out $(PROFILE_NAME),$(subst /, ,$(CURDIR))))
PKG_NAME:=profile-$(PROFILE_COMMUNITY)-$(PROFILE_NAME)
PKG_MAINTAINER?=$(PROFILE_MAINTAINER)
# from https://github.com/openwrt/luci/blob/master/luci.mk
GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g')
GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . )
PKG_SRC_VERSION:=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP)
PKG_VERSION:=$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION))
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=lime
SUBMENU:=network-profile
CATEGORY:=LibreMesh
TITLE:=$(if $(PROFILE_TITLE),$(PROFILE_TITLE),Profile $(PROFILE_COMMUNITY) $(PROFILE_NAME))
DEPENDS:=+lime-system $(PROFILE_DEPENDS)
VERSION:=$(PKG_VERSION)
PKGARCH:=all
URL:=https://github.com/libremesh/network-profiles/
endef
ifneq ($(PROFILE_DESCRIPTION),)
define Package/$(PKG_NAME)/description
$(strip $(PROFILE_DESCRIPTION))
endef
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/
# check if root/ directory exists before copying
if [ -e ./root/* ]; then $(CP) -r ./root/* $(1)/; fi
endef
define Build/Compile
endef
define Build/Configure
endef
$(eval $(call BuildPackage,$(PKG_NAME)))