blob: f5c3e228c280593f3d2ae6669a9f402246c755cd [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/)
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libmaxminddb
11PKG_VERSION:=1.11.0
12PKG_RELEASE=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=https://github.com/maxmind/libmaxminddb/releases/download/$(PKG_VERSION)
16PKG_HASH:=b2eea79a96fed77ad4d6c39ec34fed83d45fcb75a31c58956813d58dcf30b19f
17
18PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec1@gmail.com>
19PKG_LICENSE:=Apache-2.0
20PKG_LICENSE_FILES:=LICENSE
21PKG_CPE_ID:=cpe:/a:maxmind:libmaxminddb
22
23include $(INCLUDE_DIR)/package.mk
24include $(INCLUDE_DIR)/cmake.mk
25
26define Package/libmaxminddb
27 SECTION:=libs
28 CATEGORY:=Libraries
29 TITLE:=A library for working with MaxMind DB files
30 URL:=https://maxmind.github.io/libmaxminddb/
31endef
32
33define Package/libmaxminddb/description
34 The libmaxminddb library provides functions for working MaxMind DB files.
35endef
36
37CMAKE_OPTIONS += \
38 -DBUILD_SHARED_LIBS=ON \
39 -DBUILD_TESTING=OFF
40
41define Build/InstallDev
42 $(INSTALL_DIR) $(1)/usr/include/
43 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
44 $(INSTALL_DIR) $(1)/usr/lib/
45 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmaxminddb.so* $(1)/usr/lib/
46 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
47 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmaxminddb.pc $(1)/usr/lib/pkgconfig
48 $(SED) 's,libdir=lib,libdir=$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libmaxminddb.pc
49 $(SED) 's,includedir=include,includedir=$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libmaxminddb.pc
50endef
51
52define Package/libmaxminddb/install
53 $(INSTALL_DIR) $(1)/usr/bin
54 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mmdblookup $(1)/usr/bin/
55 $(INSTALL_DIR) $(1)/usr/lib
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmaxminddb.so* $(1)/usr/lib/
57endef
58
59$(eval $(call BuildPackage,libmaxminddb))