apt.spec 6.1 KB

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