libarchive.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. Name: {{{ git_name }}}
  2. Version: {{{ git_version lead=3 follow=5 }}}
  3. Release: 1%{?dist}
  4. Summary: A library for handling streaming archive formats
  5. License: BSD
  6. URL: http://www.libarchive.org/
  7. Source: {{{ git_pack }}}
  8. VCS: {{{ git_vcs }}}
  9. BuildRequires: automake
  10. BuildRequires: bison
  11. BuildRequires: bzip2-devel
  12. BuildRequires: e2fsprogs-devel
  13. BuildRequires: gcc
  14. BuildRequires: libacl-devel
  15. BuildRequires: libattr-devel
  16. BuildRequires: libtool
  17. BuildRequires: libxml2-devel
  18. BuildRequires: libzstd-devel
  19. BuildRequires: lz4-devel
  20. BuildRequires: lzo-devel
  21. BuildRequires: openssl-devel
  22. BuildRequires: xz-devel
  23. BuildRequires: zlib-devel
  24. %description
  25. Libarchive is a programming library that can create and read several different
  26. streaming archive formats, including most popular tar variants, several cpio
  27. formats, and both BSD and GNU ar variants. It can also write shar archives and
  28. read ISO9660 CDROM images and ZIP archives.
  29. %package devel
  30. Summary: Development files for %{name}
  31. Requires: %{name}%{?_isa} = %{version}-%{release}
  32. %description devel
  33. The %{name}-devel package contains libraries and header files for
  34. developing applications that use %{name}.
  35. %package -n bsdtar
  36. Summary: Manipulate tape archives
  37. Requires: %{name}%{?_isa} = %{version}-%{release}
  38. %description -n bsdtar
  39. The bsdtar package contains standalone bsdtar utility split off regular
  40. libarchive packages.
  41. %package -n bsdcpio
  42. Summary: Copy files to and from archives
  43. Requires: %{name}%{?_isa} = %{version}-%{release}
  44. %description -n bsdcpio
  45. The bsdcpio package contains standalone bsdcpio utility split off regular
  46. libarchive packages.
  47. %package -n bsdcat
  48. Summary: Expand files to standard output
  49. Requires: %{name}%{?_isa} = %{version}-%{release}
  50. %description -n bsdcat
  51. The bsdcat program typically takes a filename as an argument or reads standard
  52. input when used in a pipe. In both cases decompressed data it written to
  53. standard output.
  54. %prep
  55. {{{ git_setup_macro }}}
  56. %autosetup -p1
  57. %build
  58. build/autogen.sh
  59. %configure --disable-static --without-nettle LT_SYS_LIBRARY_PATH=%_libdir
  60. %make_build
  61. %install
  62. make install DESTDIR=$RPM_BUILD_ROOT
  63. find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
  64. # rhbz#1294252
  65. replace ()
  66. {
  67. filename=$1
  68. file=`basename "$filename"`
  69. binary=${file%%.*}
  70. pattern=${binary##bsd}
  71. awk "
  72. # replace the topic
  73. /^.Dt ${pattern^^} 1/ {
  74. print \".Dt ${binary^^} 1\";
  75. next;
  76. }
  77. # replace the first occurrence of \"$pattern\" by \"$binary\"
  78. !stop && /^.Nm $pattern/ {
  79. print \".Nm $binary\" ;
  80. stop = 1 ;
  81. next;
  82. }
  83. # print remaining lines
  84. 1;
  85. " "$filename" > "$filename.new"
  86. mv "$filename".new "$filename"
  87. }
  88. for manpage in bsdtar.1 bsdcpio.1
  89. do
  90. installed_manpage=`find "$RPM_BUILD_ROOT" -name "$manpage"`
  91. replace "$installed_manpage"
  92. done
  93. %check
  94. %if %{with check}
  95. logfiles ()
  96. {
  97. find -name '*_test.log' -or -name test-suite.log
  98. }
  99. tempdirs ()
  100. {
  101. cat `logfiles` \
  102. | awk "match(\$0, /[^[:space:]]*`date -I`[^[:space:]]*/) { print substr(\$0, RSTART, RLENGTH); }" \
  103. | sort | uniq
  104. }
  105. cat_logs ()
  106. {
  107. for i in `logfiles`
  108. do
  109. echo "=== $i ==="
  110. cat "$i"
  111. done
  112. }
  113. run_testsuite ()
  114. {
  115. rc=0
  116. %make_build check -j1 || {
  117. # error happened - try to extract in koji as much info as possible
  118. cat_logs
  119. for i in `tempdirs`; do
  120. if test -d "$i" ; then
  121. find $i -printf "%p\n ~> a: %a\n ~> c: %c\n ~> t: %t\n ~> %s B\n"
  122. cat $i/*.log
  123. fi
  124. done
  125. return 1
  126. }
  127. cat_logs
  128. }
  129. # On a ppc/ppc64 is some race condition causing 'make check' fail on ppc
  130. # when both 32 and 64 builds are done in parallel on the same machine in
  131. # koji. Try to run once again if failed.
  132. %ifarch ppc
  133. run_testsuite || run_testsuite
  134. %else
  135. run_testsuite
  136. %endif
  137. %endif
  138. %files
  139. %{!?_licensedir:%global license %%doc}
  140. %license COPYING
  141. %doc NEWS README.md
  142. %{_libdir}/libarchive.so.13*
  143. %{_mandir}/*/cpio.*
  144. %{_mandir}/*/mtree.*
  145. %{_mandir}/*/tar.*
  146. %files devel
  147. %{_includedir}/*.h
  148. %{_mandir}/*/archive*
  149. %{_mandir}/*/libarchive*
  150. %{_libdir}/libarchive.so
  151. %{_libdir}/pkgconfig/libarchive.pc
  152. %files -n bsdtar
  153. %{!?_licensedir:%global license %%doc}
  154. %license COPYING
  155. %doc NEWS README.md
  156. %{_bindir}/bsdtar
  157. %{_mandir}/*/bsdtar*
  158. %files -n bsdcpio
  159. %{!?_licensedir:%global license %%doc}
  160. %license COPYING
  161. %doc NEWS README.md
  162. %{_bindir}/bsdcpio
  163. %{_mandir}/*/bsdcpio*
  164. %files -n bsdcat
  165. %{!?_licensedir:%global license %%doc}
  166. %license COPYING
  167. %doc NEWS README.md
  168. %{_bindir}/bsdcat
  169. %{_mandir}/*/bsdcat*
  170. %changelog
  171. * Thu Mar 28 2019 Pavel Raiskup <[email protected]> - 3.3.3-7
  172. - simplify libtool hacks
  173. {{ git_changelog }}