aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-06-16 16:18:38 -0700
committerRosen Penev <rosenp@gmail.com>2020-06-22 18:33:16 -0700
commitbd5acfb8e8409d541048ef21f7618b415adea1b7 (patch)
treed2bd251837a8acd4b3e490b7ac950526061d8c36
parent83f9bd1ea0eaae9a502564292871a3bc0d0ef3ee (diff)
libxcrypt: add
libxcrypt is an external version of libc's libcrypt. It allows to use algorithms now available with the libc. musl in OpenWrt for example patches out several algorithms for size reasons. But for shadow-utils, size does not really matter. The hashes are set to solaris as that default gives a good balance between compatibility and size. It includes: bcrypt, bcrypt_a, sha512crypt, sha256crypt, md5crypt, descrypt The STRONG default adds several algorithms not supported by shadow-utils. Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r--libs/libxcrypt/Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/libs/libxcrypt/Makefile b/libs/libxcrypt/Makefile
new file mode 100644
index 000000000..acfde2f08
--- /dev/null
+++ b/libs/libxcrypt/Makefile
@@ -0,0 +1,55 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libxcrypt
+PKG_VERSION:=4.4.16
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/besser82/libxcrypt/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=a98f65b8baffa2b5ba68ee53c10c0a328166ef4116bce3baece190c8ce01f375
+
+PKG_MAINTAINER:=
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING.LIB
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libxcrypt
+ SECTION:=libs
+ CATEGORY:=Libraries
+ URL:=https://github.com/besser82/libxcrypt
+ TITLE:=Extended crypt library
+ BUILDONLY:=1
+endef
+
+define Package/libxcrypt/description
+ libxcrypt is a modern library for one-way hashing of passwords. It supports
+ a wide variety of both modern and historical hashing methods: yescrypt,
+ gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, md5crypt, SunMD5,
+ sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt. It provides the traditional
+ Unix crypt and crypt_r interfaces, as well as a set of extended interfaces
+ pioneered by Openwall Linux, crypt_rn, crypt_ra, crypt_gensalt,
+ crypt_gensalt_rn, and crypt_gensalt_ra.
+endef
+
+CONFIGURE_ARGS += \
+ --disable-shared \
+ --disable-failure-tokens \
+ --disable-xcrypt-compat-files \
+ --disable-obsolete-api \
+ --enable-hashes=solaris
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib/libxcrypt
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrypt.{a,la} $(1)/usr/lib/libxcrypt
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*crypt.pc $(1)/usr/lib/pkgconfig/
+endef
+
+$(eval $(call BuildPackage,libxcrypt))