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