| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 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 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=libmaxminddb |
| 11 | PKG_VERSION:=1.11.0 |
| 12 | PKG_RELEASE=2 |
| 13 | |
| 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 15 | PKG_SOURCE_URL:=https://github.com/maxmind/libmaxminddb/releases/download/$(PKG_VERSION) |
| 16 | PKG_HASH:=b2eea79a96fed77ad4d6c39ec34fed83d45fcb75a31c58956813d58dcf30b19f |
| 17 | |
| 18 | PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec1@gmail.com> |
| 19 | PKG_LICENSE:=Apache-2.0 |
| 20 | PKG_LICENSE_FILES:=LICENSE |
| 21 | PKG_CPE_ID:=cpe:/a:maxmind:libmaxminddb |
| 22 | |
| 23 | include $(INCLUDE_DIR)/package.mk |
| 24 | include $(INCLUDE_DIR)/cmake.mk |
| 25 | |
| 26 | define 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/ |
| 31 | endef |
| 32 | |
| 33 | define Package/libmaxminddb/description |
| 34 | The libmaxminddb library provides functions for working MaxMind DB files. |
| 35 | endef |
| 36 | |
| 37 | CMAKE_OPTIONS += \ |
| 38 | -DBUILD_SHARED_LIBS=ON \ |
| 39 | -DBUILD_TESTING=OFF |
| 40 | |
| 41 | define 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 |
| 50 | endef |
| 51 | |
| 52 | define 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/ |
| 57 | endef |
| 58 | |
| 59 | $(eval $(call BuildPackage,libmaxminddb)) |