Skip to content

Commit f82287c

Browse files
committed
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 <[email protected]>
1 parent 694e5a6 commit f82287c

File tree

17 files changed

+157
-156
lines changed

17 files changed

+157
-156
lines changed

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ All packages you commit or submit by pull-request should follow these simple gui
2222
* An optional PKG_LICENSE_FILES tag including the filenames of the license-files in the source-package.
2323
(E.g.: PKG_LICENSE_FILES:=COPYING)
2424
* PKG_RELEASE should be initially set to 1 or reset to 1 if the software version is changed. You should increment it if the package itself has changed. For example, modifying a support script, changing configure options like --disable* or --enable* switches, or if you changed something in the package which causes the resulting binaries to be different. Changes like correcting md5sums, changing mirror URLs, adding a maintainer field or updating a comment or copyright year in a Makefile do not require a change to PKG_RELEASE.
25+
* Avoid reuse of PKG_NAME in call, define and eval lines to improve readability.
2526

2627
#### Commits in your pull-requests should:
2728

lang/lua-mosquitto/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PKG_SOURCE_VERSION:=v$(PKG_VERSION)
2121

2222
include $(INCLUDE_DIR)/package.mk
2323

24-
define Package/$(PKG_NAME)
24+
define Package/lua-mosquitto
2525
SUBMENU:=Lua
2626
SECTION:=lang
2727
CATEGORY:=Languages
@@ -30,13 +30,13 @@ define Package/$(PKG_NAME)
3030
MAINTAINER:=Karl Palsson <[email protected]>
3131
endef
3232

33-
define Package/$(PKG_NAME)/description
33+
define Package/lua-mosquitto/description
3434
Lua bindings to libmosquitto
3535
endef
3636

37-
define Package/$(PKG_NAME)/install
37+
define Package/lua-mosquitto/install
3838
$(INSTALL_DIR) $(1)/usr/lib/lua
3939
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto.so $(1)/usr/lib/lua
4040
endef
4141

42-
$(eval $(call BuildPackage,$(PKG_NAME)))
42+
$(eval $(call BuildPackage,lua-mosquitto))

lang/lua-openssl/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
2121

2222
include $(INCLUDE_DIR)/package.mk
2323

24-
define Package/$(PKG_NAME)
24+
define Package/lua-openssl
2525
SUBMENU:=Lua
2626
SECTION:=lang
2727
CATEGORY:=Languages
@@ -34,9 +34,9 @@ define Package/lua-openssl/description
3434
A free, MIT-licensed OpenSSL binding for Lua.
3535
endef
3636

37-
define Package/$(PKG_NAME)/install
37+
define Package/lua-openssl/install
3838
$(INSTALL_DIR) $(1)/usr/lib/lua
3939
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openssl.so $(1)/usr/lib/lua/
4040
endef
4141

42-
$(eval $(call BuildPackage,$(PKG_NAME)))
42+
$(eval $(call BuildPackage,lua-openssl))

lang/lua-penlight/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PKG_LICENSE_FILES:=LICENSE.md
1919

2020
include $(INCLUDE_DIR)/package.mk
2121

22-
define Package/$(PKG_NAME)
22+
define Package/lua-penlight
2323
SUBMENU:=Lua
2424
SECTION:=lang
2525
CATEGORY:=Languages
@@ -29,7 +29,7 @@ define Package/$(PKG_NAME)
2929
MAINTAINER:= Karl Palsson <[email protected]>
3030
endef
3131

32-
define Package/$(PKG_NAME)/description
32+
define Package/lua-penlight/description
3333
It is often said of Lua that it does not include batteries.
3434
Penlight is the batteries.
3535
endef
@@ -38,9 +38,9 @@ define Build/Compile
3838
echo "Nothing to compile, pure lua package"
3939
endef
4040

41-
define Package/$(PKG_NAME)/install
41+
define Package/lua-penlight/install
4242
$(INSTALL_DIR) $(1)/usr/lib/lua
4343
$(CP) $(PKG_BUILD_DIR)/lua/pl $(1)/usr/lib/lua
4444
endef
4545

46-
$(eval $(call BuildPackage,$(PKG_NAME)))
46+
$(eval $(call BuildPackage,lua-penlight))

libs/libarchive/Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ PKG_FIXUP:=autoreconf
2222

2323
include $(INCLUDE_DIR)/package.mk
2424

25-
define Package/$(PKG_NAME)/Default
25+
define Package/libarchive/Default
2626
SECTION:=libs
2727
CATEGORY:=Libraries
2828
DEPENDS:=+zlib +liblzma +libbz2 +libexpat
2929
TITLE:=Multi-format archive and compression library
3030
URL:=http://www.libarchive.org/
3131
endef
3232

33-
define Package/$(PKG_NAME)
34-
$(call Package/$(PKG_NAME)/Default)
33+
define Package/libarchive
34+
$(call Package/libarchive/Default)
3535
DEPENDS += +libopenssl
3636
endef
3737

38-
define Package/$(PKG_NAME)-noopenssl
39-
$(call Package/$(PKG_NAME)/Default)
38+
define Package/libarchive-noopenssl
39+
$(call Package/libarchive/Default)
4040
TITLE += (without OpenSSL dependency)
4141
VARIANT:=noopenssl
4242
endef
@@ -90,7 +90,7 @@ define Package/bsdtar/install
9090
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bsdtar $(1)/usr/bin
9191
endef
9292

93-
Package/$(PKG_NAME)-noopenssl/install = $(Package/$(PKG_NAME)/install)
93+
Package/libarchive-noopenssl/install = $(Package/libarchive/install)
9494

9595
$(eval $(call BuildPackage,libarchive))
9696
$(eval $(call BuildPackage,libarchive-noopenssl))

libs/libwebsockets/Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
3939
# CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON
4040

4141

42-
define Package/$(PKG_NAME)/Default
42+
define Package/libwebsockets/Default
4343
SECTION:=libs
4444
CATEGORY:=Libraries
4545
TITLE:=libwebsockets
@@ -49,21 +49,21 @@ define Package/$(PKG_NAME)/Default
4949
endef
5050

5151
define Package/libwebsockets-openssl
52-
$(call Package/$(PKG_NAME)/Default)
52+
$(call Package/libwebsockets/Default)
5353
TITLE += (OpenSSL)
5454
DEPENDS += +libopenssl
5555
VARIANT:=openssl
5656
endef
5757

5858
define Package/libwebsockets-cyassl
59-
$(call Package/$(PKG_NAME)/Default)
59+
$(call Package/libwebsockets/Default)
6060
TITLE += (CyaSSL)
6161
DEPENDS += +libcyassl
6262
VARIANT:=cyassl
6363
endef
6464

6565
define Package/libwebsockets-full
66-
$(call Package/$(PKG_NAME)/Default)
66+
$(call Package/libwebsockets/Default)
6767
TITLE += (Full - OpenSSL, libuv, plugins, CGI)
6868
DEPENDS += +libopenssl +libuv
6969
VARIANT:=full
@@ -102,9 +102,9 @@ define Package/libwebsockets/install
102102
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
103103
endef
104104

105-
Package/$(PKG_NAME)-cyassl/install = $(Package/$(PKG_NAME)/install)
106-
Package/$(PKG_NAME)-openssl/install = $(Package/$(PKG_NAME)/install)
107-
Package/$(PKG_NAME)-full/install = $(Package/$(PKG_NAME)/install)
105+
Package/libwebsockets-cyassl/install = $(Package/libwesockets/install)
106+
Package/libwebsockets-openssl/install = $(Package/libwebsockets/install)
107+
Package/libwesockets-full/install = $(Package/libwebsockets/install)
108108

109109
$(eval $(call BuildPackage,libwebsockets-openssl))
110110
$(eval $(call BuildPackage,libwebsockets-cyassl))

libs/musl-fts/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ PKG_INSTALL:=1
3030

3131
include $(INCLUDE_DIR)/package.mk
3232

33-
define Package/$(PKG_NAME)
33+
define Package/musl-fts
3434
SECTION:=libs
3535
CATEGORY:=Libraries
3636
TITLE:=fts implementation for musl libc
3737
URL:=https://github.com/pullmoll/musl-fts
3838
DEPENDS:= +libpthread
3939
endef
4040

41-
define Package/$(PKG_NAME)/description
41+
define Package/musl-fts/description
4242
The musl-fts package implements the fts(3) functions fts_open, fts_read, fts_children, fts_set and fts_close, which are missing in musl libc.
4343
endef
4444

@@ -51,9 +51,9 @@ define Build/InstallDev
5151
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/musl-fts.pc $(1)/usr/lib/pkgconfig/
5252
endef
5353

54-
define Package/$(PKG_NAME)/install
54+
define Package/musl-fts/install
5555
$(INSTALL_DIR) $(1)/usr/lib
5656
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfts.so* $(1)/usr/lib/
5757
endef
5858

59-
$(eval $(call BuildPackage,$(PKG_NAME)))
59+
$(eval $(call BuildPackage,musl-fts))

mail/ssmtp/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ include $(INCLUDE_DIR)/package.mk
2121

2222
TARGET_CFLAGS += $(TARGET_CPPFLAGS)
2323

24-
define Package/$(PKG_NAME)
24+
define Package/ssmtp
2525
SECTION:=mail
2626
CATEGORY:=Mail
2727
DEPENDS:=+libopenssl
2828
TITLE:=A minimal and secure mail sender with ssl support
2929
URL:=http://packages.debian.org/ssmtp
3030
endef
3131

32-
define Package/$(PKG_NAME)/description
32+
define Package/ssmtp/description
3333
A secure, effective and simple way of getting mail off a system to your mail hub.
3434
Mail is simply forwarded to the configured mailhost, no daemons running in the background.
3535
Extremely easy configuration.
3636

3737
endef
3838

39-
define Package/$(PKG_NAME)/conffiles
39+
define Package/ssmtp/conffiles
4040
/etc/ssmtp/ssmtp.conf
4141
/etc/ssmtp/revaliases
4242
endef
@@ -47,7 +47,7 @@ CONFIGURE_VARS += \
4747
CONFIGURE_ARGS += \
4848
--enable-ssl
4949

50-
define Package/$(PKG_NAME)/install
50+
define Package/ssmtp/install
5151
$(INSTALL_DIR) $(1)/etc/ssmtp
5252
$(INSTALL_CONF) $(PKG_BUILD_DIR)/ssmtp.conf $(1)/etc/ssmtp/
5353
$(INSTALL_DATA) $(PKG_BUILD_DIR)/revaliases $(1)/etc/ssmtp/
@@ -56,4 +56,4 @@ define Package/$(PKG_NAME)/install
5656
ln -s /usr/sbin/ssmtp $(1)/usr/sbin/sendmail
5757
endef
5858

59-
$(eval $(call BuildPackage,$(PKG_NAME)))
59+
$(eval $(call BuildPackage,ssmtp))

net/adblock/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ PKG_MAINTAINER:=Dirk Brenken <[email protected]>
1313

1414
include $(INCLUDE_DIR)/package.mk
1515

16-
define Package/$(PKG_NAME)
16+
define Package/adblock
1717
SECTION:=net
1818
CATEGORY:=Network
1919
TITLE:=Powerful adblock script to block ad/abuse domains
2020
PKGARCH:=all
2121
endef
2222

23-
define Package/$(PKG_NAME)/description
23+
define Package/adblock/description
2424
Powerful adblock script to block ad/abuse domains via dnsmasq or unbound dns backend.
2525
The script supports many domain blacklist sites plus manual black- and whitelist overrides.
2626
Please see https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md for further information.
2727

2828
endef
2929

30-
define Package/$(PKG_NAME)/conffiles
30+
define Package/adblock/conffiles
3131
/etc/config/adblock
3232
/etc/adblock/adblock.whitelist
3333
/etc/adblock/adblock.blacklist
@@ -42,7 +42,7 @@ endef
4242
define Build/Compile
4343
endef
4444

45-
define Package/$(PKG_NAME)/install
45+
define Package/adblock/install
4646
$(INSTALL_DIR) $(1)/usr/bin
4747
$(INSTALL_BIN) ./files/adblock.sh $(1)/usr/bin/
4848

@@ -57,4 +57,4 @@ define Package/$(PKG_NAME)/install
5757
$(INSTALL_CONF) ./files/adblock.whitelist $(1)/etc/adblock/
5858
endef
5959

60-
$(eval $(call BuildPackage,$(PKG_NAME)))
60+
$(eval $(call BuildPackage,adblock))

0 commit comments

Comments
 (0)