# Changes incorporated from Rallaz's spec file, which is # # Copyright (c) 2010-2012 Rallaz # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # Matches "2.0.0rc2" tag. %global commit f87828ec55def73aaa8c3c3e158fc1abc8171b63 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global betatag rc2 %global dxfrw_includedir %(pkg-config --cflags-only-I libdxfrw0 | sed 's|-I||g') Name: librecad Version: 2.0.0 Release: 0.6.%{?betatag}%{?dist} Summary: Computer Assisted Design (CAD) Application License: GPLv2 and GPLv2+ URL: http://librecad.org/ Source0: https://github.com/LibreCAD/LibreCAD/archive/%{commit}/librecad-2.0.0%{?betatag}.tar.gz Source1: ttf2lff.1 Patch0: librecad-use-system-libdxfrw.patch Patch1: librecad-desktop.patch Patch2: librecad-install.patch Patch3: librecad-plugindir.patch Patch4: librecad-use-system-shapelib.patch BuildRequires: qt4-devel, wqy-microhei-fonts, muParser-devel, freetype-devel, libdxfrw-devel >= 0.5.7-3 BuildRequires: desktop-file-utils, boost-devel, shapelib-devel Requires: %{name}-fonts = %{version}-%{release} Requires: %{name}-langs = %{version}-%{release} Requires: %{name}-parts = %{version}-%{release} Requires: %{name}-patterns = %{version}-%{release} Requires(post): shared-mime-info Requires(postun): shared-mime-info # Do not check any files in the librecad plugin dir for requires %global __provides_exclude_from ^(%{_libdir}/%{name}/plugins/.*\\.so)$ %description A graphical and comprehensive 2D CAD application. %package devel Summary: Development files for LibreCAD Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for LibreCAD. %package fonts Summary: Fonts in LibreCAD (lff) format License: GPLv2+ and (ASL 2.0 or GPLv3 with exceptions) BuildArch: noarch %description fonts Fonts converted to LibreCAD (lff) format. %package langs Summary: Language (qm) files for LibreCAD BuildArch: noarch %description langs Language (qm) files for LibreCAD. %package parts Summary: Parts collection for LibreCAD BuildArch: noarch %description parts Collection of parts for LibreCAD. %package patterns Summary: Pattern files for LibreCAD BuildArch: noarch %description patterns Pattern files for LibreCAD. %prep %setup -qn LibreCAD-%{commit} %patch0 -p1 -b .system %patch1 -p1 -b .desktopfix %patch2 -p1 -b .install %patch3 -p1 %patch4 -p1 -b .system-shapelib sed -i 's|##LIBDIR##|%{_libdir}|g' librecad/src/lib/engine/rs_system.cpp sed -i 's|$${DXFRW_INCLUDEDIR}|%{dxfrw_includedir}|g' librecad/src/src.pro # Nuke bundled libraries rm -rf libraries/libdxfrw rm -rf plugins/importshp/shapelib # unset +x flags on some source files for i in plugins/*/*.cpp plugins/*/*.h librecad/src/plugins/qc_plugininterface.h; do chmod -x $i done %build %{qmake_qt4} librecad.pro 'CONFIG+=release' 'BOOST_DIR=/usr' 'BOOST_LIBDIR=%{_libdir}' 'MUPARSER_DIR=/usr' 'QMAKE_LFLAGS_RELEASE=' make %{?_smp_mflags} MUPARSER_DIR=/usr rm -rf unix/resources/fonts/wqy-unicode.lff mkdir -p unix/resources/fonts ./unix/ttf2lff -L "ASL 2.0 or GPLv3 with exceptions" /usr/share/fonts/wqy-microhei/wqy-microhei.ttc unix/resources/fonts/wqy-unicode.lff %install export BUILDDIR="%{buildroot}%{_datadir}/%{name}" sh scripts/postprocess-unix.sh mkdir -p %{buildroot}%{_libdir}/%{name}/plugins mv unix/resources/plugins/* %{buildroot}%{_libdir}/%{name}/plugins/ %{__install} -Dpm 755 -s unix/%{name} %{buildroot}%{_bindir}/%{name} %{__install} -Dpm 755 -s unix/ttf2lff %{buildroot}%{_bindir}/ttf2lff %{__install} -Dpm 644 desktop/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop %{__install} -Dpm 644 librecad/res/main/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png %{__install} -Dpm 644 desktop/%{name}.sharedmimeinfo %{buildroot}%{_datadir}/mime/packages/%{name}.xml %{__install} -Dpm 644 desktop/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 %{__install} -Dpm 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/ttf2lff.1 %{__install} -Dpm 644 librecad/src/plugins/document_interface.h %{buildroot}%{_includedir}/%{name}/document_interface.h %{__install} -Dpm 644 librecad/src/plugins/qc_plugininterface.h %{buildroot}%{_includedir}/%{name}/qc_plugininterface.h %{_fixperms} %{buildroot} desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop %post /usr/bin/update-desktop-database &> /dev/null || : /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %postun /usr/bin/update-desktop-database &> /dev/null || : /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %files %doc LICENSE README.md %doc %{_mandir}/man1/%{name}.1* %doc %{_mandir}/man1/ttf2lff.1* %{_bindir}/%{name} %{_bindir}/ttf2lff %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %{_datadir}/mime/packages/%{name}.xml %dir %{_datadir}/%{name} %{_datadir}/%{name}/doc/ %{_libdir}/%{name}/ %files devel %{_includedir}/%{name}/ %files fonts %doc LICENSE LICENSE_Apache2.txt LICENSE_GPLv3.txt %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/fonts/ %files langs %doc LICENSE %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/qm/ %files parts %doc LICENSE %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/library/ %files patterns %doc LICENSE %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/patterns/ %changelog * Sun Oct 20 2013 Tom Callaway - 2.0.0-0.6.rc2 - add missing LICENSE files to subpackages - add dir ownership to subpackages - readd all mime scriptlets * Sun Oct 20 2013 Tom Callaway - 2.0.0-0.5.rc2 - fix mime-type desktop scriptlets - unbundle shapelib - do not have provides for unversioned plugins - fix permissions - nuke unused code - make patterns and langs noarch subpackages - preserve timestamps in install commands - fix link flags to not have -O1 by overriding * Fri Oct 18 2013 Tom Callaway - 2.0.0-0.4.rc2 - update to rc2 * Tue Apr 30 2013 Tom Callaway - 2.0.0-0.3.beta5 - add BR: boost-devel - update to beta5 * Tue Apr 9 2013 Tom Callaway - 2.0.0-0.2.beta2 - update to beta2 * Sun Feb 24 2013 Tom Callaway - 2.0.0-0.1.beta1 - initial package