]> git.pld-linux.org Git - packages/xfsprogs.git/blob - xfsprogs.spec
- fix building with dietlibc
[packages/xfsprogs.git] / xfsprogs.spec
1 #
2 # Conditional build:
3 %bcond_without  initrd          # don't build initrd version
4 %bcond_without  dietlibc        # link initrd version with static glibc instead of dietlibc
5 #
6 Summary:        Tools for the XFS filesystem
7 Summary(pl.UTF-8):      Narzędzia do systemu plików XFS
8 Name:           xfsprogs
9 Version:        3.0.1
10 Release:        2
11 License:        LGPL v2.1 (libhandle), GPL v2 (the rest)
12 Group:          Applications/System
13 Source0:        ftp://linux-xfs.sgi.com/projects/xfs/cmd_tars/%{name}-%{version}.tar.gz
14 # Source0-md5:  d7f879a21692d4f7abc16a20479b0829
15 Patch0:         %{name}-miscfix-v2.patch
16 Patch1:         %{name}-install-sh.patch
17 Patch2:         %{name}-sharedlibs.patch
18 Patch3:         %{name}-pl.po-update.patch
19 Patch4:         %{name}-dynamic_exe.patch
20 Patch5:         %{name}-LDFLAGS.patch
21 Patch6:         %{name}-diet.patch
22 Patch7:         %{name}-static-librt.patch
23 URL:            http://oss.sgi.com/projects/xfs/
24 BuildRequires:  autoconf
25 BuildRequires:  automake
26 BuildRequires:  bash
27 %if %{with initrd}
28         %if %{with dietlibc}
29 BuildRequires:  dietlibc-static >= 2:0.31-6
30 BuildRequires:  libuuid-dietlibc
31         %else
32 BuildRequires:  glibc-static
33 BuildRequires:  libuuid-static
34         %endif
35 %endif
36 BuildRequires:  gettext-devel
37 BuildRequires:  libtool
38 BuildRequires:  libuuid-devel
39 BuildRequires:  readline-devel
40 BuildRequires:  rpmbuild(macros) >= 1.402
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %define         _sbindir        /sbin
44 %define         _bindir         /usr/sbin
45 %define         _libdir         /%{_lib}
46 %define         _libexecdir     /usr/%{_lib}
47 # for some reason known only to rpm there must be "\\|" not "\|" here
48 %define         dietarch        %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
49 %define         dietlibdir      %{_prefix}/lib/dietlibc/lib-%{dietarch}
50
51 %description
52 A set of commands to use the XFS filesystem, including mkfs.xfs.
53
54 XFS is a high performance journaling filesystem which originated on
55 the SGI IRIX platform. It is completely multi-threaded, can support
56 large files and large filesystems, extended attributes, variable block
57 sizes, is extent based, and makes extensive use of Btrees
58 (directories, extents, free space) to aid both performance and
59 scalability.
60
61 This implementation is on-disk compatible with the IRIX version of
62 XFS.
63
64 %description -l pl.UTF-8
65 Zbiór komend do użytku z systemem plików XFS, włączając w to mkfs.xfs.
66
67 XFS jest wysoko wydajnym systemem plików z kroniką, który oryginalnie
68 był używany na platformie SGI IRIX. Jest to w pełni wielowątkowy,
69 obsługujący wielkie pliki oraz wielkie systemy, o rozszerzonych
70 atrybutach, zmiennych wielkościach bloków, mocno wykorzystujący
71 B-drzewa by uzyskać wysoką wydajność oraz skalowalność.
72
73 %package devel
74 Summary:        Header files and libraries to develop XFS software
75 Summary(pl.UTF-8):      Pliki nagłówkowe i biblioteki
76 Group:          Development/Libraries
77 Requires:       %{name} = %{version}-%{release}
78 Requires:       libuuid-devel
79
80 %description devel
81 Header files and libraries to develop software which operates on XFS
82 filesystems.
83
84 %description devel -l pl.UTF-8
85 Pliki nagłówkowe i biblioteki potrzebne do rozwoju oprogramowania
86 operującego na systemie plików XFS.
87
88 %package static
89 Summary:        Static XFS software libraries
90 Summary(pl.UTF-8):      Biblioteki statyczne do XFS
91 Group:          Development/Libraries
92 Requires:       %{name}-devel = %{version}-%{release}
93
94 %description static
95 Static XFS software libraries.
96
97 %description static -l pl.UTF-8
98 Biblioteki statyczne do XFS.
99
100 %package initrd
101 Summary:        Tools for the XFS filesystem - initrd version
102 Summary(pl.UTF-8):      Narzędzia do systemu plików XFS - wersja dla initrd
103 Group:          Base
104
105 %description initrd
106 A set of commands to use the XFS filesystem, including mkfs.xfs
107  - initrd version.
108
109 %description initrd -l pl.UTF-8
110 Zbiór komend do użytku z systemem plików XFS, włączając w to mkfs.xfs
111  - wersja dla initrd.
112
113 %prep
114 %setup -q
115 %patch0 -p1
116 %patch1 -p1
117 %patch2 -p1
118 # currently obsolete until needed again
119 # %patch3 -p1
120 %patch4 -p1
121 %patch5 -p1
122 %patch6 -p1
123 %patch7 -p1
124
125 rm -f include/{builddefs,platform_defs}.h
126
127 %build
128 %{__aclocal} -I m4
129
130 %if %{with initrd}
131 %if %{with dietlibc}
132 # dietlibc doesn't have aio.h (and xfsprogs does not need it really)
133 # dietlibc has needed librt stuff in libc/libpthread
134 sed -i -e 's|^AC_PACKAGE_NEED_AIO_H|dnl AC_PACKAGE_NEED_AIO_H|' \
135         -e 's|^AC_PACKAGE_NEED_LIO_LISTIO|dnl AC_PACKAGE_NEED_LIO_LISTIO|' \
136         configure.in
137 sed -i -e 's|\(^LIBRT.*=.*\)|# \1|' include/builddefs.in
138 sed -i -e 's|\(^LLDLIBS.*=.*\)|\1 -lcompat|' db/Makefile mkfs/Makefile
139 %endif
140
141 %{__autoconf}
142 %configure \
143         %{?with_dietlibc:CC="diet %{__cc} -static"} \
144         --disable-gettext \
145         --disable-readline \
146         DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \
147         OPTIMIZER="%{rpmcflags} -Wno-deprecated-declarations -Os -D_BSD_SOURCE -D__USE_XOPEN_EXTENDED"
148
149 %{__make} -j1 include libxfs libxlog libxcmd libhandle libdisk \
150         LIBUUID="%{dietlibdir}/libuuid.a"
151 %{__make} -j1 db growfs logprint mkfs mdrestore repair \
152         LDFLAGS="%{rpmldflags} -all-static" \
153         LIBUUID="%{dietlibdir}/libuuid.a"
154
155 mkdir -p initrd
156 mv -f db/xfs_db initrd/xfs_db
157 mv -f growfs/xfs_growfs initrd/xfs_growfs
158 mv -f logprint/xfs_logprint initrd/xfs_logprint
159 mv -f mkfs/mkfs.xfs initrd/mkfs.xfs
160 mv -f mdrestore/xfs_mdrestore initrd/xfs_mdrestore
161 mv -f repair/xfs_repair initrd/xfs_repair
162
163 %if %{with dietlibc}
164 sed -i -e 's|^dnl AC_PACKAGE_NEED_AIO_H|AC_PACKAGE_NEED_AIO_H|' \
165         -e 's|^dnl AC_PACKAGE_NEED_LIO_LISTIO|AC_PACKAGE_NEED_LIO_LISTIO|' \
166         configure.in
167 sed -i -e 's|^# \(LIBRT.*=.*\)|\1|' include/builddefs.in
168 sed -i -e 's|\(^LLDLIBS.*=.*\) -lcompat|\1|' db/Makefile mkfs/Makefile
169 %endif
170
171 %{__make} clean
172 %endif
173
174 %{__autoconf}
175 %configure \
176         --enable-gettext \
177         --enable-readline \
178         DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \
179         OPTIMIZER="%{rpmcflags}"
180
181 %{__make} -j1
182
183 %install
184 rm -rf $RPM_BUILD_ROOT
185
186 DIST_ROOT=$RPM_BUILD_ROOT
187 DIST_INSTALL=$(pwd)/install.manifest
188 DIST_INSTALL_DEV=$(pwd)/install-dev.manifest
189 export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV
190
191 %{__make} install \
192         DIST_MANIFEST="$DIST_INSTALL"
193 %{__make} install-dev \
194         DIST_MANIFEST="$DIST_INSTALL_DEV"
195
196 ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libhandle.so.*.*.*) \
197          $RPM_BUILD_ROOT%{_libexecdir}/libhandle.so
198 ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libdisk.so.*.*.*) \
199         $RPM_BUILD_ROOT%{_libexecdir}/libdisk.so
200 ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxcmd.so.*.*.*) \
201         $RPM_BUILD_ROOT%{_libexecdir}/libxcmd.so
202 ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxfs.so.*.*.*) \
203         $RPM_BUILD_ROOT%{_libexecdir}/libxfs.so
204 ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxlog.so.*.*.*) \
205         $RPM_BUILD_ROOT%{_libexecdir}/libxlog.so
206
207 %{__sed} -i -e "s|libdir='%{_libdir}'|libdir='%{_libexecdir}'|" \
208         $RPM_BUILD_ROOT%{_libexecdir}/lib{disk,handle,xcmd,xfs,xlog}.la
209 %{__sed} -i -e "s| %{_libdir}/libxfs.la | %{_libexecdir}/libxfs.la |" \
210         $RPM_BUILD_ROOT%{_libexecdir}/libxlog.la
211
212 %if %{with initrd}
213 install -d $RPM_BUILD_ROOT%{_libexecdir}/initrd
214 install initrd/* $RPM_BUILD_ROOT%{_libexecdir}/initrd/
215 %endif
216
217 %find_lang %{name}
218
219 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
220
221 # already in /usr
222 rm -f $RPM_BUILD_ROOT%{_libdir}/libdisk.{a,la,so}
223 rm -f $RPM_BUILD_ROOT%{_libdir}/libhandle.{a,la,so}
224 rm -f $RPM_BUILD_ROOT%{_libdir}/libxcmd.{a,la,so}
225 rm -f $RPM_BUILD_ROOT%{_libdir}/libxfs.{a,la,so}
226 rm -f $RPM_BUILD_ROOT%{_libdir}/libxlog.{a,la,so}
227
228 %clean
229 rm -rf $RPM_BUILD_ROOT
230
231 %post   -p /sbin/ldconfig
232 %postun -p /sbin/ldconfig
233
234 %files -f %{name}.lang
235 %defattr(644,root,root,755)
236 %doc README doc/{CHANGES,CREDITS}
237 %attr(755,root,root) %{_sbindir}/fsck.xfs
238 %attr(755,root,root) %{_sbindir}/mkfs.xfs
239 %attr(755,root,root) %{_sbindir}/xfs_repair
240 %attr(755,root,root) %{_bindir}/xfs_*
241 %attr(755,root,root) %{_libdir}/libdisk.so.*.*
242 %attr(755,root,root) %{_libdir}/libhandle.so.*.*
243 %attr(755,root,root) %{_libdir}/libxcmd.so.*.*
244 %attr(755,root,root) %{_libdir}/libxfs.so.*.*
245 %attr(755,root,root) %{_libdir}/libxlog.so.*.*
246 %attr(755,root,root) %ghost %{_libdir}/libdisk.so.0
247 %attr(755,root,root) %ghost %{_libdir}/libhandle.so.1
248 %attr(755,root,root) %ghost %{_libdir}/libxcmd.so.0
249 %attr(755,root,root) %ghost %{_libdir}/libxfs.so.0
250 %attr(755,root,root) %ghost %{_libdir}/libxlog.so.0
251 %{_mandir}/man5/projects.5*
252 %{_mandir}/man5/projid.5*
253 %{_mandir}/man5/xfs.5*
254 %{_mandir}/man8/fsck.xfs.8*
255 %{_mandir}/man8/mkfs.xfs.8*
256 %{_mandir}/man8/xfs_*.8*
257
258 %files devel
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_libexecdir}/libdisk.so
261 %attr(755,root,root) %{_libexecdir}/libhandle.so
262 %attr(755,root,root) %{_libexecdir}/libxcmd.so
263 %attr(755,root,root) %{_libexecdir}/libxfs.so
264 %attr(755,root,root) %{_libexecdir}/libxlog.so
265 %{_libexecdir}/libdisk.la
266 %{_libexecdir}/libhandle.la
267 %{_libexecdir}/libxcmd.la
268 %{_libexecdir}/libxfs.la
269 %{_libexecdir}/libxlog.la
270 %{_includedir}/xfs
271 %{_mandir}/man3/*handle.3*
272 %{_mandir}/man3/xfsctl.3*
273
274 %files static
275 %defattr(644,root,root,755)
276 %{_libexecdir}/libdisk.a
277 %{_libexecdir}/libhandle.a
278 %{_libexecdir}/libxcmd.a
279 %{_libexecdir}/libxfs.a
280 %{_libexecdir}/libxlog.a
281
282 %if %{with initrd}
283 %files initrd
284 %defattr(644,root,root,755)
285 %attr(755,root,root) %{_libexecdir}/initrd/mkfs.xfs
286 %attr(755,root,root) %{_libexecdir}/initrd/xfs_db
287 %attr(755,root,root) %{_libexecdir}/initrd/xfs_growfs
288 %attr(755,root,root) %{_libexecdir}/initrd/xfs_logprint
289 %attr(755,root,root) %{_libexecdir}/initrd/xfs_mdrestore
290 %attr(755,root,root) %{_libexecdir}/initrd/xfs_repair
291 %endif
This page took 0.965948 seconds and 4 git commands to generate.