spec cleanup, import upstream spec
OBS-URL: https://build.opensuse.org/package/show/graphics/librecad?expand=0&rev=3
This commit is contained in:
committed by
Git OBS Bridge
parent
f91e0f1713
commit
ed663d8b72
191
librecad.spec
191
librecad.spec
@@ -2,6 +2,7 @@
|
||||
# spec file for package librecad
|
||||
#
|
||||
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2010-2011 Rallaz
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -15,42 +16,178 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
Name: librecad
|
||||
Summary: Computer-aided design (CAD) software package for 2D design and drafting
|
||||
Version: 1.0.0.rc3
|
||||
Release: 0
|
||||
URL: http://librecad.org/
|
||||
License: GPL-2.0
|
||||
Group: Productivity/Graphics/CAD
|
||||
|
||||
# old qcad had a newer version, so we provide all versions here.
|
||||
Provides: qcad
|
||||
Obsoletes: qcad <= 2.0.5
|
||||
|
||||
#Git-Clone: git://github.com/LibreCAD/LibreCAD
|
||||
Source: %name-1.0.0~rc3-gac2797b.tar.xz
|
||||
Source2: %name-rpmlintrc
|
||||
Patch1: librecad-dxflib25.diff
|
||||
Patch2: librecad-use-fparser.diff
|
||||
Patch3: librecad-no-date.diff
|
||||
BuildRoot: %_tmppath/%name-%version-build
|
||||
BuildRequires: dxflib-devel, fparser-devel, libqt4-devel, xz
|
||||
Name: librecad
|
||||
%define _namesrc LibreCAD
|
||||
%define _versionsrc 1.0.0rc4
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: make
|
||||
|
||||
# Fedora specifics
|
||||
%if 0%{?fedora_version}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: qt-devel
|
||||
BuildRequires: qt4-devel >= 4.4.1
|
||||
%endif
|
||||
|
||||
# Mandriva specifics
|
||||
%if 0%{?mandriva_version}
|
||||
BuildRequires: XFree86-devel
|
||||
BuildRequires: freetype-devel
|
||||
BuildRequires: lcms-devel
|
||||
BuildRequires: libqt4-devel
|
||||
BuildRequires: qt4-assistant
|
||||
BuildRequires: qt4-linguist
|
||||
BuildRequires: pkgconfig(hal)
|
||||
%endif
|
||||
|
||||
# SUSE Specifics
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: libqt4-devel >= 4.4.1
|
||||
BuildRequires: libqt4-devel-doc
|
||||
BuildRequires: update-desktop-files
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora_version}
|
||||
%define _qmakename qmake-qt4
|
||||
%else
|
||||
%define _qmakename qmake
|
||||
%endif
|
||||
|
||||
Version: %{_versionsrc}
|
||||
Release: 1.1
|
||||
License: GPLv2
|
||||
Summary: An generic 2D CAD program
|
||||
Url: http://www.librecad.org/
|
||||
Group: Productivity/Graphics/CAD
|
||||
Source0: %{_namesrc}-%{_versionsrc}.tar.bz2
|
||||
Source1: %{name}-rpmlintrc
|
||||
Source2: %{name}.mime.desktop
|
||||
Patch1: %{name}-lrelease-fedora.patch
|
||||
Patch2: %{name}-desktop.patch
|
||||
Patch3: %{name}-dxflib.patch
|
||||
Patch4: %{name}-no-date.patch
|
||||
Patch5: %{name}-fparser.patch
|
||||
Patch32: %{name}-plugindir32.patch
|
||||
Patch64: %{name}-plugindir64.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Requires(pre): shared-mime-info
|
||||
%if 0%{?suse_version} > 0
|
||||
Recommends: %{name}-parts
|
||||
%endif
|
||||
|
||||
%description
|
||||
LibreCAD is a Qt4 application to design 2D cad drawing based
|
||||
on the community edition of QCad.
|
||||
|
||||
%package parts
|
||||
Summary: Parts collection for %{name}
|
||||
Group: Productivity/Graphics/CAD
|
||||
Requires: %{name}
|
||||
BuildArch: noarch
|
||||
|
||||
%description parts
|
||||
Collection of parts for %{name}, a Qt4 application to design 2D cad drawing based
|
||||
on the community edition of QCad.
|
||||
|
||||
%prep
|
||||
%setup -qn LibreCAD
|
||||
%patch -P 1 -P 2 -P 3 -p1
|
||||
%setup -q -n %{_namesrc}-%{_versionsrc}
|
||||
%if 0%{?fedora_version}
|
||||
%patch1 -p1
|
||||
%endif
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%ifarch x86_64
|
||||
%patch64 -p1
|
||||
%else
|
||||
%patch32 -p1
|
||||
%endif
|
||||
|
||||
%build
|
||||
qmake QMAKE_CFLAGS+="%optflags" QMAKE_CXXFLAGS+="%optflags";
|
||||
make %{?_smp_mflags};
|
||||
export CXXFLAGS="%{optflags}"
|
||||
%{_qmakename} "CONFIG+=release"
|
||||
make %{?_smp_mflags}
|
||||
cd plugins
|
||||
%{_qmakename} "CONFIG+=release"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
b="%buildroot";
|
||||
mkdir -p "$b/%_bindir";
|
||||
install -pm0755 unix/librecad "$b/%_bindir/";
|
||||
%make_install INSTALL_ROOT=%{buildroot}
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/fonts
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/patterns
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/qm
|
||||
mkdir -p %{buildroot}%{_docdir}/%{name}
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/library
|
||||
# mkdir -p %{buildroot}%{_datadir}/%{name}/doc
|
||||
mkdir -p %{buildroot}%{_libdir}/%{name}/plugins
|
||||
cp unix/resources/patterns/*.dxf %{buildroot}%{_datadir}/%{name}/patterns/
|
||||
cp unix/resources/fonts/*.lff %{buildroot}%{_datadir}/%{name}/fonts/
|
||||
cp -r unix/resources/library/* %{buildroot}%{_datadir}/%{name}/library/
|
||||
cp unix/resources/qm/*.qm %{buildroot}%{_datadir}/%{name}/qm/
|
||||
# cp unix/resources/doc/* %{buildroot}%{_datadir}/%{name}/doc/
|
||||
cp unix/resources/plugins/* %{buildroot}%{_libdir}/%{name}/plugins/
|
||||
mv gpl-2.0.txt LICENSE
|
||||
chmod 644 LICENSE
|
||||
chmod 644 README
|
||||
find %{buildroot}%{_datadir}/%{name} -type f -exec chmod 644 {} \;
|
||||
|
||||
install -Dm 755 -s unix/%{name} %{buildroot}%{_bindir}/%{name}
|
||||
install -Dm 644 desktop/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
|
||||
install -Dm 644 res/main/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
|
||||
install -Dm 644 %{SOURCE2} %{buildroot}%{_datadir}/mime/image/dxf.desktop
|
||||
%if 0%{?suse_version} > 0
|
||||
%suse_update_desktop_file -r %{name} Graphics VectorGraphics
|
||||
%suse_update_desktop_file %{buildroot}%{_datadir}/mime/image/dxf.desktop
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
%fdupes %{buildroot}
|
||||
%endif
|
||||
|
||||
%clean
|
||||
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
|
||||
|
||||
%post
|
||||
if [ -x usr/bin/update-mime-database ]; then
|
||||
usr/bin/update-mime-database usr/share/mime >/dev/null
|
||||
fi
|
||||
%if 0%{?mandriva_version}
|
||||
%update_menus
|
||||
%endif
|
||||
|
||||
%postun
|
||||
if [ -x usr/bin/update-mime-database ]; then
|
||||
usr/bin/update-mime-database usr/share/mime >/dev/null
|
||||
fi
|
||||
%if 0%{?mandriva_version}
|
||||
%clean_menus
|
||||
%endif
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%_bindir/librecad
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE README
|
||||
%{_bindir}/%{name}
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
%{_datadir}/pixmaps/%{name}.png
|
||||
%{_datadir}/mime/image/dxf.desktop
|
||||
%dir %{_datadir}/%{name}
|
||||
%{_datadir}/%{name}/qm/
|
||||
%{_datadir}/%{name}/fonts/
|
||||
%{_datadir}/%{name}/patterns/
|
||||
# %dir %{_datadir}/%{name}/doc
|
||||
# %{_datadir}/%{name}/doc/*
|
||||
%dir %{_libdir}/%{name}
|
||||
%{_libdir}/%{name}/plugins/
|
||||
|
||||
%files parts
|
||||
%defattr(-,root,root,-)
|
||||
%{_datadir}/%{name}/library
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user