Makefile 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. # Copyright 2010 Vertical Communications
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=e2fsprogs
  9. PKG_VERSION:=1.42.12
  10. PKG_MD5SUM:=68255f51be017a93f2f6402fab06c2bf
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=@SF/e2fsprogs
  14. PKG_BUILD_DEPENDS:=util-linux
  15. PKG_INSTALL:=1
  16. PKG_BUILD_PARALLEL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/e2fsprogs/Default
  19. URL:=http://e2fsprogs.sourceforge.net/
  20. SUBMENU:=Filesystem
  21. endef
  22. define Package/e2fsprogs
  23. $(call Package/e2fsprogs/Default)
  24. SECTION:=utils
  25. CATEGORY:=Utilities
  26. TITLE:=Ext2/3/4 filesystem utilities
  27. DEPENDS:=+libuuid +libext2fs
  28. endef
  29. define Package/e2fsprogs/description
  30. This package contains essential ext2 filesystem utilities which consists of
  31. e2fsck, mke2fs and most of the other core ext2 filesystem utilities.
  32. endef
  33. define Package/libext2fs
  34. $(call Package/e2fsprogs/Default)
  35. SECTION:=libs
  36. CATEGORY:=Libraries
  37. TITLE:=ext2/3/4 filesystem library
  38. endef
  39. define Package/libext2fs/description
  40. libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
  41. endef
  42. define Package/tune2fs
  43. $(call Package/e2fsprogs)
  44. TITLE:=Ext2 Filesystem tune utility
  45. DEPENDS:= +e2fsprogs
  46. endef
  47. define Package/resize2fs
  48. $(call Package/e2fsprogs)
  49. TITLE:=Ext2 Filesystem resize utility
  50. DEPENDS:= +e2fsprogs
  51. endef
  52. define Package/badblocks
  53. $(call Package/e2fsprogs)
  54. TITLE:=Ext2 Filesystem badblocks utility
  55. DEPENDS:= +e2fsprogs
  56. endef
  57. define Package/dumpe2fs
  58. $(call Package/e2fsprogs)
  59. TITLE:=Ext2 Filesystem information dumping utility
  60. DEPENDS:= +e2fsprogs
  61. endef
  62. define Package/e2freefrag
  63. $(call Package/e2fsprogs)
  64. TITLE:=Ext2 Filesystem free space fragmentation information utility
  65. DEPENDS:= +e2fsprogs
  66. endef
  67. define Package/filefrag
  68. $(call Package/e2fsprogs)
  69. TITLE:=Ext2 Filesystem file fragmentation report utility
  70. DEPENDS:= +e2fsprogs
  71. endef
  72. define Package/debugfs
  73. $(call Package/e2fsprogs)
  74. TITLE:=Ext2 Filesystem debugger
  75. DEPENDS:= +e2fsprogs
  76. endef
  77. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
  78. CONFIGURE_VARS += \
  79. ac_cv_lib_pthread_sem_init=no
  80. CONFIGURE_ARGS += \
  81. --disable-testio-debug \
  82. --enable-elf-shlibs \
  83. --disable-libuuid \
  84. --enable-libblkid \
  85. --disable-uuidd \
  86. --disable-tls \
  87. --disable-nls \
  88. --disable-rpath
  89. define Build/Prepare
  90. $(call Build/Prepare/Default)
  91. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
  92. endef
  93. define Build/Compile
  94. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/util \
  95. BUILDCC="$(HOSTCC)" \
  96. CFLAGS="" \
  97. CPPFLAGS="" \
  98. LDFLAGS="" \
  99. subst
  100. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  101. LDFLAGS=-Wl,--gc-sections \
  102. BUILDCC="$(HOSTCC)" \
  103. DESTDIR="$(PKG_INSTALL_DIR)" \
  104. LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
  105. all
  106. endef
  107. define Build/InstallDev
  108. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  109. $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/ext2fs.pc $(1)/usr/lib/pkgconfig
  110. $(CP) $(PKG_BUILD_DIR)/lib/et/com_err.pc $(1)/usr/lib/pkgconfig
  111. $(INSTALL_DIR) $(1)/usr/lib
  112. $(CP) $(PKG_BUILD_DIR)/lib/libext2fs.{so,a}* $(1)/usr/lib
  113. $(CP) $(PKG_BUILD_DIR)/lib/libcom_err.{so,a}* $(1)/usr/lib
  114. $(INSTALL_DIR) $(1)/usr/include/ext2fs
  115. $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/*.h $(1)/usr/include/ext2fs
  116. $(INSTALL_DIR) $(1)/usr/include/et
  117. $(CP) $(PKG_BUILD_DIR)/lib/et/*.h $(1)/usr/include/et
  118. endef
  119. define Package/e2fsprogs/conffiles
  120. /etc/e2fsck.conf
  121. endef
  122. define Package/e2fsprogs/install
  123. $(INSTALL_DIR) $(1)/usr/sbin
  124. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
  125. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
  126. $(LN) mke2fs $(1)/usr/sbin/mkfs.ext2
  127. $(LN) mke2fs $(1)/usr/sbin/mkfs.ext3
  128. $(LN) mke2fs $(1)/usr/sbin/mkfs.ext4
  129. $(LN) e2fsck $(1)/usr/sbin/fsck.ext2
  130. $(LN) e2fsck $(1)/usr/sbin/fsck.ext3
  131. $(LN) e2fsck $(1)/usr/sbin/fsck.ext4
  132. $(INSTALL_DIR) $(1)/usr/lib
  133. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
  134. $(INSTALL_DIR) $(1)/etc/init.d
  135. $(INSTALL_DIR) $(1)/lib/functions/fsck
  136. $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
  137. $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
  138. endef
  139. define Package/libcom_err/install
  140. endef
  141. define Package/libext2fs/install
  142. $(INSTALL_DIR) $(1)/usr/lib
  143. $(CP) \
  144. $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* \
  145. $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* \
  146. $(1)/usr/lib/
  147. endef
  148. define Package/libext2fs/install_lib
  149. $(INSTALL_DIR) $(1)/usr/lib
  150. $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
  151. endef
  152. define Package/tune2fs/install
  153. $(INSTALL_DIR) $(1)/usr/sbin
  154. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
  155. $(LN) tune2fs $(1)/usr/sbin/findfs
  156. endef
  157. define Package/resize2fs/install
  158. $(INSTALL_DIR) $(1)/usr/sbin
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
  160. endef
  161. define Package/badblocks/install
  162. $(INSTALL_DIR) $(1)/usr/sbin
  163. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
  164. endef
  165. define Package/dumpe2fs/install
  166. $(INSTALL_DIR) $(1)/usr/sbin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dumpe2fs $(1)/usr/sbin/
  168. endef
  169. define Package/e2freefrag/install
  170. $(INSTALL_DIR) $(1)/usr/sbin
  171. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/
  172. endef
  173. define Package/filefrag/install
  174. $(INSTALL_DIR) $(1)/usr/sbin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/
  176. endef
  177. define Package/debugfs/install
  178. $(INSTALL_DIR) $(1)/usr/sbin
  179. $(INSTALL_DIR) $(1)/usr/lib
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/debugfs $(1)/usr/sbin/
  181. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libss.so.* $(1)/usr/lib/
  182. endef
  183. $(eval $(call BuildPackage,e2fsprogs))
  184. $(eval $(call BuildPackage,libext2fs))
  185. $(eval $(call BuildPackage,tune2fs))
  186. $(eval $(call BuildPackage,resize2fs))
  187. $(eval $(call BuildPackage,badblocks))
  188. $(eval $(call BuildPackage,dumpe2fs))
  189. $(eval $(call BuildPackage,e2freefrag))
  190. $(eval $(call BuildPackage,filefrag))
  191. $(eval $(call BuildPackage,debugfs))