treewide: assign PKG_CPE_ID
[feed/packages.git] / libs / libzip / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=libzip
9 PKG_VERSION:=1.10.1
10 PKG_RELEASE:=1
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
13 PKG_SOURCE_URL:=https://libzip.org/download/
14 PKG_HASH:=dc3c8d5b4c8bbd09626864f6bcf93de701540f761d76b85d7c7d710f4bd90318
15
16 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
17
18 PKG_LICENSE:=BSD-3-Clause
19 PKG_LICENSE_FILES:=LICENSE
20 PKG_CPE_ID:=cpe:/a:libzip:libzip
21
22 CMAKE_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/cmake.mk
26
27 define Package/libzip/Default
28 TITLE:=libzip ($(2))
29 URL:=https://libzip.org/
30 SECTION:=libs
31 CATEGORY:=Libraries
32 SUBMENU:=Compression
33 DEPENDS:=+zlib $(3)
34 VARIANT:=$(1)
35 PROVIDES:=libzip
36 endef
37
38 define Package/libzip-$(BUILD_VARIANT)/description
39 A C library for reading, creating, and modifying zip archives.
40 endef
41
42 Package/libzip-nossl=$(call Package/libzip/Default,nossl,w/o encryption support)
43 Package/libzip-openssl=$(call Package/libzip/Default,openssl,OpenSSL,+PACKAGE_libzip-openssl:libopenssl)
44 Package/libzip-gnutls=$(call Package/libzip/Default,gnutls,GnuTLS,+PACKAGE_libzip-gnutls:libgnutls)
45 Package/libzip-mbedtls=$(call Package/libzip/Default,mbedtls,mbedTLS,+PACKAGE_libzip-mbedtls:libmbedtls)
46
47 define Package/zipcmp
48 TITLE:=zipcmp
49 URL:=https://libzip.org/
50 SECTION:=utils
51 CATEGORY:=Utilities
52 SUBMENU:=Compression
53 DEPENDS:=+libzip +USE_MUSL:musl-fts
54 endef
55
56 define Package/zipcmp/description
57 This package contains the command line tool zipcmp from libzip.
58 endef
59
60 define Package/zipmerge
61 TITLE:=zipmerge
62 URL:=https://libzip.org/
63 SECTION:=utils
64 CATEGORY:=Utilities
65 SUBMENU:=Compression
66 DEPENDS:=+libzip
67 endef
68
69 define Package/zipmerge/description
70 This package contains the command line tool zipmerge from libzip.
71 endef
72
73 define Package/ziptool
74 TITLE:=ziptool
75 URL:=https://libzip.org/
76 SECTION:=utils
77 CATEGORY:=Utilities
78 SUBMENU:=Compression
79 DEPENDS:=+libzip
80 endef
81
82 define Package/ziptool/description
83 This package contains the command line tool ziptool from libzip.
84 endef
85
86 CMAKE_OPTIONS += -DENABLE_COMMONCRYPTO=OFF
87 ifeq ($(BUILD_VARIANT),gnutls)
88 CMAKE_OPTIONS += -DENABLE_GNUTLS=ON
89 else
90 CMAKE_OPTIONS += -DENABLE_GNUTLS=OFF
91 endif
92 ifeq ($(BUILD_VARIANT),openssl)
93 CMAKE_OPTIONS += -DENABLE_OPENSSL=ON
94 else
95 CMAKE_OPTIONS += -DENABLE_OPENSSL=OFF
96 endif
97 ifeq ($(BUILD_VARIANT),mbedtls)
98 CMAKE_OPTIONS += -DENABLE_MBEDTLS=ON
99 else
100 CMAKE_OPTIONS += -DENABLE_MBEDTLS=OFF
101 endif
102
103 CMAKE_OPTIONS += -DENABLE_BZIP2=OFF
104 CMAKE_OPTIONS += -DENABLE_LZMA=OFF
105 CMAKE_OPTIONS += -DENABLE_ZSTD=OFF
106 CMAKE_OPTIONS += -DBUILD_REGRESS=OFF
107 CMAKE_OPTIONS += -DBUILD_EXAMPLES=OFF
108 CMAKE_OPTIONS += -DBUILD_DOC=OFF
109 CMAKE_OPTIONS += -DBUILD_TOOLS=ON
110
111 define Package/libzip-$(BUILD_VARIANT)/install
112 $(INSTALL_DIR) $(1)/usr/lib
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzip.so.* $(1)/usr/lib/
114 endef
115
116 define Package/zipcmp/install
117 $(INSTALL_DIR) $(1)/usr/bin
118 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/zipcmp $(1)/usr/bin/
119 endef
120
121 define Package/zipmerge/install
122 $(INSTALL_DIR) $(1)/usr/bin
123 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/zipmerge $(1)/usr/bin/
124 endef
125
126 define Package/ziptool/install
127 $(INSTALL_DIR) $(1)/usr/bin
128 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ziptool $(1)/usr/bin/
129 endef
130
131 $(eval $(call BuildPackage,libzip-gnutls))
132 $(eval $(call BuildPackage,libzip-mbedtls))
133 $(eval $(call BuildPackage,libzip-openssl))
134 $(eval $(call BuildPackage,libzip-nossl))
135 $(eval $(call BuildPackage,zipcmp))
136 $(eval $(call BuildPackage,zipmerge))
137 $(eval $(call BuildPackage,ziptool))