| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | include $(TOPDIR)/rules.mk |
| 2 | |
| 3 | PKG_NAME:=libtraceevent |
| 4 | PKG_VERSION:=1.8.2 |
| 5 | PKG_RELEASE:=1 |
| 6 | |
| 7 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 8 | PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/ |
| 9 | PKG_HASH:=919f0c024c7b5059eace52d854d4df00ae7e361a4033e1b4d6fe01d97064a1b9 |
| 10 | |
| 11 | PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org> |
| 12 | |
| 13 | PKG_FIXUP:=autoreconf |
| 14 | PKG_INSTALL:=1 |
| 15 | |
| 16 | include $(INCLUDE_DIR)/package.mk |
| 17 | |
| 18 | define Package/libtraceevent |
| 19 | SECTION:=libs |
| 20 | CATEGORY:=Libraries |
| 21 | TITLE:=Linux kernel trace event library |
| 22 | URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git |
| 23 | ABI_VERSION:=0 |
| 24 | endef |
| 25 | |
| 26 | define Package/libtraceevent/description |
| 27 | The libtraceevent library provides APIs to access kernel tracepoint events, located in |
| 28 | the tracefs file system under the events directory. |
| 29 | endef |
| 30 | |
| 31 | define Package/libtraceevent-extra |
| 32 | SECTION:=libs |
| 33 | CATEGORY:=Libraries |
| 34 | TITLE:=Extra plugins for libtraceevent |
| 35 | DEPENDS:= |
| 36 | endef |
| 37 | |
| 38 | CONFIGURE_ARGS+= \ |
| 39 | --enable-shared \ |
| 40 | --enable-static |
| 41 | |
| 42 | PLUGINS_DIR := $(PKG_BUILD_DIR)/plugins |
| 43 | PLUGINS_MAIN := function hrtimer mac80211 sched_switch |
| 44 | |
| 45 | define Build/InstallDev |
| 46 | $(INSTALL_DIR) $(1)/usr/include |
| 47 | $(CP) $(PKG_BUILD_DIR)/include/traceevent $(1)/usr/include/ |
| 48 | $(INSTALL_DIR) $(1)/usr/lib |
| 49 | $(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.{a,so*} $(1)/usr/lib/ |
| 50 | $(INSTALL_DIR) $(1)/usr/lib/pkgconfig |
| 51 | $(CP) $(PKG_BUILD_DIR)/libtraceevent.pc $(1)/usr/lib/pkgconfig/ |
| 52 | endef |
| 53 | |
| 54 | define Package/libtraceevent/install |
| 55 | $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins |
| 56 | $(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.so.* $(1)/usr/lib/ |
| 57 | $(INSTALL_DIR) $(1)/usr/lib |
| 58 | $(CP) \ |
| 59 | $(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \ |
| 60 | $(1)/usr/lib/traceevent/plugins |
| 61 | endef |
| 62 | |
| 63 | define Package/libtraceevent-extra/install |
| 64 | $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins |
| 65 | $(CP) \ |
| 66 | $$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \ |
| 67 | $$(filter-out $(PLUGINS_MAIN), \ |
| 68 | $$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \ |
| 69 | $$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \ |
| 70 | $(1)/usr/lib/traceevent/plugins |
| 71 | endef |
| 72 | |
| 73 | $(eval $(call BuildPackage,libtraceevent)) |
| 74 | $(eval $(call BuildPackage,libtraceevent-extra)) |