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