libarchive.spec 4.8 KB

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