apt.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ##
  2. ## apt.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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_base 0.5.15
  27. %define V_rev 3
  28. # package information
  29. Name: apt
  30. Summary: Advanced Packaging Tool
  31. URL: https://moin.conectiva.com.br/AptRpm
  32. Vendor: Jason Gunthorpe et al.
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: Bootstrapping
  36. License: GPL
  37. Version: %{V_base}.%{V_rev}
  38. Release: 20031128
  39. # list of sources
  40. Source0: http://moin.conectiva.com.br/files/AptRpm/attachments/apt-%{V_base}cnc%{V_rev}.tar.bz2
  41. Source1: apt.conf
  42. Source2: rpmpriorities
  43. Patch0: apt.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030913, ncurses, readline, make, gcc, autoconf
  48. PreReq: OpenPKG, openpkg >= 20030913, ncurses, readline
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. This is Connectiva's port of the Debian's Advanced Packaging Tool
  53. (APT), running on top of the OpenPKG RPM packaging infrastructure.
  54. APT is an advanced package management utility front-end which allows
  55. you to easily perform package installation, upgrading and removal.
  56. Dependencies are automatically handled.
  57. %prep
  58. %setup -q -n apt-%{V_base}cnc%{V_rev}
  59. %patch -p0 -P 0
  60. # replace hard-coded paths with OpenPKG ones
  61. l_rpmlibs=""
  62. case "%{l_platform -t}" in
  63. *sunos* ) l_rpmlibs="${l_rpmlibs} -lsocket" ;;
  64. esac
  65. find . -type f ! -name "*.orig" -print | \
  66. xargs %{l_shtool} subst \
  67. %{l_value -s l_prefix} \
  68. -e 's;@l_bindir@;%{l_prefix}/bin;g' \
  69. -e 's;@name@;apt;g' \
  70. -e "s;@rpmlibs@;`%{l_prefix}/bin/rpm-config --libs`;g" \
  71. -e "s;@l_rpmlibs@;${l_rpmlibs};g"
  72. # regenerate GNU autoconf based files
  73. %{l_prefix}/bin/autoconf
  74. %build
  75. # configure package
  76. defines="-DOLD_FLATSCHEME"
  77. case "%{l_platform -t}" in
  78. *sunos* ) defines="$defines -DOPENPKG_SOLARIS" ;;
  79. esac
  80. CC="%{l_cc}" \
  81. CPPFLAGS="%{l_cppflags} `%{l_prefix}/bin/rpm-config --cppflags` $defines" \
  82. CFLAGS="%{l_cflags} `%{l_prefix}/bin/rpm-config --cflags`" \
  83. LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/rpm-config --ldflags`" \
  84. ./configure \
  85. --prefix=%{l_prefix} \
  86. --libdir=%{l_prefix}/lib/apt \
  87. --localstatedir=%{l_prefix}/var/apt \
  88. --disable-shared \
  89. --enable-static \
  90. --disable-nls \
  91. --disable-docs
  92. # disable localization stuff
  93. %{l_shtool} subst \
  94. -e 's;^POFILES =.*$;POFILES =;g' \
  95. -e 's;^GMOFILES =.*$;GMOFILES =;g' \
  96. -e 's;^DUMMYPOFILES =.*$;DUMMYPOFILES =;g' \
  97. -e 's;^CATALOGS =.*$;CATALOGS =;g' \
  98. po/Makefile
  99. # build package
  100. %{l_make} %{l_mflags}
  101. %install
  102. rm -rf $RPM_BUILD_ROOT
  103. # install package
  104. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  105. # remove file that conflicts with 'grep' package
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
  107. # create directory for local state
  108. for dir in lib/lists lib/lists/partial cache/archives/partial; do
  109. %{l_shtool} mkdir -f -p -m 755 \
  110. $RPM_BUILD_ROOT%{l_prefix}/var/apt/$dir
  111. done
  112. # install default (blank) configuration files
  113. %{l_shtool} mkdir -p -m 755 \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/apt
  115. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  116. %{SOURCE apt.conf} %{SOURCE rpmpriorities} \
  117. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/
  118. # strip down installation
  119. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  120. strip $RPM_BUILD_ROOT%{l_prefix}/lib/apt/methods/* >/dev/null 2>&1 || true
  121. # determine installation files
  122. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  123. %{l_files_std} \
  124. '%config %{l_prefix}/etc/apt/*'
  125. %files -f files
  126. %clean
  127. rm -rf $RPM_BUILD_ROOT