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