# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify CentOS Linux and Scientific Linux as rhel %if "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "sl" || "%{__distinit}" == "sls" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif Name: libmetalink Version: 0.1.3 Release: 8.%{__distinit}%{__distvers} Summary: Metalink library written in C License: MIT URL: https://launchpad.net/libmetalink Source0: https://launchpad.net/libmetalink/trunk/%{name}-%{version}/+download/%{name}-%{version}.tar.bz2 BuildRequires: coreutils BuildRequires: CUnit-devel BuildRequires: expat-devel %{?el6:< 2.1} BuildRequires: findutils BuildRequires: gcc BuildRequires: make %description libmetalink is a Metalink C library. It adds Metalink functionality such as parsing Metalink XML files to programs written in C. %package devel Summary: Files needed for developing with %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Files needed for building applications with libmetalink. %prep %setup -q %build %configure --disable-static make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} INSTALL="install -p" find %{buildroot} -name *.la -delete %check make check %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 27) # ldconfig replaced by RPM File Triggers from Fedora 28 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %endif %files %if 0%{?_licensedir:1} %license COPYING %else %doc COPYING %endif %doc README %{_libdir}/libmetalink.so.3 %{_libdir}/libmetalink.so.3.* %files devel %dir %{_includedir}/metalink/ %{_includedir}/metalink/metalink_error.h %{_includedir}/metalink/metalink.h %{_includedir}/metalink/metalink_parser.h %{_includedir}/metalink/metalink_types.h %{_includedir}/metalink/metalinkver.h %{_libdir}/libmetalink.so %{_libdir}/pkgconfig/%{name}.pc %{_mandir}/man3/metalink_checksum_t.3* %{_mandir}/man3/metalink_chunk_checksum_t.3* %{_mandir}/man3/metalink_delete.3* %{_mandir}/man3/metalink_file_t.3* %{_mandir}/man3/metalink_parse_fd.3* %{_mandir}/man3/metalink_parse_file.3* %{_mandir}/man3/metalink_parse_final.3* %{_mandir}/man3/metalink_parse_fp.3* %{_mandir}/man3/metalink_parse_memory.3* %{_mandir}/man3/metalink_parse_update.3* %{_mandir}/man3/metalink_parser_context_delete.3* %{_mandir}/man3/metalink_parser_context_new.3* %{_mandir}/man3/metalink_piece_hash_t.3* %{_mandir}/man3/metalink_resource_t.3* %{_mandir}/man3/metalink_t.3* %changelog * Tue Feb 5 2019 Paul Howarth - 0.1.3-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Jul 17 2018 Paul Howarth - 0.1.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Feb 14 2018 Paul Howarth - 0.1.3-6 - ldconfig replaced by RPM File Triggers from Fedora 28 - BR: CUnit-devel unconditionally - Work around presence of incompatible expat21 in EPEL-6 * Mon Aug 14 2017 Paul Howarth - 0.1.3-4 - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section * Sat Feb 11 2017 Paul Howarth - 0.1.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Nov 16 2016 Paul Howarth - 0.1.3-1 - Update to 0.1.3 - Fixes a bug in which the signature element in metalink v4 was not parsed correctly * Fri Feb 5 2016 Paul Howarth - 0.1.2-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sat Jun 20 2015 Paul Howarth - 0.1.2-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Tue Aug 19 2014 Paul Howarth - 0.1.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Mon Jul 21 2014 Paul Howarth - 0.1.2-6 - Use %%license where possible * Wed Jun 11 2014 Paul Howarth - 0.1.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed Jun 26 2013 Paul Howarth - 0.1.2-4 - Import from Fedora * Thu Jun 13 2013 Alejandro Alvarez - 0.1.2-3 - Added BuildRequires: CUnit-devel - Added %%check section - Removed %%defattr - Moved man pages to devel package; there is no need for -doc * Mon Jun 10 2013 Alejandro Alvarez - 0.1.2-2 - Escaped macros in changelog - Changed packages summaries - Renamed -docs to -doc, and changed its group to Documentation - Fixed -devel dependencies - Removed -docs dependency on the main package - All header files specified explicitly * Mon Apr 22 2013 Alejandro Alvarez - 0.1.2-1 - Updated for new upstream release - Man pages moved to libmetalink-docs package * Fri Jan 13 2012 Fedora Release Engineering - 0.0.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Feb 08 2011 Fedora Release Engineering - 0.0.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Fri Jul 24 2009 Fedora Release Engineering - 0.0.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu May 07 2009 Ant Bryan - 0.0.3-4 - Remove Provides: libmetalink-static = %%{version}-%%{release} * Wed May 06 2009 Ant Bryan - 0.0.3-3 - Use %%{_docdir} instead of /usr/share/doc - Own /usr/include/metalink * Wed Apr 29 2009 Ant Bryan - 0.0.3-2 - Incorporate suggested changes: remove .la files, --disable static * Mon Apr 27 2009 Ant Bryan - 0.0.3-1 - Initial package, 0.0.3