Commit 244d5dae authored by Urs Fleisch's avatar Urs Fleisch
Browse files

generate RPM with KDE 4

parent 2e23a2b2
......@@ -11,18 +11,17 @@ Release: 1%{?dist}
URL: http://kid3.sourceforge.net/
Source0: http://downloads.sourceforge.net/kid3/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# If these two prefixes overlap, generation of master.list and master-qt.list
# will not work and you have to list the %files explicitly.
%define _kid3_kde_prefix /opt/kde3
%define _kid3_qt_prefix /usr
Prefix: %{_kid3_kde_prefix}
BuildRequires: kdelibs-devel
BuildRequires: kdelibs4-devel
BuildRequires: cmake
BuildRequires: id3lib-devel
BuildRequires: taglib-devel >= 1.4
BuildRequires: flac-devel
BuildRequires: libmp4v2-devel
BuildRequires: libtunepimp-devel
BuildRequires: libvorbis-devel
BuildRequires: libmp4v2-devel
BuildRequires: perl(File::Spec)
BuildRequires: gettext
Requires: xdg-utils
%description
With Kid3 you can:
......@@ -53,39 +52,57 @@ Authors: Urs Fleisch
sed -i -e 's|/lib /usr/lib\b|/%{_lib} %{_libdir}|g' configure # lib64 rpaths
%build
./configure --disable-debug --prefix=%{_kid3_kde_prefix}
make
mkdir kde-build
cd kde-build; \
cmake -DCMAKE_SKIP_RPATH=ON -DCMAKE_INSTALL_PREFIX=/usr -DLIB_SUFFIX= -DCMAKE_BUILD_TYPE=release ..; \
make %{?_smp_mflags}; \
cd ..
cd kid3-qt; \
./configure --prefix=%{_kid3_qt_prefix}; \
mkdir qt-build
cd qt-build; \
../kid3-qt/configure --prefix=/usr; \
make %{?_smp_mflags}; \
cd ..
make -C kid3-qt
%install
make DESTDIR=$RPM_BUILD_ROOT install
find $RPM_BUILD_ROOT%{_kid3_kde_prefix} -type f -o -type l | sed "s|^$RPM_BUILD_ROOT||" >master.list
mkdir -p ${RPM_BUILD_ROOT}/%{_defaultdocdir}
find $RPM_BUILD_ROOT%{_kid3_kde_prefix} -type f -o -name "*.so" -exec strip "{}" \;
# qmake generates wrong relative paths if the build and prefix are below /usr.
# This fixes the case for prefix /usr
find kid3-qt -name Makefile -exec sed -i 's|$(INSTALL_ROOT)\(../\)\{6,7\}|$(INSTALL_ROOT)/usr/|g' {} \;
make -C kid3-qt install INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT%{_kid3_qt_prefix} -type f -o -type l | sed "s|^$RPM_BUILD_ROOT||" >master-qt.list
find $RPM_BUILD_ROOT%{_kid3_qt_prefix} -type f -o -name "*.so" -exec strip "{}" \;
find qt-build -name Makefile -exec sed -i 's|$(INSTALL_ROOT)\(../\)\{6,7\}|$(INSTALL_ROOT)/usr/|g' {} \;
mkdir -p ${RPM_BUILD_ROOT}/%{_defaultdocdir}
make -C kde-build install DESTDIR=${RPM_BUILD_ROOT}
make -C qt-build install INSTALL_ROOT=${RPM_BUILD_ROOT}
install -Dpm 644 deb/kid3.1 $RPM_BUILD_ROOT%{_mandir}/man1/kid3.1
test -d $RPM_BUILD_ROOT/usr/bin && strip $RPM_BUILD_ROOT/usr/bin/*
find $RPM_BUILD_ROOT -type f -o -name "*.so" -exec strip "{}" \;
%clean
[ -d ${RPM_BUILD_ROOT} -a "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%files -f master.list
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING LICENSE README
%{_bindir}/kid3
%{_datadir}/applications/kde4/*kid3.desktop
%{_datadir}/icons/hicolor/*x*/apps/kid3.png
%{_datadir}/icons/hicolor/scalable/apps/kid3.svgz
%{_datadir}/dbus-1/interfaces/*.xml
%{_datadir}/kde4/apps/kid3/
%{_datadir}/doc/kde4/HTML/en/kid3/
%{_datadir}/doc/kde4/HTML/de/kid3/
%{_datadir}/locale/it/LC_MESSAGES/kid3.mo
%{_datadir}/locale/nl/LC_MESSAGES/kid3.mo
%{_datadir}/locale/fr/LC_MESSAGES/kid3.mo
%{_datadir}/locale/ru/LC_MESSAGES/kid3.mo
%{_datadir}/locale/es/LC_MESSAGES/kid3.mo
%{_datadir}/locale/pl/LC_MESSAGES/kid3.mo
%{_datadir}/locale/de/LC_MESSAGES/kid3.mo
%{_mandir}/man1/kid3.1*
%package qt
Group: Applications/Multimedia
Summary: Efficient ID3 tag editor
Prefix: %{_kid3_qt_prefix}
%description qt
With Kid3 you can:
......@@ -109,6 +126,12 @@ This package does not use KDE libraries, if you use KDE you should use kid3.
Authors: Urs Fleisch
%files qt -f master-qt.list
%files qt
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING LICENSE README
%{_bindir}/kid3-qt
%{_datadir}/applications/*kid3-qt.desktop
%{_datadir}/icons/hicolor/*x*/apps/kid3-qt.png
%{_datadir}/icons/hicolor/scalable/apps/kid3-qt.svgz
%{_datadir}/doc/kid3-qt/
%{_datadir}/kid3-qt/translations/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment