LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File LPub4.spec of Package LPub4 (Project home:pbartfai)

%if 0%{?suse_version}
%define dist .openSUSE%(echo %{suse_version} | sed 's/0$//')
%endif

%if 0%{?sles_version}
%define dist .SUSE%(echo %{sles_version} | sed 's/0$//')
%endif

%if "%{vendor}" == "obs://build.opensuse.org/home:pbartfai"
%define opensuse_bs 1
%endif

%if 0%{?centos_ver}
%define centos_version %{centos_ver}00
%endif

Summary: Produces step by step construction documentation for LEGO models
Name: lpub
%if 0%{?suse_version} || 0%{?sles_version}
Group: Productivity/Graphics/Viewers
%endif
%if 0%{?mdkversion} || 0%{?rhel_version} 
Group: Graphics
%endif
%if 0%{?fedora} || 0%{?centos_version}
Group: Amusements/Graphics
%endif
Version: 4
Release: 1%{?dist}
%if 0%{?mdkversion} || 0%{?rhel_version} || 0%{?fedora} || 0%{?centos_version} || 0%{?scientificlinux_version} || 0%{?mageia}
License: GPLv2+
%endif
%if 0%{?suse_version} || 0%{?sles_version}
License: GPL-2.0+
BuildRequires: fdupes
%endif
URL: http://lpub4.sourceforge.net
Vendor: Kevin Clague <kevin.clague@gmail.com>
Packager: Peter Bartfai <pbartfai@stardust.hu>
BuildRoot: %{_builddir}/%{name}

%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
%if ( 0%{?centos_version}>=600 || 0%{?rhel_version}>=600 || 0%{?scientificlinux_version}>=600 || 0%{?fedora} )
BuildRequires: qt-devel
%endif
BuildRequires: gcc-c++, make
%endif

Source0: LPub4.tar.gz
Patch0: lpub4-linux.patch

%if 0%{?fedora}
%if 0%{?opensuse_bs}
BuildRequires: samba4-libs
%endif
%endif

%if 0%{?suse_version} 
BuildRequires: libqt4-devel
%endif

%if 0%{?mageia}
BuildRequires: libqt4-devel
%if 0%{?opensuse_bs}
BuildRequires: libuuid-devel
%endif
%endif

%if 0%{?mdkversion}
BuildRequires: libqt4-devel
# For openSUSE Build Service
%if 0%{?opensuse_bs}
%if (0%{?mdkversion} != 200910) && (0%{?mdkversion} != 201000)
BuildRequires: kde-l10n-en_GB
%endif
BuildRequires: aspell-en, myspell-en_US
%endif
%endif

%if ( 0%{?centos_version}<600 && 0%{?centos_version}>=500 ) || ( 0%{?rhel_version}<600 && 0%{?rhel_version}>=500 )
BuildRequires: qt4-devel
%endif

%if (0%{?scientificlinux_version}>=600 && 0%{?scientificlinux_version}<700)
BuildRequires: libjpeg-turbo-devel
%endif

%description
LPub is a program that allow the production of step by step building instructions for LEGO models created using the LDraw file format.

%prep
cd $RPM_SOURCE_DIR
if [ -s %{SOURCE0} ] ; then
	if [ -d LPub4 ] ; then rm -rf LPub4 ; fi
	tar zxf %{SOURCE0}
fi
patch -p0 < %{PATCH0}

%build
cd $RPM_SOURCE_DIR/LPub4
%ifarch i386 i486 i586 i686
%define qplatform linux-g++-32
%endif
%ifarch x86_64
%define qplatform linux-g++-64
%endif
%if ( 0%{?centos_version}<600 && 0%{?centos_version}>=500 ) || ( 0%{?rhel_version}<600 && 0%{?rhel_version}>=500 )
if [ -x %{_libdir}/qt4/bin/qmake ] ; then
export PATH=%{_libdir}/qt4/bin:$PATH
fi
%ifarch x86_64
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -I%{_libdir}/qt4/include"
%if 0%{?fedora_version}==23
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC"
export TESTING="-fPIC"
%endif
%endif
%endif
if which qmake-qt4 >/dev/null 2>/dev/null ; then
	qmake-qt4 -spec %{qplatform}
else
	qmake -spec %{qplatform}
fi
make clean
make TESTING="$RPM_OPT_FLAGS"
if which lrelease-qt4 >/dev/null 2>/dev/null ; then
	lrelease-qt4 lpub.pro
else
	lrelease lpub.pro
fi
strip lpub

%install
cd $RPM_SOURCE_DIR/LPub4
install -d $RPM_BUILD_ROOT%{_bindir}
install -d $RPM_BUILD_ROOT%{_datadir}/lpub4
install -m 755 lpub $RPM_BUILD_ROOT%{_bindir}/lpub
install -m 644 pli.mpd $RPM_BUILD_ROOT%{_datadir}/lpub4/pli.mpd

%files
%if 0%{?sles_version} || 0%{?suse_version}
%defattr(-,root,root)
%endif
%{_bindir}/lpub
%dir %{_datadir}/lpub4
%doc %{_datadir}/lpub4/pli.mpd

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Tue Sep 25 2012 - pbartfai (at) stardust.hu 4.0-1
- Initial version