Originally posted by hreindl
View Post
Instead of this:
Code:
Source0: %{name}/%{name}-%{version}.tar.gz
Code:
Source0: http://downloads.sourceforge.net/lame/%{name}-%{version}.tar.gz
Then you can download sources using the spectool command:
Code:
spectool -g -R lame.spec
Replace this:
Code:
BuildRequires: ncurses-devel
Code:
BuildRequires: pkgconfig(ncurses)
Moreover, for Fedora >= 29 you should also specify this:
Code:
BuildRequires: gcc
Code:
%description libs
You should use something like this:
Code:
%description libs LAME library.
Code:
%description libs Libraries needed to run %{name}.
Code:
%description libs Shared libraries used by the LAME MP3 encoder.
Code:
%description libs This package contains libraries used by the LAME MP3 encoder.
Code:
%description libs This package contains library files for LAME.
Code:
%description devel
You can use something like this:
Code:
%description devel This package contains development files for LAME.
Instead of:
Code:
%setup -q %patch1 -p1 -b .noexec
Code:
%autosetup -p1
Instead of:
Code:
sed
Code:
%{__sed}
Code:
export CXXFLAGS="$CFLAGS" export CPPFLAGS="$CFLAGS" export CC="gcc $CFLAGS" export SH_LDFLAGS="-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack %{optflags} %{O3_flags} %{OS_flags} -fno-fast-math -fno-unsafe-math-optimizations -fuse-ld=gold -fuse-linker-plugin" export LDFLAGS="$SH_LDFLAGS -pie -fPIE"
Replace this:
Code:
%{__make} %{?_smp_mflags}
Code:
%make_build
Replace this:
Code:
make install-strip INSTALL="install -p" DESTDIR=%{buildroot}
Code:
%make_install INSTALL="install -p"
Instead of:
Code:
rm -f %{buildroot}%{_libdir}/*.la
Code:
%{__rm} -f "%{buildroot}%{_libdir}"/*.la
Code:
find "%{buildroot}" -xtype f -name '*.la' -delete
Instead of:
Code:
ln -sf %{name}/%{name}.h %{buildroot}%{_includedir}/%{name}.h
Code:
%{__ln_s} "%{name}/%{name}.h" "%{buildroot}%{_includedir}/%{name}.h"
Code:
%ldconfig_scriptlets
To keep compatible with EL <= 7 you should use something like this:
Code:
%post -p /sbin/ldconfig %postun -p /sbin/ldconfig
Code:
%post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
You should make use of %doc and %license macros in the %files section.
For example:
Code:
%doc README %license COPYING
You should also consider specifying Group:
- for the main package:
Code:
Group: Applications/Multimedia
Code:
Group: System Environment/Libraries
Code:
Group: Development/Libraries
Comment