luci2: small formatting fix in uci changelog view
[project/luci2/ui.git] / luci2 / Makefile
1 #
2 # Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
3 #
4 # Licensed under the Apache License, Version 2.0.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=luci2
10 PKG_VERSION:=$(shell git --git-dir=$(CURDIR)/../.git log -1 --pretty="%ci %h" | awk '{ print $$1 "-" $$4 }')
11 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
12
13 PKG_LICENSE:=Apache-2.0
14 PKG_LICENSE_FILES:=
15
16 PKG_BUILD_PARALLEL:=1
17
18 include $(INCLUDE_DIR)/package.mk
19 include $(INCLUDE_DIR)/cmake.mk
20
21 define Build/Prepare
22         $(INSTALL_DIR) $(PKG_BUILD_DIR)
23         $(CP) ./src/* $(PKG_BUILD_DIR)/
24 endef
25
26 define Package/luci2
27   SECTION:=luci2
28   CATEGORY:=LuCI2
29   TITLE:=LuCI2 UI
30   DEPENDS:=+rpcd +rpcd-mod-iwinfo +uhttpd +uhttpd-mod-ubus
31 endef
32
33 define Package/luci2/description
34  Provides the LuCI2 web interface with standard functionality.
35 endef
36
37 define Package/luci2/install
38         $(INSTALL_DIR) $(1)/www
39         $(CP) ./htdocs/* $(1)/www/
40         $(INSTALL_DIR) $(1)/usr/share/rpcd
41         $(CP) ./share/* $(1)/usr/share/rpcd/
42         $(INSTALL_DIR) $(1)/usr/lib/rpcd
43         $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd/luci2.so $(1)/usr/lib/rpcd/
44         $(INSTALL_DIR) $(1)/usr/libexec $(1)/www/cgi-bin
45         $(INSTALL_BIN) $(PKG_BUILD_DIR)/io/luci2-io $(1)/usr/libexec/
46         $(LN) /usr/libexec/luci2-io $(1)/www/cgi-bin/luci-upload
47         $(LN) /usr/libexec/luci2-io $(1)/www/cgi-bin/luci-backup
48 endef
49
50 define Package/luci2/postinst
51 #!/bin/sh
52
53 if [ "$$(uci -q get uhttpd.main.ubus_prefix)" != "/ubus" ]; then
54         uci set uhttpd.main.ubus_prefix="/ubus"
55         uci commit uhttpd
56 fi
57
58 exit 0
59 endef
60
61 $(eval $(call BuildPackage,luci2))