tizen 2.3 release
[external/tizen-coreutils.git] / packaging / tizen-coreutils.spec
1 %define _unpackaged_files_terminate_build 0
2
3 Summary:        The GNU core utilities: a set of tools commonly used in shell scripts
4
5 Name:           tizen-coreutils
6 Version:        6.9
7 Release:        12
8 License:        GPLv2+
9 Group:          System Environment/Base
10 Url:            http://www.gnu.org/software/coreutils/
11 Source0:        ftp://ftp.gnu.org/gnu/%{name}/coreutils-%{version}.tar.bz2
12 Source1:        mktemp-1.5.tar.gz
13 Source1001:     %{name}.manifest
14 Patch1:         coreutils-futimens.patch
15 Patch2:         coreutils-6.9-smack.patch
16
17 Patch1001:      mktemp-1.5-build.patch
18 BuildRequires:  autoconf >= 2.58
19 BuildRequires:  automake >= 1.10
20 BuildRequires:  gettext findutils
21
22 Provides:       fileutils sh-utils stat textutils mktemp
23 Provides:       coreutils
24 Obsoletes:      coreutils
25
26 %description
27 These are the GNU core utilities.  This package is the combination of
28 the old GNU fileutils, sh-utils, and textutils packages.
29
30 %prep
31 %setup -q -b 1 -n coreutils-%{version}
32 %patch1 -p1 -b .futimens
33 %patch2 -p1 -b .smack
34
35 %build
36 cp %{SOURCE1001} .
37 pushd ../mktemp-1.5
38 patch -p1 < %{PATCH1001}
39 %configure
40 make
41 popd
42
43 %configure
44 make
45
46 %install
47
48 pushd ../mktemp-1.5
49 make bindir=%{buildroot}/bin mandir=%{buildroot}%{_mandir} install
50 popd
51
52 %make_install
53
54 # man pages are not installed with make install
55 make mandir=%{buildroot}%{_mandir} install-man
56
57 # let be compatible with old fileutils, sh-utils and textutils packages :
58 mkdir -p %{buildroot}{/bin,%{_bindir},%{_sbindir},/sbin}
59 for f in cat chgrp chmod chown cp date dd df echo link ln ls mkdir mknod mv pwd rm rmdir sleep sync touch true uname unlink
60 do
61     mv %{buildroot}{%{_bindir},/bin}/$f
62 done
63
64 # chroot was in /usr/sbin :
65 mv %{buildroot}{%{_bindir},%{_sbindir}}/chroot
66
67 # These come from util-linux and/or procps.
68 for i in hostname uptime kill ; do
69     rm %{buildroot}{%{_bindir}/$i,%{_mandir}/man1/$i.1}
70 done
71
72 # Use hard links instead of symbolic links for LC_TIME files (bug #246729).
73 find %{buildroot}%{_datadir}/locale -type l | \
74 (while read link
75  do
76    target=$(readlink "$link")
77    rm -f "$link"
78    ln "$(dirname "$link")/$target" "$link"
79  done)
80
81 mkdir -p $RPM_BUILD_ROOT%{_datadir}/license
82 for keyword in LICENSE COPYING COPYRIGHT;
83 do
84         for file in `find %{_builddir} -name $keyword`;
85         do
86                 cat $file >> $RPM_BUILD_ROOT%{_datadir}/license/%{name};
87                 echo "";
88         done;
89 done
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %docs_package
95
96 %files
97 %manifest %{name}.manifest
98 %doc COPYING
99 %{_datadir}/license/%{name}
100 /bin/cat
101 /bin/chgrp
102 /bin/chmod
103 /bin/chown
104 /bin/cp
105 /bin/date
106 /bin/dd
107 /bin/df
108 /bin/echo
109 /bin/ln
110 /bin/ls
111 /bin/mkdir
112 /bin/mknod
113 /bin/mktemp
114 /bin/mv
115 /bin/pwd
116 /bin/rm
117 /bin/rmdir
118 /bin/sleep
119 /bin/sync
120 /bin/touch
121 /bin/true
122 /bin/uname
123 %{_bindir}/basename
124 %{_bindir}/cksum
125 %{_bindir}/cut
126 %{_bindir}/dirname
127 %{_bindir}/du
128 %{_bindir}/env
129 %{_bindir}/expr
130 %{_bindir}/head
131 %{_bindir}/id
132 %{_bindir}/install
133 %{_bindir}/md5sum
134 %{_bindir}/nice
135 %{_bindir}/od
136 %{_bindir}/printenv
137 %{_bindir}/printf
138 %{_bindir}/readlink
139 %{_bindir}/seq
140 %{_bindir}/sort
141 %{_bindir}/stat
142 %{_bindir}/tac
143 %{_bindir}/tail
144 %{_bindir}/tee
145 %{_bindir}/test
146 %{_bindir}/tr
147 %{_bindir}/wc
148 %{_bindir}/who
149 %{_bindir}/whoami
150 %{_sbindir}/chroot