cryptsetup: fix compilation with musl 1.2.4
[feed/packages.git] / utils / cryptsetup / Makefile
1 #
2 # Copyright (C) 2006-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=cryptsetup
11 PKG_VERSION:=2.6.0
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v2.6
16 PKG_HASH:=44397ba76e75a9cde5b02177bc63cd7af428a785788e3a7067733e7761842735
17
18 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
19 PKG_LICENSE:=GPL-2.0-or-later LGPL-2.1-or-later
20 PKG_LICENSE_FILES:=COPYING COPYING.LGPL
21
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
27
28 include $(INCLUDE_DIR)/package.mk
29 include $(INCLUDE_DIR)/nls.mk
30
31 define Package/cryptsetup
32 SECTION:=utils
33 CATEGORY:=Utilities
34 SUBMENU:=Encryption
35 TITLE:=Cryptsetup
36 DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) +libblkid +libuuid +libpopt +lvm2 \
37 +libdevmapper +libjson-c +@KERNEL_DIRECT_IO +kmod-crypto-user
38 URL:=https://gitlab.com/cryptsetup/cryptsetup/
39 endef
40
41 define Package/cryptsetup/description
42 Cryptsetup is utility used to conveniently setup disk encryption based on DMCrypt kernel module.
43 endef
44
45 define Package/cryptsetup-ssh
46 SECTION:=utils
47 CATEGORY:=Utilities
48 SUBMENU:=Encryption
49 TITLE:=Cryptsetup SSH token
50 DEPENDS:=+cryptsetup +PACKAGE_cryptsetup-ssh:libssh
51 URL:=https://gitlab.com/cryptsetup/cryptsetup/
52 endef
53
54 define Package/cryptsetup-ssh/description
55 Experimental SSH token support for cryptsetup.
56 endef
57
58 CONFIGURE_ARGS += \
59 --disable-asciidoc \
60 --disable-cryptsetup-reencrypt \
61 --disable-integritysetup \
62 --disable-selinux \
63 --disable-rpath \
64 --disable-veritysetup \
65 --disable-udev \
66 --with-default-luks-format=LUKS2 \
67 --with-luks2-lock-path=/var/run/cryptsetup \
68 --with-crypto_backend=kernel
69
70 ifeq ($(CONFIG_PACKAGE_cryptsetup-ssh),)
71 CONFIGURE_ARGS += --disable-ssh-token
72 endif
73
74 CONFIGURE_VARS += \
75 LIBSSH_CFLAGS="-I$(STAGING_DIR)/usr/include" \
76 LIBSSH_LIBS="-L$(STAGING_DIR)/usr/lib -lssh"
77
78 TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
79 TARGET_LDFLAGS += -Wl,--gc-sections $(if $(INTL_FULL),-lintl)
80
81 define Build/InstallDev
82 $(INSTALL_DIR) $(1)/usr/include
83 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libcryptsetup.h $(1)/usr/include
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptsetup.so* $(1)/usr/lib
86 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
87 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libcryptsetup.pc $(1)/usr/lib/pkgconfig
88 endef
89
90 define Package/cryptsetup/install
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptsetup.so* $(1)/usr/lib
93 $(INSTALL_DIR) $(1)/usr/sbin
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/cryptsetup $(1)/usr/sbin
95 endef
96
97 define Package/cryptsetup-ssh/install
98 $(INSTALL_DIR) $(1)/usr/lib/cryptsetup
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/cryptsetup/* $(1)/usr/lib/cryptsetup
100 $(INSTALL_DIR) $(1)/usr/sbin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/cryptsetup-ssh $(1)/usr/sbin
102 endef
103
104 $(eval $(call BuildPackage,cryptsetup))
105 $(eval $(call BuildPackage,cryptsetup-ssh))