Magellan Linux

Contents of /trunk/core/xfsprogs/xfsprogs-5.2.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32999 - (show annotations) (download)
Tue Oct 8 14:46:06 2019 UTC (4 years, 6 months ago) by niro
File size: 2407 byte(s)
-fixed again LDFLAGS hell and --as-needed
1 # $Id$
2
3 PNAME="xfsprogs"
4 PVER="5.2.1"
5 PBUILD="r1"
6
7 PCAT="sys-fs"
8
9 DESCRIPTION="Administration and debugging tools for the XFS file system."
10 HOMEPAGE="http://xfs.org"
11
12 DEPEND=">= virtual/glibc
13 >= sys-libs/libblkid-2.31
14 >= sys-libs/libuuid-2.31
15 >= sys-libs/readline-8.0"
16
17 SDEPEND=">= sys-dev/gettext-0.18
18 >= virtual/sed"
19
20 SRCFILE="${PNAME}-${PVER}.tar.xz"
21 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
22
23 sminclude mtools
24
25 SRC_URI=(
26 https://www.kernel.org/pub/linux/utils/fs/xfs/${PNAME}/${SRCFILE}
27 mirror://${PNAME}/${SRCFILE}
28 )
29
30 UP2DATE="updatecmd https://www.kernel.org/pub/linux/utils/fs/xfs/${PNAME} | highesttarball xz"
31
32 src_prepare()
33 {
34 munpack ${SRCFILE} || die
35 cd ${SRCDIR}
36
37 # fix CFLAGS and some install pathes
38 sed -i "/^PKG_DOC_DIR/s:=.*:= /usr/share/doc/${PNAME}-${PVER}:" \
39 include/builddefs.in || die
40
41 # honor usr-move
42 sed -i -e "s:root_sbindir='/sbin':root_sbindir='/usr/sbin':" \
43 -e 's:root_libdir="/${base_libdir}":root_libdir="/usr/${base_libdir}":' \
44 configure.ac configure || die
45 }
46
47 src_compile()
48 {
49 cd ${SRCDIR}
50
51 # enable CFLAGS
52 export OPTIMIZER="${CFLAGS}"
53
54 # disable debug code
55 export DEBUG=-DNDEBUG
56
57 # disable-lto: disable link time optimization
58 #
59 # do not use mconfigure:
60 # it enables disable-static, and this messes with the makefile
61 # which causes the --as-needed flags added 3 times to the LDFLAGS and this will break the build
62 # to prevent this nasty bug of the makefile, call configure without --disable-static
63 # see: https://www.spinics.net/lists/linux-xfs/msg30191.html
64 ./configure \
65 --host=${CHOST} \
66 --build=${CHOST} \
67 --prefix=/usr \
68 --mandir=/usr/share/man \
69 --infodir=/usr/share/info \
70 --datadir=/usr/share \
71 --sysconfdir=/etc \
72 --localstatedir=/var/lib \
73 --libdir=/usr/$(mlibdir) \
74 \
75 --libexecdir=/usr/$(mlibdir) \
76 --enable-gettext \
77 --enable-readline \
78 --enable-blkid \
79 --disable-editline \
80 --disable-lto \
81 || die
82
83 mmake -j1 V=1 || die
84 }
85
86 src_install()
87 {
88 cd ${SRCDIR}
89
90 # needed directories
91 minstalldir /usr/$(mlibdir) || die
92
93 make DIST_ROOT=${BINDIR} \
94 DK_INC_DIR=${BINDIR}/usr/include/disk \
95 install install-dev \
96 || die
97
98 # we want compressed docs
99 rm -rf ${BINDIR}/usr/share/doc || die
100
101 # prune unneeded docs
102 rm doc/{CHANGES.gz,INSTALL,Makefile} || die
103
104 # sometime /var/tmp exist, remove it, to keep the right permissions
105 [[ -d ${BINDIR}/var ]] && rm -rf ${BINDIR}/var
106
107 minstalldocs doc/* || die
108 }