# 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.0beta5" tag. %global commit f90eb457b36727374f3609d4b37d0f3c47c1c057 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global betatag beta5 %global dxfrw_includedir %(pkg-config --cflags-only-I libdxfrw0 | sed 's|-I||g') Name: librecad Version: 2.0.0 Release: 0.3.%{betatag}%{?dist} Summary: Computer Assisted Design (CAD) Application License: GPLv2 and GPLv2+ URL: http://librecad.org/cms/home.html 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-lrelease-fedora.patch BuildRequires: qt4-devel, wqy-microhei-fonts, muParser-devel, freetype-devel, libdxfrw-devel >= 0.5.7-3 BuildRequires: desktop-file-utils, boost-devel Requires: %{name}-fonts = %{version}-%{release} Requires: %{name}-parts = %{version}-%{release} Requires(post): shared-mime-info Requires(postun): shared-mime-info %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 parts Summary: Parts collection for LibreCAD BuildArch: noarch %description parts Collection of parts for LibreCAD. %prep %setup -qn LibreCAD-%{commit} %patch0 -p1 -b .system %patch1 -p1 -b .desktopfix %patch2 -p1 -b .install %patch3 -p1 %patch4 -p1 -b .qt4fix sed -i 's|##LIBDIR##|%{_libdir}|g' librecad/src/lib/engine/rs_system.cpp sed -i 's|$${MUPARSER_DIR}"/lib|$${MUPARSER_DIR}"/%{_lib}|g' common.pro sed -i 's|$${BOOST_DIR}|/usr|g' common.pro sed -i 's|$${BOOST_LIBDIR}|%{_libdir}|g' common.pro sed -i 's|$${DXFRW_INCLUDEDIR}|%{dxfrw_includedir}|g' librecad/src/src.pro # 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 MUPARSER_DIR=/usr %{_qt4_qmake} -makefile librecad.pro "CONFIG+=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} -Dm 755 -s unix/%{name} %{buildroot}%{_bindir}/%{name} %{__install} -Dm 755 -s unix/ttf2lff %{buildroot}%{_bindir}/ttf2lff %{__install} -Dm 644 desktop/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop %{__install} -Dm 644 librecad/res/main/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png %{__install} -Dm 644 desktop/%{name}.sharedmimeinfo $RPM_BUILD_ROOT%{_datadir}/mime/packages/%{name}.xml %{__install} -Dm 644 desktop/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 %{__install} -Dm 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/ttf2lff.1 %{__install} -Dm 644 librecad/src/plugins/document_interface.h %{buildroot}%{_includedir}/%{name}/document_interface.h %{__install} -Dm 644 librecad/src/plugins/qc_plugininterface.h %{buildroot}%{_includedir}/%{name}/qc_plugininterface.h desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop %post /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %postun /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}/qm/ %{_datadir}/%{name}/patterns/ %{_datadir}/%{name}/doc/ %{_libdir}/%{name}/ %files devel %{_includedir}/%{name}/ %files fonts %doc LICENSE LICENSE_Apache2.txt LICENSE_GPLv3.txt %{_datadir}/%{name}/fonts/ %files parts %{_datadir}/%{name}/library/ %changelog * 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