| 1 | #!/bin/bash | 
|---|
| 2 |  | 
|---|
| 3 | # cross-lfs native e2fsprogs build | 
|---|
| 4 | # -------------------------------- | 
|---|
| 5 | # $LastChangedBy$ | 
|---|
| 6 | # $LastChangedDate$ | 
|---|
| 7 | # $LastChangedRevision$ | 
|---|
| 8 | # $HeadURL$ | 
|---|
| 9 | # | 
|---|
| 10 |  | 
|---|
| 11 | cd ${SRC} | 
|---|
| 12 | LOG=e2fsprogs-native.log | 
|---|
| 13 |  | 
|---|
| 14 | set_libdirname | 
|---|
| 15 | setup_multiarch | 
|---|
| 16 |  | 
|---|
| 17 | unpack_tarball e2fsprogs-${E2FSPROGS_VER} | 
|---|
| 18 |  | 
|---|
| 19 | # Apply patch for HTREE problem posted by GS 3/19/2003 | 
|---|
| 20 | cd ${PKGDIR} | 
|---|
| 21 | #apply_patch e2fsprogs-${E2FSPROGS_VER} | 
|---|
| 22 |  | 
|---|
| 23 | case ${KERNEL_VER} in | 
|---|
| 24 | 2.6* ) | 
|---|
| 25 | # patch util.c to remove SCSI_BLOCK_MAJOR references | 
|---|
| 26 | # SCSI_DISK_MAJOR is no longer defined in linux/major.h for 2.6 kernel | 
|---|
| 27 | # TODO: check future e2fsprogs versions to see if this is fixed | 
|---|
| 28 | case ${E2FSPROGS_VER} in | 
|---|
| 29 | 1.34* ) | 
|---|
| 30 | # check if SCSI_DISK_MAJOR defined in linux/major.h | 
|---|
| 31 | grep SCSI_DISK_MAJOR /usr/include/linux/major.h > /dev/null 2>&1 || | 
|---|
| 32 | apply_patch e2fsprogs-${E2FSPROGS_VER}-2.6.0hdr-fix | 
|---|
| 33 | ;; | 
|---|
| 34 | esac | 
|---|
| 35 | ;; | 
|---|
| 36 | esac | 
|---|
| 37 |  | 
|---|
| 38 | # Fix some permissions issues when building the e2fsprogs 1.35 tarball | 
|---|
| 39 | # as a normal user. Need to check if previous versions are affected | 
|---|
| 40 | case ${E2FSPROGS_VER} in | 
|---|
| 41 | 1.35 ) | 
|---|
| 42 | chmod 755 configure | 
|---|
| 43 | chmod 644 po/* | 
|---|
| 44 | ;; | 
|---|
| 45 | 1.37 ) | 
|---|
| 46 | # Fix braindead error in e2p tests where include paths aren't | 
|---|
| 47 | # being passed | 
|---|
| 48 | if [ ! -f lib/e2p/Makefile.in-ORIG ]; then | 
|---|
| 49 | mv lib/e2p/Makefile.in lib/e2p/Makefile.in-ORIG | 
|---|
| 50 | fi | 
|---|
| 51 |  | 
|---|
| 52 | sed 's@-DTEST_PROGRAM@$(ALL_CFLAGS) &@g' \ | 
|---|
| 53 | lib/e2p/Makefile.in-ORIG > lib/e2p/Makefile.in | 
|---|
| 54 | ;; | 
|---|
| 55 | esac | 
|---|
| 56 |  | 
|---|
| 57 | # Edit configure so libdir and root_libdir point at */lib64 . | 
|---|
| 58 | # Also handles additional_libdir (used if --with-libiconv-prefix is set, | 
|---|
| 59 | # if we did set it (which we dont) we'd want the 64bit one anyway) ... | 
|---|
| 60 | test -f configure-ORIG || | 
|---|
| 61 | cp -p configure configure-ORIG | 
|---|
| 62 |  | 
|---|
| 63 | sed "/libdir=.*\/lib/s@/lib@/${libdirname}@g" \ | 
|---|
| 64 | configure-ORIG > configure | 
|---|
| 65 |  | 
|---|
| 66 | cd ${SRC} | 
|---|
| 67 |  | 
|---|
| 68 | test -d ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build && | 
|---|
| 69 | rm -rf ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build | 
|---|
| 70 |  | 
|---|
| 71 | mkdir ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build && | 
|---|
| 72 | cd ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build | 
|---|
| 73 |  | 
|---|
| 74 | max_log_init E2fsprogs ${E2FSPROGS_VER} "native (shared)" ${CONFLOGS} ${LOG} | 
|---|
| 75 | CC="${CC-gcc} ${ARCH_CFLAGS}" \ | 
|---|
| 76 | CFLAGS="-O2 -pipe" \ | 
|---|
| 77 | ../${PKGDIR}/configure \ | 
|---|
| 78 | --prefix=/usr \ | 
|---|
| 79 | --with-root-prefix="" \ | 
|---|
| 80 | --enable-elf-shlibs \ | 
|---|
| 81 | --mandir=/usr/share/man \ | 
|---|
| 82 | --infodir=/usr/share/info \ | 
|---|
| 83 | >> ${LOGFILE} 2>&1 && | 
|---|
| 84 | echo " o Configure OK" && | 
|---|
| 85 |  | 
|---|
| 86 | min_log_init ${BUILDLOGS} && | 
|---|
| 87 | make LDFLAGS="-s" \ | 
|---|
| 88 | >> ${LOGFILE} 2>&1 && | 
|---|
| 89 | echo " o Build OK" && | 
|---|
| 90 |  | 
|---|
| 91 | min_log_init ${TESTLOGS} && | 
|---|
| 92 | make check \ | 
|---|
| 93 | >>  ${LOGFILE} 2>&1 && | 
|---|
| 94 | echo " o Test OK" && | 
|---|
| 95 |  | 
|---|
| 96 | min_log_init ${INSTLOGS} && | 
|---|
| 97 | make install \ | 
|---|
| 98 | >> ${LOGFILE} 2>&1 && | 
|---|
| 99 | make install-libs \ | 
|---|
| 100 | >> ${LOGFILE} 2>&1 && | 
|---|
| 101 | install-info /usr/share/info/libext2fs.info /usr/share/info/dir && | 
|---|
| 102 | echo " o ALL OK" || barf | 
|---|
| 103 |  | 
|---|
| 104 | /sbin/ldconfig | 
|---|
| 105 |  | 
|---|