Upload Tizen:Base source
[framework/base/util-linux-ng.git] / packaging / util-linux-ng.spec
1 Summary: A collection of basic system utilities
2 Name: util-linux-ng
3 Version: 2.16.2
4 Release: 1
5 License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain
6 Group: System/Base
7 URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
8 Source0: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/util-linux-ng-%{version}.tar.gz
9
10 #BuildRequires: e2fsprogs-devel >= 1.36
11 BuildRequires: ncurses-devel
12 BuildRequires: zlib-devel
13 BuildRequires: popt-devel
14 Provides: util-linux = %{version}
15
16
17 %description
18 The util-linux-ng package contains a large variety of low-level system
19 utilities that are necessary for a Linux system to function. Among
20 others, Util-linux contains the fdisk configuration tool and the login
21 program.
22
23 %package -n libblkid
24 Summary: Block device ID library
25 Group: System/Libraries
26 License: LGPLv2+
27  
28 %description -n libblkid
29 This is block device identification library, part of util-linux-ng. 
30  
31 %package -n libblkid-devel
32 Summary: Block device ID library
33 Group: Development/Libraries
34 License: LGPLv2+
35 Requires: libblkid = %{version}-%{release}
36  
37 %description -n libblkid-devel
38 This is the block device identification development library and headers,
39 part of util-linux-ng.
40
41 %package -n libuuid
42 Summary: Universally unique ID library
43 Group: System/Libraries
44 License: BSD
45
46 %description -n libuuid
47 This is the universally unique ID library, part of e2fsprogs.
48
49 The libuuid library generates and parses 128-bit universally unique
50 id's (UUID's).  A UUID is an identifier that is unique across both
51 space and time, with respect to the space of all UUIDs.  A UUID can
52 be used for multiple purposes, from tagging objects with an extremely
53 short lifetime, to reliably identifying very persistent objects
54 across a network.
55
56 See also the "uuid" package, which is a separate implementation.
57
58 %package -n libuuid-devel
59 Summary: Universally unique ID library
60 Group: Development/Libraries
61 License: BSD
62 Requires: libuuid = %{version}-%{release}
63
64 %description -n libuuid-devel
65 This is the universally unique ID development library and headers,
66 part of e2fsprogs.
67
68 The libuuid library generates and parses 128-bit universally unique
69 id's (UUID's).  A UUID is an identifier that is unique across both
70 space and time, with respect to the space of all UUIDs.  A UUID can
71 be used for multiple purposes, from tagging objects with an extremely
72 short lifetime, to reliably identifying very persistent objects
73 across a network.
74
75 See also the "uuid-devel" package, which is a separate implementation.
76
77
78 %package -n uuidd
79 Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
80 Group: System/Daemons
81 Requires: libuuid = %{version}-%{release}
82 License: GPLv2
83
84 %description -n uuidd
85 The uuidd package contains a userspace daemon (uuidd) which guarantees
86 uniqueness of time-based UUID generation even at very high rates on
87 SMP systems.
88
89 %prep
90 %setup -q 
91
92 %build
93 unset LINGUAS || :
94
95 export CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $RPM_OPT_FLAGS"
96 export SUID_CFLAGS="-fpie"
97 export SUID_LDFLAGS="-pie"
98 %configure \
99         --bindir=/bin \
100         --sbindir=/sbin \
101         --disable-wall \
102         --enable-write \
103         --with-fsprobe=builtin \
104         --disable-makeinstall-chown \
105         --enable-raw \
106         --without-ncurses \
107         --without-slang \
108         --without-selinux \
109         --disable-nls 
110
111
112 make %{?_smp_mflags}
113
114 %install
115 rm -rf ${RPM_BUILD_ROOT}
116 %make_install
117
118
119 # And a dirs uuidd needs that the makefiles don't create
120 install -d ${RPM_BUILD_ROOT}/var/run/uuidd
121 install -d ${RPM_BUILD_ROOT}/var/lib/libuuid
122
123
124 # remove libtool junk
125 rm -f ${RPM_BUILD_ROOT}/usr/lib/libblkid.la
126
127 # deprecated commands
128 for I in /sbin/fsck.minix /sbin/fsck /sbin/mkfs.{bfs,minix} /sbin/sln \
129         /usr/bin/chkdupexe %{_bindir}/line %{_bindir}/pg %{_bindir}/newgrp \
130         /sbin/shutdown %{_bindir}/scriptreplay /usr/sbin/vipw /usr/sbin/vigr; do
131         rm -f $RPM_BUILD_ROOT$I
132 done
133
134 # deprecated man pages
135 for I in man1/chkdupexe.1 man1/line.1 man1/pg.1 man1/newgrp.1 \
136         man8/fsck.minix.8 man8/fsck.8 man8/mkfs.minix.8 man8/mkfs.bfs.8 man1/scriptreplay.1 \
137         man8/vipw.8 man8/vigr; do
138         rm -rf $RPM_BUILD_ROOT%{_mandir}/${I}*
139 done
140
141
142 ln -sf ../../bin/kill $RPM_BUILD_ROOT%{_bindir}/kill
143
144
145
146 # create list of setarch(8) symlinks
147 find  $RPM_BUILD_ROOT%{_bindir}/ -regextype posix-egrep -type l \
148         -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64)$" \
149         -printf "%{_bindir}/%f\n" >> %{name}.files
150
151 find  $RPM_BUILD_ROOT%{_mandir}/man8 -regextype posix-egrep  \
152         -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64)\.8.*" \
153         -printf "%{_mandir}/man8/%f*\n" >> %{name}.files
154
155 rm -f $RPM_BUILD_ROOT/usr/share/info/dir
156
157
158 %post
159 # only for minimal buildroots without /var/log
160 [ -d /var/log ] || /bin/mkdir -p /var/log
161 /bin/touch /var/log/lastlog
162 /bin/chown root:root /var/log/lastlog
163 /bin/chmod 0644 /var/log/lastlog
164
165
166
167 %post -n libblkid
168 /sbin/ldconfig
169 [ -e /etc/blkid.tab ] && mv /etc/blkid.tab /etc/blkid/blkid.tab || :
170 [ -e /etc/blkid.tab.old ] && mv /etc/blkid.tab.old /etc/blkid/blkid.tab.old || :
171  
172 %postun -n libblkid -p /sbin/ldconfig
173
174 %post -n libuuid -p /sbin/ldconfig
175 %postun -n libuuid -p /sbin/ldconfig
176
177 %pre -n uuidd
178 #getent group uuidd >/dev/null || groupadd -r uuidd
179 #getent passwd uuidd >/dev/null || \
180 #useradd -r -g uuidd -d /var/lib/libuuid -s /sbin/nologin \
181 #    -c "UUID generator helper daemon" uuidd
182 #exit 0
183
184 %post -n uuidd
185 [ -e /sbin/chkconfig ] && /sbin/chkconfig --add uuidd 
186
187 %preun -n uuidd
188 if [ "$1" = 0 ]; then
189         [ -e /sbin/service ] &&  /sbin/service uuidd stop > /dev/null 2>&1 || :
190         [ -e /sbin/chkconfig ] &&  /sbin/chkconfig --del uuidd
191 fi
192
193
194 %docs_package
195
196 %files  -f util-linux-ng.files
197 %defattr(-,root,root)
198 %ghost %attr(0644,root,root)    %verify(not md5 size mtime)     /var/log/lastlog
199 /bin/dmesg
200 %attr(4755,root,root)   /bin/mount
201 %attr(4755,root,root)   /bin/umount
202 /sbin/agetty
203 /sbin/blkid
204 /sbin/blockdev
205 /sbin/ctrlaltdel
206 /sbin/fdisk
207 /sbin/findfs
208 /sbin/fsck.cramfs
209 /sbin/hwclock
210 /sbin/losetup
211 /sbin/mkfs
212 /sbin/mkfs.cramfs
213 /sbin/mkswap
214 /sbin/pivot_root
215 /sbin/raw
216 /sbin/sfdisk
217 /sbin/swapoff
218 /sbin/swapon
219 /sbin/switch_root
220 /usr/bin/cal
221 /usr/bin/chrt
222 /usr/bin/col
223 /usr/bin/colcrt
224 /usr/bin/colrm
225 /usr/bin/column
226 /usr/bin/cytune
227 /usr/bin/ddate
228 /usr/bin/flock
229 /usr/bin/getopt
230 /usr/bin/hexdump
231 /usr/bin/ionice
232 /usr/bin/ipcmk
233 /usr/bin/ipcrm
234 /usr/bin/ipcs
235 /usr/bin/isosize
236 /usr/bin/kill
237 /usr/bin/logger
238 /usr/bin/look
239 /usr/bin/lscpu
240 /usr/bin/mcookie
241 /usr/bin/namei
242 /usr/bin/rename
243 /usr/bin/renice
244 /usr/bin/rev
245 /usr/bin/script
246 /usr/bin/setarch
247 /usr/bin/setsid
248 /usr/bin/tailf
249 /usr/bin/taskset
250 /usr/bin/uuidgen
251 /usr/bin/whereis
252 %attr(2755,root,tty)  /usr/bin/write
253 /usr/sbin/fdformat
254 /usr/sbin/ldattach
255 /usr/sbin/readprofile
256 /usr/sbin/rtcwake
257 /usr/sbin/tunelp
258 /usr/share/getopt/getopt-parse.bash
259 %exclude /usr/share/getopt/getopt-parse.tcsh
260 /usr/share/getopt/getopt-test.bash
261 %exclude /usr/share/getopt/getopt-test.tcsh
262
263 %files -n uuidd
264 %defattr(-,root,root)
265 #/etc/rc.d/init.d/uuidd
266 %attr(-, uuidd, uuidd) %{_sbindir}/uuidd
267 %dir %attr(2775, uuidd, uuidd) /var/lib/libuuid
268 %dir %attr(2775, uuidd, uuidd) /var/run/uuidd
269
270 %files -n libblkid
271 %defattr(-,root,root)
272 /%{_libdir}/libblkid.so.*
273
274 %files -n libblkid-devel
275 %defattr(-,root,root)
276 %{_libdir}/libblkid.so
277 %{_includedir}/blkid
278 %{_libdir}/pkgconfig/blkid.pc
279
280 %files -n libuuid
281 %defattr(-,root,root)
282 /usr/lib/libuuid.so.*
283
284 %files -n libuuid-devel
285 %defattr(-,root,root)
286 %{_libdir}/libuuid.so
287 %{_includedir}/uuid
288 %{_libdir}/pkgconfig/uuid.pc
289
290