treewide: use name in define and eval lines

For consistency, use full name instead of $(PKG_NAME) in define and eval
lines for all packages.

I've seen reviews that asked to do this before, and I am asking the same
during reviews now. To avoid this in the future, fix this treewide so
when people use existing packages as example, we will not have to
request this change anymore.

This makes all packages consistent with both LEDE and OpenWrt base
repositories.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel
2017-03-07 13:41:01 +01:00
parent 694e5a677c
commit f82287cf5c
17 changed files with 157 additions and 156 deletions
+23 -23
View File
@@ -28,7 +28,7 @@ $(call include_mk, python3-package.mk)
# no default dependencies
PKG_DEFAULT_DEPENDS:=
define Package/$(PKG_NAME)/Default
define Package/radicale/Default
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
@@ -37,29 +37,29 @@ define Package/$(PKG_NAME)/Default
PKGARCH:=all
USERID:=radicale=5232:radicale=5232
endef
define Package/$(PKG_NAME)-py2
$(call Package/$(PKG_NAME)/Default)
define Package/radicale-py2
$(call Package/radicale/Default)
TITLE+= (Python 2)
VARIANT:=2
DEPENDS:=+python-logging +python-openssl +python-xml +python-codecs
endef
define Package/$(PKG_NAME)-py3
$(call Package/$(PKG_NAME)/Default)
define Package/radicale-py3
$(call Package/radicale/Default)
TITLE+= (Python 3)
VARIANT:=3
DEPENDS:=+python3-logging +python3-openssl +python3-xml +python3-codecs +python3-email
endef
# shown in LuCI package description
define Package/$(PKG_NAME)-py2/description
define Package/radicale-py2/description
Radicale CalDAV/CardDAV server (Python 2) - Homepage: http://radicale.org/
endef
define Package/$(PKG_NAME)-py3/description
define Package/radicale-py3/description
Radicale CalDAV/CardDAV server (Python 3) - Homepage: http://radicale.org/
endef
# shown in make menuconfig <Help>
define Package/$(PKG_NAME)-py2/config
define Package/radicale-py2/config
help
The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server.
It aims to be a light solution, easy to use, easy to install, easy to configure.
@@ -69,14 +69,14 @@ define Package/$(PKG_NAME)-py2/config
Version : $(PKG_VERSION)
Homepage: http://radicale.org/
endef
Package/$(PKG_NAME)-py3/config = $(Package/$(PKG_NAME)-py2/config)
Package/radicale-py3/config = $(Package/radicale-py2/config)
define Package/$(PKG_NAME)-py2/conffiles
define Package/radicale-py2/conffiles
/etc/config/radicale
/etc/radicale/users
/etc/radicale/rights
endef
Package/$(PKG_NAME)-py3/conffiles = $(Package/$(PKG_NAME)-py2/conffiles)
Package/radicale-py3/conffiles = $(Package/radicale-py2/conffiles)
define Build/Configure
# nothing to configure
@@ -85,7 +85,7 @@ define Build/Compile
# nothing to compile
endef
define Package/$(PKG_NAME)-py2/preinst
define Package/radicale-py2/preinst
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] && exit 0 # if run within buildroot exit
@@ -94,11 +94,11 @@ define Package/$(PKG_NAME)-py2/preinst
exit 0 # suppress errors from stop command
endef
define Package/$(PKG_NAME)-py3/preinst
$(call Package/$(PKG_NAME)-py2/preinst)
define Package/radicale-py3/preinst
$(call Package/radicale-py2/preinst)
endef
define Package/$(PKG_NAME)/inst_all
define Package/radicale/inst_all
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/radicale.init $(1)/etc/init.d/radicale
@@ -120,27 +120,27 @@ define Package/$(PKG_NAME)/inst_all
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/radicale $(1)/usr/bin/
endef
define Package/$(PKG_NAME)-py2/install
$(call Package/$(PKG_NAME)/inst_all, $(1))
define Package/radicale-py2/install
$(call Package/radicale/inst_all, $(1))
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/radicale
$(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON_PKG_DIR)/radicale
endef
define Package/$(PKG_NAME)-py3/install
$(call Package/$(PKG_NAME)/inst_all, $(1))
define Package/radicale-py3/install
$(call Package/radicale/inst_all, $(1))
$(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)/radicale
$(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON3_PKG_DIR)/radicale
endef
define Package/$(PKG_NAME)-py2/postinst
define Package/radicale-py2/postinst
#!/bin/sh
# patch /usr/bin/radicale force run using python2
/bin/sed -i 's/python/python2/' $${IPKG_INSTROOT}/usr/bin/radicale
endef
define Package/$(PKG_NAME)-py3/postinst
define Package/radicale-py3/postinst
#!/bin/sh
# patch /usr/bin/radicale force run using python3
/bin/sed -i 's/python/python3/' $${IPKG_INSTROOT}/usr/bin/radicale
endef
$(eval $(call BuildPackage,$(PKG_NAME)-py2))
$(eval $(call BuildPackage,$(PKG_NAME)-py3))
$(eval $(call BuildPackage,radicale-py2))
$(eval $(call BuildPackage,radicale-py3))