1# 2# spec file for mp3plot rpm 3# 4# originally based on 5# <http://kmymoney2.sourceforge.net/phb/rpm-example.html> 6# automake stuff (i.e. @whatever@) from 7# <http://www.shlomifish.org/lecture/Autotools/slides/issues/rpm-spec.html> 8# fields like @SOMETHING@ will be replaced by ./configure 9# Fedora/Red Hat/RHEL stuff from 10# <http://fedoraproject.org/wiki/Packaging/DistTag> 11# TODO: Which other distros have adopted the Red Hat way, and which tags do they use? 12 13%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0) 14%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0) 15%define is_fedora 0%{?fedora} 16%define is_redhat 0%{?rhl} 17%define is_rhel 0%{?rhel} 18 19%define distname generic 20%define disttag .generic_lsb 21 22%if %{is_fedora} 23%define distname fedora 24%define disttag %{dist} 25%endif 26%if %{is_redhat} 27%define distname redhat 28%define disttag %{dist} 29%endif 30%if %{is_mandrake} 31%define distname mandrake 32%define disttag .mdk 33%endif 34%if %{is_suse} 35%define distname suse 36%define disttag .suse 37%endif 38%if %{is_rhel} 39%define distname rhel 40%define disttag %{dist} 41%endif 42 43# i386 shouldn't be used as arch, build will fail with a 44# "undefined reference: ... __sync_fetch_and_add_4" 45# <http://sources.redhat.com/ml/libc-alpha/2007-02/msg00009.html> 46# This shouldn't be a problem on real RPM distros 47%define optflags_ %(echo "%{optflags}" | sed -r 's/(mtune|mcpu)=i386/\1=i486/g') 48 49#%define distver %(release="`rpm -q --queryformat='%{VERSION}' %{distname}-release 2> /dev/null | tr . : | sed s/://g`" ; if test $? != 0 ; then release="" ; fi ; echo "$release") 50 51# Only set packager if empty 52%if %(test "%{packager}" == "" && echo 1 || echo 0) 53%define packager %(finger -lp `echo $USER` | head -n1 | cut -d: -f3) 54%endif 55 56Name: mp3plot 57Summary: MP3 bitrate analysis tool 58Version: 0.6.0 59Release: 1%{?disttag}~upstream 60License: GPL 61#Vendor: Toni Corvera 62Packager: %packager 63Group: Applications/Audio 64Source0: http://p.outlyer.net/%{name}/files/%{name}-%{version}.tar.gz 65#Source0: %{name}-%version.tar.gz 66BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build 67URL: http://p.outlyer.net/mp3plot 68#BuildRequires: 69#Prereq: /sbin/ldconfig 70#Requires: 71AutoReqProv: yes 72## Allow relocation (e.g. rpm --prefix /opt/mp3plot) 73Prefix: /usr 74 75%description 76mp3plot creates a plot (textual or graphical) of the bitrate distribution of 77an MP3 file; i.e. it displays which proportion of the audio file uses 78each of the possible bitrates. 79 80The plot can serve e.g. to compare an audio source as encoded by different 81encoders or settings; or to display how the chosen (average) bitrate was 82achieved by the encoder. 83 84 85%prep 86#echo %_target 87echo Building %{name}-%{version}-%{release} 88 89%setup -q -n %{name}-%{version} 90 91%build 92CXXFLAGS="%{optflags_}" ./configure --prefix=%{_prefix} --enable-gd --disable-magick 93make 94 95%install 96make DESTDIR=%buildroot install 97 98%clean 99[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} 100 101#%post 102# postinst 103 104#%postun 105# postuninst 106 107%files 108%defattr(-,root,root) 109# binary 110%{_bindir}/%{name} 111# Manpage 112%{_mandir}/man1/%{name}.1.gz 113%doc README 114 115%changelog 116* Mon Jun 22 2009 - outlyer (at) gmail (dot) com 117- New version 118 119* Sat Apr 25 2009 - outlyer (at) gmail (dot) com 120- New version 121 122* Fri Apr 10 2009 - outlyer (at) gmail (dot) com 123- Initial RPM packaging 124 125