Browse Source

file: import from oldpackages (libmagic)

Signed-off-by: Ted Hess <thess@kitschensync.net>
Ted Hess 10 years ago
parent
commit
be2c5beec7
1 changed files with 94 additions and 0 deletions
  1. 94
    0
      libs/file/Makefile

+ 94
- 0
libs/file/Makefile View File

@@ -0,0 +1,94 @@
1
+#
2
+# Copyright (C) 2007-2014 OpenWrt.org
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:=file
11
+PKG_VERSION:=5.11
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
16
+PKG_MD5SUM:=16a407bd66d6c7a832f3a5c0d609c27b
17
+
18
+PKG_LICENSE:=BSD-2c
19
+PKG_LICENSE_FILES:=COPYING
20
+
21
+PKG_FIXUP:=autoreconf
22
+PKG_INSTALL:=1
23
+PKG_BUILD_PARALLEL:=1
24
+
25
+include $(INCLUDE_DIR)/package.mk
26
+
27
+define Package/file/Default
28
+  TITLE:=File type determination
29
+  URL:=ftp://ftp.astron.com/pub/file/
30
+  MAINTAINER:=Luka Perkov <openwrt@lukaperkov.net>
31
+endef
32
+
33
+define Package/file
34
+$(call package/file/Default)
35
+  SECTION:=utils
36
+  CATEGORY:=Utilities
37
+  TITLE+= utility
38
+  DEPENDS:=+libmagic
39
+endef
40
+
41
+define Package/libmagic
42
+$(call package/file/Default)
43
+  SECTION:=libs
44
+  CATEGORY:=Libraries
45
+  TITLE+= library
46
+  DEPENDS:=+zlib
47
+endef
48
+
49
+CONFIGURE_ARGS += \
50
+	--enable-shared \
51
+	--enable-static \
52
+
53
+MAKE_PATH := src
54
+
55
+TARGET_CFLAGS += $(FPIC)
56
+
57
+define Build/Compile/magic
58
+	( cd $(PKG_BUILD_DIR)/magic/Magdir; \
59
+		for f in `ls`; do \
60
+			cat $$$${f}; \
61
+		done \
62
+	) > $(PKG_BUILD_DIR)/magic/magic
63
+endef
64
+Hooks/Compile/Post += Build/Compile/magic
65
+
66
+define Build/Install/magic
67
+	$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file
68
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/
69
+endef
70
+Hooks/Install/Post += Build/Install/magic
71
+
72
+define Build/InstallDev
73
+	$(INSTALL_DIR) $(1)/usr/include
74
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
75
+	$(INSTALL_DIR) $(1)/usr/lib
76
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
77
+endef
78
+
79
+define Package/file/install
80
+	$(INSTALL_DIR) $(1)/usr/bin
81
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/
82
+	$(INSTALL_DIR) $(1)/usr/share/misc
83
+	$(SED) "/^#/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
84
+	$(SED) "/^$$$$/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
85
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/misc/
86
+endef
87
+
88
+define Package/libmagic/install
89
+	$(INSTALL_DIR) $(1)/usr/lib
90
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
91
+endef
92
+
93
+$(eval $(call BuildPackage,file))
94
+$(eval $(call BuildPackage,libmagic))