Makefile 8.7 KB

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