apt.spec 4.8 KB

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