Makefile 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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.44.3
  10. PKG_HASH:=5d899f7d30f481cc0c6a049ebe26ebe145f1b524182ea1ecde4086162d4e4bb6
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
  14. PKG_LICENSE:=GPL-2.0
  15. PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
  16. PKG_BUILD_DEPENDS:=util-linux e2fsprogs/host
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. define Package/e2fsprogs
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. SUBMENU:=Filesystem
  25. TITLE:=Ext2/3/4 filesystem utilities
  26. URL:=http://e2fsprogs.sourceforge.net/
  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. SECTION:=libs
  35. CATEGORY:=Libraries
  36. TITLE:=ext2/3/4 filesystem library
  37. URL:=http://e2fsprogs.sourceforge.net/
  38. DEPENDS:=+libuuid +libblkid +libss +libcomerr
  39. endef
  40. define Package/libext2fs/description
  41. libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
  42. endef
  43. define Package/libss
  44. SECTION:=libs
  45. CATEGORY:=Libraries
  46. TITLE:=command-line interface parsing library
  47. URL:=http://e2fsprogs.sourceforge.net/
  48. DEPENDS:=+libcomerr
  49. endef
  50. define Package/libss/description
  51. This pacakge contains libss, a command-line interface parsing library
  52. bundled with e2fsprogs.
  53. endef
  54. define Package/libcomerr
  55. SECTION:=libs
  56. CATEGORY:=Libraries
  57. TITLE:=common error description library
  58. URL:=http://e2fsprogs.sourceforge.net/
  59. DEPENDS:=+libuuid
  60. endef
  61. define Package/libcomerr/description
  62. This package contains libcom_err, the common error description library
  63. bundled with e2fsprogs.
  64. endef
  65. define Package/tune2fs
  66. $(call Package/e2fsprogs)
  67. TITLE:=Ext2 Filesystem tune utility
  68. DEPENDS:= +e2fsprogs
  69. endef
  70. define Package/resize2fs
  71. $(call Package/e2fsprogs)
  72. TITLE:=Ext2 Filesystem resize utility
  73. DEPENDS:= +e2fsprogs
  74. endef
  75. define Package/badblocks
  76. $(call Package/e2fsprogs)
  77. TITLE:=Ext2 Filesystem badblocks utility
  78. DEPENDS:= +e2fsprogs
  79. endef
  80. define Package/dumpe2fs
  81. $(call Package/e2fsprogs)
  82. TITLE:=Ext2 Filesystem information dumping utility
  83. DEPENDS:= +e2fsprogs
  84. endef
  85. define Package/e2freefrag
  86. $(call Package/e2fsprogs)
  87. TITLE:=Ext2 Filesystem free space fragmentation information utility
  88. DEPENDS:= +e2fsprogs
  89. endef
  90. define Package/filefrag
  91. $(call Package/e2fsprogs)
  92. TITLE:=Ext2 Filesystem file fragmentation report utility
  93. DEPENDS:= +e2fsprogs
  94. endef
  95. define Package/debugfs
  96. $(call Package/e2fsprogs)
  97. TITLE:=Ext2 Filesystem debugger
  98. DEPENDS:= +e2fsprogs
  99. endef
  100. define Package/chattr
  101. $(call Package/e2fsprogs)
  102. TITLE:=Ext2 Filesystem chattr utility
  103. DEPENDS:= +e2fsprogs
  104. endef
  105. define Package/lsattr
  106. $(call Package/e2fsprogs)
  107. TITLE:=Ext2 Filesystem lsattr utility
  108. DEPENDS:= +e2fsprogs
  109. endef
  110. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
  111. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
  112. TARGET_LDFLAGS += -flto
  113. CONFIGURE_ARGS += \
  114. --disable-testio-debug \
  115. --enable-elf-shlibs \
  116. --disable-libuuid \
  117. --disable-libblkid \
  118. --disable-uuidd \
  119. --disable-tls \
  120. --disable-nls \
  121. --disable-rpath \
  122. --disable-fuse2fs
  123. define Build/Prepare
  124. $(call Build/Prepare/Default)
  125. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
  126. endef
  127. define Build/Compile
  128. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/util \
  129. BUILDCC="$(HOSTCC)" \
  130. CFLAGS="" \
  131. CPPFLAGS="" \
  132. LDFLAGS="" \
  133. V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
  134. subst
  135. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  136. LDFLAGS=-Wl,--gc-sections \
  137. BUILDCC="$(HOSTCC)" \
  138. DESTDIR="$(PKG_INSTALL_DIR)" \
  139. ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \
  140. SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \
  141. V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
  142. all
  143. endef
  144. define Build/InstallDev
  145. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  146. $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/ext2fs.pc $(1)/usr/lib/pkgconfig
  147. $(CP) $(PKG_BUILD_DIR)/lib/et/com_err.pc $(1)/usr/lib/pkgconfig
  148. $(INSTALL_DIR) $(1)/usr/lib
  149. $(CP) $(PKG_BUILD_DIR)/lib/libext2fs.{so,a}* $(1)/usr/lib
  150. $(CP) $(PKG_BUILD_DIR)/lib/libcom_err.{so,a}* $(1)/usr/lib
  151. $(CP) $(PKG_BUILD_DIR)/lib/libss.{so,a}* $(1)/usr/lib
  152. $(INSTALL_DIR) $(1)/usr/include/ext2fs
  153. $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/*.h $(1)/usr/include/ext2fs
  154. $(INSTALL_DIR) $(1)/usr/include/et
  155. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/et/*.h $(1)/usr/include/et
  156. # Apparently there is some confusion
  157. echo "#include <et/com_err.h>" > $(1)/usr/include/com_err.h
  158. $(INSTALL_DIR) $(1)/usr/include/ss
  159. $(CP) \
  160. $(PKG_BUILD_DIR)/lib/ss/ss.h \
  161. $(PKG_BUILD_DIR)/lib/ss/ss_err.h \
  162. $(1)/usr/include/ss/
  163. endef
  164. define Host/Compile
  165. $(MAKE) $(PKG_JOBS) -C $(HOST_BUILD_DIR)/lib/ss mk_cmds
  166. $(MAKE) $(PKG_JOBS) -C $(HOST_BUILD_DIR)/lib/et compile_et
  167. endef
  168. define Host/Install
  169. $(INSTALL_DIR) $(1)/share/et
  170. $(CP) $(HOST_BUILD_DIR)/lib/et/et_[ch].awk $(1)/share/et/
  171. $(INSTALL_DIR) $(1)/share/ss
  172. $(CP) $(HOST_BUILD_DIR)/lib/ss/ct_c.{sed,awk} $(1)/share/ss/
  173. $(INSTALL_DIR) $(1)/bin
  174. $(CP) \
  175. $(HOST_BUILD_DIR)/lib/et/compile_et \
  176. $(HOST_BUILD_DIR)/lib/ss/mk_cmds \
  177. $(1)/bin/
  178. endef
  179. define Package/e2fsprogs/conffiles
  180. /etc/e2fsck.conf
  181. endef
  182. define Package/e2fsprogs/install
  183. $(INSTALL_DIR) $(1)/usr/sbin
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
  186. $(LN) mke2fs $(1)/usr/sbin/mkfs.ext2
  187. $(LN) mke2fs $(1)/usr/sbin/mkfs.ext3
  188. $(LN) mke2fs $(1)/usr/sbin/mkfs.ext4
  189. $(LN) e2fsck $(1)/usr/sbin/fsck.ext2
  190. $(LN) e2fsck $(1)/usr/sbin/fsck.ext3
  191. $(LN) e2fsck $(1)/usr/sbin/fsck.ext4
  192. $(INSTALL_DIR) $(1)/usr/lib
  193. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
  194. $(INSTALL_DIR) $(1)/etc/init.d
  195. $(INSTALL_DIR) $(1)/lib/functions/fsck
  196. $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
  197. $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
  198. endef
  199. define Package/libcomerr/install
  200. $(INSTALL_DIR) $(1)/usr/lib
  201. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so* $(1)/usr/lib/
  202. endef
  203. define Package/libss/install
  204. $(INSTALL_DIR) $(1)/usr/lib
  205. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libss.so* $(1)/usr/lib/
  206. endef
  207. define Package/libext2fs/install
  208. $(INSTALL_DIR) $(1)/usr/lib
  209. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* $(1)/usr/lib/
  210. endef
  211. define Package/libext2fs/install_lib
  212. $(INSTALL_DIR) $(1)/usr/lib
  213. $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
  214. endef
  215. define Package/tune2fs/install
  216. $(INSTALL_DIR) $(1)/usr/sbin
  217. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
  218. $(LN) tune2fs $(1)/usr/sbin/findfs
  219. endef
  220. define Package/resize2fs/install
  221. $(INSTALL_DIR) $(1)/usr/sbin
  222. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
  223. endef
  224. define Package/badblocks/install
  225. $(INSTALL_DIR) $(1)/usr/sbin
  226. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
  227. endef
  228. define Package/dumpe2fs/install
  229. $(INSTALL_DIR) $(1)/usr/sbin
  230. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dumpe2fs $(1)/usr/sbin/
  231. endef
  232. define Package/e2freefrag/install
  233. $(INSTALL_DIR) $(1)/usr/sbin
  234. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/
  235. endef
  236. define Package/filefrag/install
  237. $(INSTALL_DIR) $(1)/usr/sbin
  238. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/
  239. endef
  240. define Package/debugfs/install
  241. $(INSTALL_DIR) $(1)/usr/sbin
  242. $(INSTALL_DIR) $(1)/usr/lib
  243. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/debugfs $(1)/usr/sbin/
  244. endef
  245. define Package/chattr/install
  246. $(INSTALL_DIR) $(1)/usr/bin
  247. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chattr $(1)/usr/bin/
  248. endef
  249. define Package/lsattr/install
  250. $(INSTALL_DIR) $(1)/usr/bin
  251. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsattr $(1)/usr/bin/
  252. endef
  253. $(eval $(call BuildPackage,e2fsprogs))
  254. $(eval $(call BuildPackage,libcomerr))
  255. $(eval $(call BuildPackage,libss))
  256. $(eval $(call BuildPackage,libext2fs))
  257. $(eval $(call BuildPackage,tune2fs))
  258. $(eval $(call BuildPackage,resize2fs))
  259. $(eval $(call BuildPackage,badblocks))
  260. $(eval $(call BuildPackage,dumpe2fs))
  261. $(eval $(call BuildPackage,e2freefrag))
  262. $(eval $(call BuildPackage,filefrag))
  263. $(eval $(call BuildPackage,debugfs))
  264. $(eval $(call BuildPackage,chattr))
  265. $(eval $(call BuildPackage,lsattr))
  266. $(eval $(call HostBuild))