apt.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. Source3: sources.list
  44. Patch0: apt.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20030913, ncurses, readline, make, gcc, autoconf
  49. PreReq: OpenPKG, openpkg >= 20030913, ncurses, readline
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. This is Connectiva's port of the Debian's Advanced Packaging Tool
  54. (APT), running on top of the OpenPKG RPM packaging infrastructure.
  55. APT is an advanced package management utility front-end which allows
  56. you to easily perform package installation, upgrading and removal.
  57. Dependencies are automatically handled.
  58. %prep
  59. %setup -q -n apt-%{V_base}cnc%{V_rev}
  60. %patch -p0 -P 0
  61. # replace hard-coded paths with OpenPKG ones
  62. l_rpmlibs_base="`%{l_prefix}/bin/rpm-config --libs`"
  63. l_rpmlibs_extra=""
  64. case "%{l_platform -t}" in
  65. *sunos* ) l_rpmlibs_extra="${l_rpmlibs_extra} -lsocket" ;;
  66. esac
  67. find . -type f ! -name "*.orig" -print | \
  68. xargs %{l_shtool} subst \
  69. %{l_value -s l_prefix} \
  70. -e "s;@l_rpmlibs_base@;${l_rpmlibs_base};g" \
  71. -e "s;@l_rpmlibs_extra@;${l_rpmlibs_extra};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 \
  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/apt \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/apt.conf.d
  116. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  117. %{SOURCE apt.conf} %{SOURCE rpmpriorities} %{SOURCE sources.list} \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/
  119. # strip down installation
  120. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  121. strip $RPM_BUILD_ROOT%{l_prefix}/lib/apt/methods/* >/dev/null 2>&1 || true
  122. # determine installation files
  123. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  124. %{l_files_std} \
  125. '%config %{l_prefix}/etc/apt/*'
  126. %files -f files
  127. %clean
  128. rm -rf $RPM_BUILD_ROOT