So like many others I am new to building RPM packages and am having issues with the spec file I have created. It’s been made using info I’ve gathered from various posts here so it might just be horribly mangled but I’d appreciate some help since I can’t seem to get it to work no matter how many changes I seem to incorporate into it. Thanks.
%define name obstext
%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
%define qmake qmake
%define lrelease lrelease
%if %is_fedora
%define distr %(cat /etc/fedora-release)
%define qmake qmake-qt4
%define lrelease lrelease-qt4
%endif
%if %is_suse
%define distr %(head -1 /etc/SuSE-release)
%endif
%if %is_mandrake
%define distr %(cat /etc/mandrake-release)
%endif
# Basic Information
Name: delaycut
Summary: Audio file delay and cut utility
License: GPLv3
Group: Applications/Sound
URL: https://github.com/athomasm/delaycut
Version: 1.4.0.0
Release: 1
Source0: %{name}-%{version}.tar.gz
Distribution: %{distr}
Packager: Adam Thomas-Murphy <patlaborforce@gmail.com>
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Dependency Information
BuildRequires: libqt4-devel >= 4.4.3
%description
delaycut corrects delay and is also able to cut audio files
coded ac3, eac3, dts, mpa and wav. It is also able to fix
CRC errors in ac3 and mpa files.
%prep
%setup
%build
qmake -makefile %{name}.pro
qmake
make
%install
make install DESTDIR=$RPM_BUILD_ROOT $INSTALL_TARGET
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README.txt
%{_bindir}/%{name}
%changelog
And the error I get when trying to build is:
RPM build errors:
File not found: /usr/src/packages/BUILDROOT/delaycut-1.4.0.0-63.1.x86_64/usr/bin/delaycut
Having cleaned it up a bit anyway and having included a few things you mention I now have it at:
%if 0%{?suse_version}
%define group Productivity/Multimedia/Sound/Utilities
%define distr %(cat /etc/SuSE-release)
%endif
%if 0%{?fedora}
%define qmake qmake-qt4
%define group Applications/Multimedia
%define distr %(cat /etc/fedora-release)
%endif
# Basic Information
Name: delaycut
Summary: Audio file delay and cut utility
License: GPL-3.0
Group: %{group}
URL: https://github.com/athomasm/delaycut
Version: 1.4.0.0
Release: 1
Source0: %{name}-%{version}.tar.gz
Distribution: %{distr}
Packager: Adam Thomas-Murphy <patlaborforce@gmail.com>
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Dependency Information
BuildRequires: libqt4-devel
%description
delaycut corrects delay and is also able to cut audio files
coded ac3, eac3, dts, mpa and wav. It is also able to fix
CRC errors in ac3 and mpa files.
%prep
%setup
%build
qmake-qt4 -makefile %{name}.pro
qmake-qt4
make
%install
make install DESTDIR=$RPM_BUILD_ROOT $INSTALL_TARGET
%changelog
* Tue Nov 15 2011 Adam Thomas-Murphy <patlaborforce@gmail.com>
- Initial Spec File
But now I get
cat: /etc/SuSE-release: No such file or directory
or the same error for the Fedora builds just it’s complaining about /etc/fedora-release not existing. If I remove that it builds fine so should I just not care about filling in the Distribution tag?
Hi
Correct it’s not needed or packager (will cause a warning/error) and
you also need to separate out the changelog into a file called
<specfile_name>.changes