[librecad] 2.0.2

Tom Callaway spot at fedoraproject.org
Wed Jan 22 17:31:22 UTC 2014


commit b472731e738a5fa74657363d313719b27fbeb681
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Wed Jan 22 12:31:42 2014 -0500

    2.0.2

 .gitignore                         |    1 +
 librecad-desktop.patch             |    8 ++
 librecad-install.patch             |   23 ++++
 librecad-plugindir.patch           |   14 +++
 librecad-use-system-libdxfrw.patch |   31 ++++++
 librecad-use-system-shapelib.patch |   25 +++++
 librecad.spec                      |  196 ++++++++++++++++++++++++++++++++++++
 sources                            |    1 +
 ttf2lff.1                          |    8 ++
 9 files changed, 307 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..3a5b5f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/librecad-2.0.2.tar.gz
diff --git a/librecad-desktop.patch b/librecad-desktop.patch
new file mode 100644
index 0000000..952f6a8
--- /dev/null
+++ b/librecad-desktop.patch
@@ -0,0 +1,8 @@
+--- a/desktop/librecad.desktop	2011-05-19 17:24:55.000000000 +0200
++++ b/desktop/librecad.desktop	2011-05-20 16:24:56.000000000 +0200
+@@ -8,4 +8,4 @@
+ Exec=librecad %F
+ Icon=librecad
+ Categories=Graphics;Engineering;
+-MimeType=image/vnd.dxf
++MimeType=image/vnd.dxf;
diff --git a/librecad-install.patch b/librecad-install.patch
new file mode 100644
index 0000000..b42fb87
--- /dev/null
+++ b/librecad-install.patch
@@ -0,0 +1,23 @@
+diff -up LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro.install LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro
+--- LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro.install	2013-10-18 01:06:00.805457502 +0100
++++ LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro	2013-10-18 01:06:00.807457490 +0100
+@@ -57,7 +57,6 @@ unix {
+         DEFINES += QC_APPDIR="\"librecad\""
+         DEFINES += QINITIMAGES_LIBRECAD="qInitImages_librecad"
+         RC_FILE = ../res/main/librecad.icns
+-        QMAKE_POST_LINK = cd $$_PRO_FILE_PWD_/../.. && scripts/postprocess-unix.sh
+     }
+ }
+ win32 {
+diff -up LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/scripts/postprocess-unix.sh.install LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/scripts/postprocess-unix.sh
+--- LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/scripts/postprocess-unix.sh.install	2013-10-18 01:06:00.807457490 +0100
++++ LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/scripts/postprocess-unix.sh	2013-10-18 01:06:38.471238579 +0100
+@@ -3,7 +3,7 @@
+ THISDIR="`pwd`"
+ LCDIR="${THISDIR}/librecad"
+ PIDIR="${THISDIR}/plugins"
+-RESOURCEDIR="${THISDIR}/unix/resources"
++RESOURCEDIR=$BUILDDIR
+ TSDIRLC="${LCDIR}/ts"
+ TSDIRPI="${PIDIR}/ts"
+ SPTDIR="${LCDIR}/support"
diff --git a/librecad-plugindir.patch b/librecad-plugindir.patch
new file mode 100644
index 0000000..a7a7817
--- /dev/null
+++ b/librecad-plugindir.patch
@@ -0,0 +1,14 @@
+diff -U 3 -H -d -r -N -- a/src/lib/engine/rs_system.cpp b/src/lib/engine/rs_system.cpp
+--- a/librecad/src/lib/engine/rs_system.cpp	2011-08-14 07:28:00.000000000 +0200
++++ b/librecad/src/lib/engine/rs_system.cpp	2011-08-15 11:47:16.000000000 +0200
+@@ -530,6 +530,10 @@
+     }
+     RS_SETTINGS->endGroup();
+ 
++    if (subDirectory=="plugins") {
++        dirList.append("##LIBDIR##" + appDirName + "/" + subDirectory);
++    }
++
+     QStringList ret;
+ 
+     RS_DEBUG->print("RS_System::getDirectoryList: Paths:");
diff --git a/librecad-use-system-libdxfrw.patch b/librecad-use-system-libdxfrw.patch
new file mode 100644
index 0000000..33d6350
--- /dev/null
+++ b/librecad-use-system-libdxfrw.patch
@@ -0,0 +1,31 @@
+diff -up LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/libraries/libraries.pro.system LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/libraries/libraries.pro
+--- LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/libraries/libraries.pro.system	2013-08-31 02:29:18.000000000 +0100
++++ LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/libraries/libraries.pro	2013-10-18 01:04:14.278115312 +0100
+@@ -9,7 +9,6 @@ TEMPLATE = subdirs
+ TARGET = libraries
+ 
+ SUBDIRS     = \
+-        libdxfrw \
+         jwwlib
+ 
+ 
+diff -up LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro.system LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro
+--- LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro.system	2013-08-31 02:29:18.000000000 +0100
++++ LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/librecad/src/src.pro	2013-10-18 01:05:25.853666886 +0100
+@@ -36,7 +36,6 @@ greaterThan( QT_MAJOR_VERSION, 4 ) {
+     CONFIG += help 
+ } 
+ 
+-PRE_TARGETDEPS += ../../generated/lib/libdxfrw.a
+ PRE_TARGETDEPS += ../../generated/lib/libjwwlib.a
+ 
+ DESTDIR = $${INSTALLDIR}
+@@ -76,7 +75,7 @@ LIBS += -L../../generated/lib  \
+     -ljwwlib
+ 
+ DEPENDPATH += \
+-    ../../libraries/libdxfrw/src \
++    $${DXFRW_INCLUDEDIR} \
+     ../../libraries/jwwlib/src \
+     cmd \
+     lib/actions \
diff --git a/librecad-use-system-shapelib.patch b/librecad-use-system-shapelib.patch
new file mode 100644
index 0000000..4873da5
--- /dev/null
+++ b/librecad-use-system-shapelib.patch
@@ -0,0 +1,25 @@
+diff -up LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/plugins/importshp/importshp.pro.system-shapelib LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/plugins/importshp/importshp.pro
+--- LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/plugins/importshp/importshp.pro.system-shapelib	2013-10-20 15:55:36.155226720 +0100
++++ LibreCAD-f87828ec55def73aaa8c3c3e158fc1abc8171b63/plugins/importshp/importshp.pro	2013-10-20 15:56:09.815122555 +0100
+@@ -17,12 +17,9 @@ include(../../common.pri)
+ # For plugins
+ INCLUDEPATH    += ../../librecad/src/plugins
+ 
+-SOURCES += importshp.cpp \
+-           shapelib/shpopen.c \
+-           shapelib/safileio.c \
+-           shapelib/dbfopen.c
+-HEADERS += importshp.h \
+-           shapelib/shapefil.h
++SOURCES += importshp.cpp
++HEADERS += importshp.h
++LIBS += -lshp
+ 
+ win32 {
+         DLLDESTDIR = ../../windows/resources/plugins
+@@ -36,5 +33,3 @@ unix {
+ 	TARGET = ../../unix/resources/plugins/$$PLUGIN_NAME
+     }
+ }
+-
+-INCLUDEPATH    += shapelib
diff --git a/librecad.spec b/librecad.spec
new file mode 100644
index 0000000..a2d218b
--- /dev/null
+++ b/librecad.spec
@@ -0,0 +1,196 @@
+# 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.
+
+%global dxfrw_includedir %(pkg-config --cflags-only-I libdxfrw0 | sed 's|-I||g')
+# Matches 2.0.2 release tag
+%global commit 2241a8102d345f650502d12e3ab54e8387c2721a
+
+Name:			librecad
+Version:		2.0.2
+Release:		1%{?dist}
+Summary:		Computer Assisted Design (CAD) Application
+License:		GPLv2 and GPLv2+
+URL:			http://librecad.org/
+Source0:		https://github.com/LibreCAD/LibreCAD/archive/%{commit}/librecad-%{version}.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
+* Wed Jan 22 2014 Tom Callaway <spot at fedoraproject.org> - 2.0.2-1
+- update to 2.0.2
+
+* Sun Oct 20 2013 Tom Callaway <spot at fedoraproject.org> - 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 <spot at fedoraproject.org> - 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 <spot at fedoraproject.org> - 2.0.0-0.4.rc2
+- update to rc2
+
+* Tue Apr 30 2013 Tom Callaway <spot at fedoraproject.org> - 2.0.0-0.3.beta5
+- add BR: boost-devel
+- update to beta5
+
+* Tue Apr  9 2013 Tom Callaway <spot at fedoraproject.org> - 2.0.0-0.2.beta2
+- update to beta2
+
+* Sun Feb 24 2013 Tom Callaway <spot at fedoraproject.org> - 2.0.0-0.1.beta1
+- initial package
diff --git a/sources b/sources
index e69de29..8346724 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+4a7f85aa5c6cf454d78e67bd926712b9  librecad-2.0.2.tar.gz
diff --git a/ttf2lff.1 b/ttf2lff.1
new file mode 100644
index 0000000..b0bbbc9
--- /dev/null
+++ b/ttf2lff.1
@@ -0,0 +1,8 @@
+.TH TTF2LFF 1 "July 2012" "Debian GNU/Linux"
+.SH NAME
+ttf2lff \- ttf to lff converter.
+.SH DESCRIPTION
+ttf2lff is a font converter. It convert fonts in ttf format to lff format usseful
+to use with LibreCAD or another app that uses this format.
+
+ttf2lff invocation parameters are printed to the console if ttf2lff is called without parameters.


More information about the scm-commits mailing list