Modernize spec, remove explicit requires on cpptest

epel9
Sandro Mani 9 years ago
parent ff066ab50b
commit a2faa9b58f

@ -1,103 +1,98 @@
%global _hardened_build 1 %global _hardened_build 1
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Name: uriparser Name: uriparser
Version: 0.8.4 Version: 0.8.4
Release: 2%{?dist} Release: 3%{?dist}
Summary: URI parsing library - RFC 3986 Summary: URI parsing library - RFC 3986
Group: System Environment/Libraries
License: BSD License: BSD
URL: http://%{name}.sourceforge.net/ URL: http://%{name}.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
BuildRequires: doxygen, graphviz, cpptest-devel
Requires: cpptest BuildRequires: automake autoconf libtool
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: cpptest-devel
%description %description
Uriparser is a strictly RFC 3986 compliant URI parsing library written Uriparser is a strictly RFC 3986 compliant URI parsing library written
in C. uriparser is cross-platform, fast, supports Unicode and is in C. uriparser is cross-platform, fast, supports Unicode and is
licensed under the New BSD license. licensed under the New BSD license.
%package devel
%package devel
Summary: Development files for %{name} Summary: Development files for %{name}
Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%description devel %description devel
The %{name}-devel package contains libraries and header files for The %{name}-devel package contains libraries and header files for
developing applications that use %{name}. developing applications that use %{name}.
%package doc
Summary: HTML documentation for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description doc %package doc
Summary: HTML documentation for %{name}
BuildArch: noarch
%description doc
The %{name}-doc package contains HTML documentation files for %{name}. The %{name}-doc package contains HTML documentation files for %{name}.
%prep %prep
%setup -q %setup -q
sed -i 's/\r//' THANKS
# Fix line endings and encoding
sed -i 's/\r//' COPYING sed -i 's/\r//' COPYING
iconv -f iso-8859-1 -t utf-8 -o THANKS{.utf8,} iconv -f iso8859-1 -t utf-8 THANKS > THANKS.conv && mv -f THANKS.conv THANKS
mv THANKS{.utf8,}
# Remove qhelpgenerator dependency by commenting Doxygen.in: # Remove qhelpgenerator dependency by commenting Doxygen.in:
# sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' Doxyfile.in
sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
# fix installation errors # fix installation errors
sed -i -e 's,html/\*.map\ ,,g' doc/Makefile.in sed -i -e 's,html/\*.map\ ,,g' doc/Makefile.am
sed -i -e 's,-\$(INSTALL_DATA) \*.qch "$(DESTDIR)\$(docdir)/",,g' doc/Makefile.in
%build %build
autoreconf -ifv
%configure --disable-static %configure --disable-static
# disable rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# Generate docs first
cd doc;
make %{?_smp_mflags}
cd ..
# Build
make %{?_smp_mflags} make %{?_smp_mflags}
%check
LD_LIBRARY_PATH=".libs" make check
%install %install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" %make_install
find %{buildroot} -name '*.la' -delete
find $RPM_BUILD_ROOT -name '*.la' -delete
# fcami - update for https://fedoraproject.org/wiki/Changes/UnversionedDocdirs %check
if [ ${RPM_BUILD_ROOT}%{_datadir}/doc/%{name} != ${RPM_BUILD_ROOT}%{_pkgdocdir} ] LD_LIBRARY_PATH=".libs" make check
then mv ${RPM_BUILD_ROOT}%{_datadir}/doc/%{name}/html ${RPM_BUILD_ROOT}%{_pkgdocdir}
fi
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%files %files
%doc THANKS AUTHORS COPYING ChangeLog %doc THANKS AUTHORS ChangeLog
%license COPYING
%{_bindir}/uriparse %{_bindir}/uriparse
%{_libdir}/*.so.* %{_libdir}/*.so.*
%files doc
%doc %{_docdir}/%{name}/html
%files devel %files devel
%{_includedir}/* %{_includedir}/*
%{_libdir}/*.so %{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%files doc
%license COPYING
%doc %{_docdir}/%{name}/html
%changelog %changelog
* Tue May 10 2016 Sandro Mani <manisandro@gmail.com> - 0.8.4-3
- Drop unused requires on cpptest
- Modernize spec
* Sun Mar 27 2016 François Cami <fcami@fedoraproject.org> - 0.8.4-2 * Sun Mar 27 2016 François Cami <fcami@fedoraproject.org> - 0.8.4-2
- Add -doc subpackage. - Add -doc subpackage.

Loading…
Cancel
Save