coreutils.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. ##
  2. ## coreutils.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_alpha 5.1.3
  27. %define V_release 5.2.1
  28. # package information
  29. Name: coreutils
  30. Summary: GNU Core Utilities
  31. URL: http://www.gnu.org/software/coreutils/
  32. Vendor: Free Software Foundation
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: BASE
  36. Group: Utility
  37. License: GPL
  38. Version: %{V_release}
  39. Release: 20040421
  40. # package options
  41. %option with_legacy no
  42. # list of sources
  43. Source0: ftp://ftp.gnu.org/gnu/coreutils/coreutils-%{version}.tar.bz2
  44. Patch0: coreutils.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130, make, perl
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. The GNU Core Utilities are the basic file, shell and text
  54. manipulation utilities of the GNU operating system. These are the
  55. core utilities which are expected to exist on every operating
  56. system. Previously these utilities were offered as three individual
  57. sets of GNU utilities, fileutils, shellutils, and textutils. Those
  58. three have been combined into a single set of utilities call the
  59. coreutils.
  60. The provided GNU utilities are: basename, chroot, date, dirname,
  61. echo, env, expr, factor, false, groups, hostid, hostname, id
  62. logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq,
  63. sleep, stty, tee, test, true, tty, uname, users, who, whoami, yes,
  64. chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln,
  65. ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch, vdir.
  66. %track
  67. prog coreutils:alpha = {
  68. version = %{V_alpha}
  69. url = ftp://alpha.gnu.org/gnu/coreutils/
  70. regex = coreutils-(__VER__)\.tar\.(gz|bz2)
  71. }
  72. prog coreutils:release = {
  73. version = %{V_release}
  74. url = ftp://ftp.gnu.org/gnu/coreutils/
  75. regex = coreutils-(__VER__)\.tar\.(gz|bz2)
  76. }
  77. %prep
  78. %setup -q
  79. %patch -p0
  80. %{l_shtool} subst \
  81. -e 's;^\(install-exec-local:\).*;\1;' \
  82. -e 's;^\(bin_PROGRAMS =\);\1 su;' \
  83. src/Makefile.in
  84. %build
  85. CC="%{l_cc}" \
  86. CFLAGS="%{l_cflags -O}" \
  87. CPPFLAGS="%{l_cppflags}" \
  88. LDFLAGS="%{l_ldflags}" \
  89. CONFIG_SHELL="%{l_bash}" \
  90. HELP2MAN="true" \
  91. ./configure \
  92. --prefix=%{l_prefix} \
  93. --program-prefix=g \
  94. --disable-nls
  95. %{l_make} %{l_mflags -O}
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  99. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  100. rm -f "$RPM_BUILD_ROOT%{l_prefix}/bin/g["
  101. # rename gpr utility to avoid conflict with graphviz
  102. # legacyname becomes nupr
  103. mv "$RPM_BUILD_ROOT%{l_prefix}/bin/gpr" \
  104. "$RPM_BUILD_ROOT%{l_prefix}/bin/gnupr" 2>/dev/null || true
  105. mv "$RPM_BUILD_ROOT%{l_prefix}/man/man1/gpr.1" \
  106. "$RPM_BUILD_ROOT%{l_prefix}/man/man1/gnupr.1" 2>/dev/null || true
  107. %if "%{with_legacy}" == "yes"
  108. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  109. for i in g*; do
  110. ln -s $i `echo "$i" | sed -e 's;^g;;'`
  111. done
  112. cd $RPM_BUILD_ROOT%{l_prefix}/man/man1
  113. for i in g*; do
  114. ln -s $i `echo "$i" | sed -e 's;^g;;'`
  115. done
  116. ) || exit $?
  117. %endif
  118. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  119. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
  120. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  121. '%attr(4711,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/gsu'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT