Skip to content

Commit

Permalink
luci: rewrote the package Makefile.
Browse files Browse the repository at this point in the history
Signed-off-by: ZengFei Zhang <zhangzengfei@kunteng.org>
  • Loading branch information
gigibox committed Apr 25, 2017
1 parent 17c4023 commit 4ab0fd8
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 18 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
OpenWrt-xkcptun
=================

A simple [OpenWrt](https://openwrt.org) package for the [xkcptun](https://github.com/liudf0716/xkcptun).
This is an [OpenWrt](https://openwrt.org) package feed for [xkcptun](https://github.com/liudf0716/xkcptun).

### Where to download packages?

Expand All @@ -20,27 +20,24 @@ cd openwrt
echo "src-git xkcptun https://github.com/gigibox/openwrt-xkcptun.git" >> feeds.conf.default

./scripts/feeds update xkcptun
./scripts/feeds install xkcptun

make defconfig
make menuconfig
./scripts/feeds install -a -p xkcptun
</pre>

You are now shown the OpenWrt configuration interface.
Select the appropiate "Target System" and "Target Profile".
This depends on what target chipset/router you want to build for.
Here is an example on what you might want to select:
The xkcptun packages should now appear in menuconfig.

<pre>
Target System (Atheros AR7xxx/AR9xxx)
Target Profile (TP-LINK TL-WR841N/ND)
make menuconfig

Network ---> < M > xkcptun

LuCI ---> 3. Applications ---> <*> luci-app-xkcptun
</pre>

Exit and save the settings. Then build the packages:

<pre>
make package/xkcptun/compile V=s
make package/luci-app-xkcptun/compile V=s
</pre>

The ipk packages can now be found in `bin/ar71xx/packages/xkcptun/`.
The ipk packages can now be found in `bin/.../packages/xkcptun/`
64 changes: 58 additions & 6 deletions luci-app-xkcptun/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,66 @@
# Copyright © 2017 gigibox zhangzengfei@kunteng.org
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This is free software, licensed under the Apache License, Version 2.0 .
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".

include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI support for xkcptun
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-xkcptun
PKG_VERSION:=1.0
PKG_RELEASE:=2

PKG_LICENSE:=GPL-3.0

include $(INCLUDE_DIR)/package.mk

define Package/luci-app-xkcptun
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LuCI support for xkcptun
URL:=https://github.com/liudf0716/xkcptun
MAINTAINER:=Lars Gierth <larsg@systemli.org>
DEPENDS:=+luci-base
endef

define Package/luci-app-xkcptun/description
This package allows you to configure xkcptun using LuCI.
endef

define Build/Compile
endef

define Package/luci-app-xkcptun/postinst
#!/bin/sh
UCI_DEF_FILE=90_luci_xkcptun
if [ -z "$${IPKG_INSTROOT}" ]; then
if [ -f /etc/uci-defaults/$UCI_DEF_FILE ]; then
( . /etc/uci-defaults/$UCI_DEF_FILE ) && \
rm -f /etc/uci-defaults/$UCI_DEF_FILE
fi
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
fi
exit 0
endef

include ../../luci.mk
define Package/luci-app-xkcptun/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
$(CP) ./luasrc/* $(1)/usr/lib/lua/luci
$(CP) ./root/* $(1)/
endef

# call BuildPackage - OpenWrt buildroot signature
$(eval $(call BuildPackage,luci-app-xkcptun))

0 comments on commit 4ab0fd8

Please sign in to comment.