Browse Source

Merge pull request #924 from jdub/kmod

kmod: Add kmod package
Steven Barth 10 years ago
parent
commit
39c354198a
1 changed files with 91 additions and 0 deletions
  1. 91
    0
      utils/kmod/Makefile

+ 91
- 0
utils/kmod/Makefile View File

@@ -0,0 +1,91 @@
1
+#
2
+# Copyright (C) 2015 Jeff Waugh
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:=kmod
11
+PKG_VERSION:=19
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=https://www.kernel.org/pub/linux/utils/kernel/kmod/
16
+PKG_MD5SUM:=a08643f814aa4efc12211c6e5909f4d9
17
+PKG_MAINTAINER:=Jeff Waugh <jdub@bethesignal.org>
18
+PKG_LICENSE:=LGPL-2.1+
19
+PKG_LICENSE_FILES:=COPYING
20
+
21
+PKG_INSTALL:=1
22
+
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+CONFIGURE_ARGS += --with-zlib
26
+
27
+define Package/kmod/Default
28
+  SECTION:=utils
29
+  CATEGORY:=Utilities
30
+  TITLE:=Linux kernel module handling
31
+  URL:=https://www.kernel.org/pub/linux/utils/kernel/kmod/
32
+  DEPENDS:=+zlib
33
+endef
34
+
35
+
36
+define Package/kmod
37
+$(call Package/kmod/Default)
38
+  TITLE+= (tools)
39
+endef
40
+
41
+define Package/kmod/description
42
+Linux kernel module handling
43
+ kmod is a set of tools to handle common tasks with Linux kernel modules like
44
+ insert, remove, list, check properties, resolve dependencies and aliases.
45
+endef
46
+
47
+LEGACY_BINARIES:= \
48
+	depmod \
49
+	insmod \
50
+	lsmod \
51
+	modinfo \
52
+	modprobe \
53
+	rmmod
54
+
55
+define Package/kmod/install
56
+	$(INSTALL_DIR) $(1)/sbin
57
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/kmod $(1)/sbin
58
+
59
+	for b in $(LEGACY_BINARIES); do \
60
+		ln -sf kmod $(1)/sbin/$$$$b ; \
61
+	done
62
+endef
63
+
64
+
65
+define Package/libkmod
66
+$(call Package/kmod/Default)
67
+  SECTION:=libs
68
+  CATEGORY:=Libraries
69
+  TITLE+= (library)
70
+endef
71
+
72
+define Package/libkmod/install
73
+	$(INSTALL_DIR) $(1)/usr/lib
74
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libkmod.so.* $(1)/usr/lib/
75
+endef
76
+
77
+
78
+define Build/InstallDev
79
+	$(INSTALL_DIR) $(1)/usr/include
80
+	$(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr/
81
+
82
+	$(INSTALL_DIR) $(1)/usr/lib
83
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libkmod.{so*,la} $(1)/usr/lib/
84
+
85
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
86
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libkmod.pc $(1)/usr/lib/pkgconfig/
87
+endef
88
+
89
+
90
+$(eval $(call BuildPackage,kmod))
91
+$(eval $(call BuildPackage,libkmod))