apt.spec 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. ##
  2. ## apt.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_base 0.5.15
  27. %define V_rev 5
  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
  35. Class: EVAL
  36. Group: Bootstrapping
  37. License: GPL
  38. Version: %{V_base}.%{V_rev}
  39. Release: 20040217
  40. # list of sources
  41. Source0: http://moin.conectiva.com.br/files/AptRpm/attachments/apt-%{V_base}cnc%{V_rev}.tar.bz2
  42. Source1: apt.conf
  43. Source2: sources.list
  44. Source3: vendors.list
  45. Source4: translate.list
  46. Source5: rpmpriorities
  47. Source6: preferences
  48. Source7: apt-man.tar
  49. Patch0: apt.patch
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040217, ncurses, readline, make, gcc, autoconf
  54. PreReq: OpenPKG, openpkg >= 20040217, ncurses, readline
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. This is Connectiva's port of the Debian's Advanced Packaging Tool
  59. (APT), running on top of the OpenPKG RPM packaging infrastructure.
  60. APT is an advanced package management utility front-end which allows
  61. you to easily perform package installation, upgrading and removal.
  62. Dependencies are automatically handled.
  63. %track
  64. prog apt = {
  65. disabled
  66. comment = "rse: vcheck does not support HTTPS and HTTP access is not possible"
  67. version = %{V_base}cnc%{V_rev}
  68. url = http://moin.conectiva.com.br/AptRpm
  69. regex = apt-(__VER__)\.tar\.bz2
  70. }
  71. %prep
  72. %setup -q -n apt-%{V_base}cnc%{V_rev}
  73. %patch -p0
  74. # replace hard-coded paths with OpenPKG ones
  75. l_rpmlibs_base="`%{l_rpm_config} --libs`"
  76. l_rpmlibs_extra=""
  77. case "%{l_platform -t}" in
  78. *sunos* ) l_rpmlibs_extra="${l_rpmlibs_extra} -lsocket" ;;
  79. esac
  80. find . -type f ! -name "*.orig" -print | \
  81. xargs %{l_shtool} subst -s \
  82. %{l_value -s l_prefix} \
  83. -e "s;@l_rpmlibs_base@;${l_rpmlibs_base};g" \
  84. -e "s;@l_rpmlibs_extra@;${l_rpmlibs_extra};g"
  85. # regenerate GNU autoconf based files
  86. %{l_prefix}/bin/autoconf
  87. %build
  88. # configure package
  89. defines="-DOLD_FLATSCHEME"
  90. case "%{l_platform -t}" in
  91. *sunos* ) defines="$defines -DOPENPKG_SOLARIS" ;;
  92. esac
  93. CC="%{l_cc}" \
  94. CPPFLAGS="%{l_cppflags} `%{l_rpm_config} --cppflags` $defines" \
  95. CFLAGS="%{l_cflags} `%{l_rpm_config} --cflags`" \
  96. LDFLAGS="%{l_ldflags} `%{l_rpm_config} --ldflags`" \
  97. ./configure \
  98. --prefix=%{l_prefix} \
  99. --libdir=%{l_prefix}/lib \
  100. --localstatedir=%{l_prefix}/var/apt \
  101. --disable-shared \
  102. --enable-static \
  103. --disable-nls \
  104. --disable-docs
  105. # disable localization stuff
  106. %{l_shtool} subst \
  107. -e 's;^POFILES =.*$;POFILES =;g' \
  108. -e 's;^GMOFILES =.*$;GMOFILES =;g' \
  109. -e 's;^DUMMYPOFILES =.*$;DUMMYPOFILES =;g' \
  110. -e 's;^CATALOGS =.*$;CATALOGS =;g' \
  111. po/Makefile
  112. # build package
  113. %{l_make} %{l_mflags}
  114. %install
  115. rm -rf $RPM_BUILD_ROOT
  116. # install package
  117. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  118. # create still missing directories
  119. %{l_shtool} mkdir -p -m 755 \
  120. $RPM_BUILD_ROOT%{l_prefix}/lib/apt/scripts \
  121. $RPM_BUILD_ROOT%{l_prefix}/var/apt/lib/lists/partial \
  122. $RPM_BUILD_ROOT%{l_prefix}/var/apt/cache/archives/partial
  123. # install pre-generated manual pages
  124. %{l_tar} xf %{SOURCE apt-man.tar}
  125. %{l_shtool} mkdir -p -m 755 \
  126. $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
  127. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  128. %{l_shtool} install -c -m 644 \
  129. apt-man/*.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  130. %{l_shtool} install -c -m 644 \
  131. apt-man/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  132. # install default configuration files
  133. %{l_shtool} mkdir -p -m 755 \
  134. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/apt.conf.d \
  135. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/vendor.list.d \
  136. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/sources.list.d \
  137. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/translate.list.d
  138. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  139. %{SOURCE apt.conf} %{SOURCE rpmpriorities} %{SOURCE preferences} \
  140. %{SOURCE sources.list} %{SOURCE vendors.list} %{SOURCE translate.list} \
  141. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/
  142. %{l_shtool} install -c -m 644 \
  143. doc/examples/configure-index \
  144. $RPM_BUILD_ROOT%{l_prefix}/etc/apt/apt.conf.idx
  145. # strip down installation
  146. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
  147. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  148. strip $RPM_BUILD_ROOT%{l_prefix}/lib/apt/methods/* >/dev/null 2>&1 || true
  149. # determine installation files
  150. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  151. %{l_files_std} \
  152. '%config %{l_prefix}/etc/apt/apt.conf' \
  153. '%config %{l_prefix}/etc/apt/rpmpriorities' \
  154. '%config %{l_prefix}/etc/apt/preferences' \
  155. '%config %{l_prefix}/etc/apt/*.list'
  156. %files -f files
  157. %clean
  158. rm -rf $RPM_BUILD_ROOT