5705a9c
%global _QCAD_DIR %{_libdir}/%{name}
7e0b93e
%global _QT_PLUGINS %{_qt5_plugindir}
5705a9c
Antonio Trande dfa574e
# Filter private libraries
Antonio Trande dfa574e
%global __provides_exclude ^(%%(find %{buildroot}%{_libdir}/qcad -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -))
Antonio Trande dfa574e
%global __requires_exclude ^(%%(find %{buildroot}%{_libdir}/qcad -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -))
Antonio Trande dfa574e
#
Antonio Trande dfa574e
5705a9c
Name:    qcad
ae6a18f
Version: 3.28.1.0
ae6a18f
Release: %autorelease
5705a9c
Summary: Powerful 2D CAD system
5705a9c
5705a9c
## Main license: GPLv3
5705a9c
##
5705a9c
## 3rd parties licenses: 
5705a9c
## dxflib: GPLv2+.
5705a9c
#  See src/3rdparty/dxflib/gpl-2.0greater.txt
5705a9c
## opennurbs: Public domain (neither copyright nor copyleft apply).
5705a9c
#  See src/3rdparty/opennurbs/readme.txt
5705a9c
## spatialindexnavel:  MIT
5705a9c
#  See src/3rdparty/spatialindexnavel/COPYING
5705a9c
## stemmer: BSD 2-Clause License
5705a9c
#  See src/3rdparty/stemmer/bsd-2.txt
5705a9c
## Hershey fonts are released under the terms described in fonts/hershey.readme.
5705a9c
## Other fonts in directory 'fonts' are released as public domain (all copyright
8040cbe
## is waived) and BSD (3-clauses).
5705a9c
ac393cc
License: GPL-3.0-only and GPL-2.0-or-later and MIT and BSD and Public Domain and CC-BY-3.0 and Hershey
90286cf
Source0: https://github.com/qcad/qcad/archive/v%{version}/%{name}-%{version}.tar.gz
5705a9c
Source1: %{name}.desktop
5705a9c
Source2: %{name}.appdata.xml
887b431
URL: https://www.qcad.org/
5705a9c
c9ab2a9
BuildRequires: qt5-qtbase-devel >= 5.9.0
c9ab2a9
BuildRequires: qt5-rpm-macros >= 5.9.0
c9ab2a9
BuildRequires: qt5-qtwebkit-devel >= 5.9.0
c9ab2a9
BuildRequires: qt5-qttools-devel >= 5.9.0
c9ab2a9
BuildRequires: qt5-qttools-static >= 5.9.0
c9ab2a9
BuildRequires: qt5-qtscript-devel >= 5.9.0
c9ab2a9
BuildRequires: qt5-qtsvg-devel >= 5.9.0
c9ab2a9
BuildRequires: qt5-qtxmlpatterns-devel >= 5.9.0
c9ab2a9
Requires: qt5-designer >= 5.9.0
ff5bf60
Requires: qt5-qtsvg
c9ab2a9
Provides: bundled(qtscriptgenerator) = 5.9.0
ff5bf60
BuildRequires: gcc-c++, chrpath
5705a9c
BuildRequires: libX11-devel
5705a9c
BuildRequires: libXext-devel
5705a9c
BuildRequires: libXrender-devel
5705a9c
BuildRequires: libSM-devel
5705a9c
BuildRequires: freetype-devel
5705a9c
BuildRequires: fontconfig-devel
98b7019
BuildRequires: make
5705a9c
BuildRequires: openssl-devel
5705a9c
BuildRequires: dbus-devel
5705a9c
BuildRequires: mesa-libGLU-devel
887b431
#BuildRequires: spatialindex-devel
5705a9c
BuildRequires: desktop-file-utils
5705a9c
BuildRequires: libappstream-glib
8040cbe
BuildRequires: fontpackages-devel
5705a9c
5705a9c
Requires: hicolor-icon-theme
5705a9c
Requires: wise2
318ba07
Requires: qgnomeplatform-qt5
8040cbe
Requires: vlgothic-fonts
8040cbe
Requires: dejavu-sans-fonts
5705a9c
5705a9c
Provides: bundled(dxflib) = 1.0.0
5705a9c
Provides: bundled(opennurbs) = 201004095
5705a9c
Provides: bundled(stemmer) = 1.0.0
5705a9c
42ceccd
## Unbundle spatialindex libraries
cba8852
Patch0: %{name}-qt5-unbundle_libraries.patch
7e0b93e
5705a9c
%description
5705a9c
QCAD is an application for computer aided drafting (CAD) in two dimensions (2D).
5705a9c
With QCAD you can create technical drawings such as plans for buildings,
5705a9c
interiors, mechanical parts or schematics and diagrams.
5705a9c
QCAD was designed with modularity, extensibility and portability in mind.
5705a9c
But what people notice most often about QCAD is its intuitive
5705a9c
user interface.
5705a9c
QCAD is an easy to use but powerful 2D CAD system for everyone.
98b7019
You dont need any CAD experience to get started with QCAD immediately.
5705a9c
5705a9c
%prep
cba8852
%autosetup -n %{name}-%{version} -p0
7e0b93e
63457ce
# Use Fedora Qt5 scripts
63457ce
cp -a src/3rdparty/qt-labs-qtscriptgenerator-5.15.3 src/3rdparty/qt-labs-qtscriptgenerator-5.15.8
63457ce
mv src/3rdparty/qt-labs-qtscriptgenerator-5.15.8/qt-labs-qtscriptgenerator-5.15.3.pro \
63457ce
 src/3rdparty/qt-labs-qtscriptgenerator-5.15.8/qt-labs-qtscriptgenerator-5.15.8.pro
63457ce
5705a9c
%build
8adf559
# QT is known not to work properly with LTO at this point.  Some of the issues
8adf559
# are being worked on upstream and disabling LTO should be re-evaluated as
8adf559
# we update this change.  Until such time...
8adf559
# Disable LTO
8adf559
%define _lto_cflags %{nil}
8adf559
bfa0396
%{_qt5_qmake} -makefile CONFIG+=release %{name}.pro \
42ceccd
 QMAKE_CFLAGS_RELEASE+="%{_qt5_optflags} %(pkg-config --cflags Qt5UiTools) -I$PWD/src/3rdparty/spatialindexnavel/include" \
42ceccd
 QMAKE_CXXFLAGS_RELEASE+="%{_qt5_optflags} %(pkg-config --cflags Qt5UiTools) -I$PWD/src/3rdparty/spatialindexnavel/include" \
400b457
 QMAKE_LFLAGS+="%{_qt5_ldflags} -Wl,-rpath -Wl,%{_QCAD_DIR}" \
400b457
 LFLAGS+="%{_qt5_ldflags} -Wl,-rpath -Wl,%{_QCAD_DIR}"
cba8852
%make_build
5705a9c
5705a9c
%install
5705a9c
5705a9c
mkdir -p %{buildroot}%{_QCAD_DIR}/ts
5705a9c
mkdir -p %{buildroot}%{_datadir}/pixmaps
5705a9c
mkdir -p %{buildroot}%{_bindir}
5705a9c
mkdir -p %{buildroot}%{_mandir}/man1
5705a9c
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
5705a9c
mkdir -p %{buildroot}%{_QT_PLUGINS}/codecs
5705a9c
mkdir -p %{buildroot}%{_QT_PLUGINS}/script
5705a9c
mkdir -p %{buildroot}%{_QT_PLUGINS}/designer
5705a9c
mkdir -p %{buildroot}%{_QT_PLUGINS}/imageformats
5705a9c
mkdir -p %{buildroot}%{_QT_PLUGINS}/sqldrivers
5705a9c
mkdir -p %{buildroot}%{_QCAD_DIR}/plugins/codecs
5705a9c
mkdir -p %{buildroot}%{_QCAD_DIR}/plugins/designer
5705a9c
mkdir -p %{buildroot}%{_QCAD_DIR}/plugins/imageformats
5705a9c
mkdir -p %{buildroot}%{_QCAD_DIR}/plugins/sqldrivers
5705a9c
mkdir -p %{buildroot}%{_QCAD_DIR}/plugins/script
da5620c
mkdir -p %{buildroot}%{_QCAD_DIR}/plugins/printsupport
5705a9c
8040cbe
## Install fonts
5705a9c
cp -a fonts %{buildroot}%{_QCAD_DIR}
8040cbe
8040cbe
# Unbundle vlgothic-fonts
3e5cd96
ln -sf %{_fontbasedir}/vlgothic/VL-Gothic-Regular.ttf %{buildroot}%{_QCAD_DIR}/fonts/VL-Gothic-Regular.ttf
8040cbe
8040cbe
# Unbundle dejavu-sans-fonts
8040cbe
for i in `ls %{buildroot}%{_QCAD_DIR}/fonts/qt | grep DejaVuSans`; do
3e5cd96
 ln -sf %{_fontbasedir}/dejavu/$i %{buildroot}%{_QCAD_DIR}/fonts/qt/$i
8040cbe
done
8040cbe
##
8040cbe
5705a9c
cp -a patterns %{buildroot}%{_QCAD_DIR}
5705a9c
cp -a themes %{buildroot}%{_QCAD_DIR}
5705a9c
cp -a libraries %{buildroot}%{_QCAD_DIR}
5705a9c
cp -a scripts %{buildroot}%{_QCAD_DIR}
5705a9c
cp -a plugins %{buildroot}%{_QCAD_DIR}
7e0b93e
cp -a linetypes %{buildroot}%{_QCAD_DIR}
5705a9c
eeea153
# This file is required for Help's "Show Readme" menu choice
eeea153
cp -p readme.txt %{buildroot}%{_QCAD_DIR}
eeea153
5705a9c
install -pm 644 ts/qcad*.qm %{buildroot}%{_QCAD_DIR}/ts
5705a9c
ln -sf %{_QT_PLUGINS}/codecs/libqcncodecs.so %{buildroot}%{_QCAD_DIR}/plugins/codecs/libqcncodecs.so
5705a9c
ln -sf %{_QT_PLUGINS}/codecs/libqjpcodecs.so %{buildroot}%{_QCAD_DIR}/plugins/codecs/libqjpcodecs.so
5705a9c
ln -sf %{_QT_PLUGINS}/codecs/libqkrcodecs.so %{buildroot}%{_QCAD_DIR}/plugins/codecs/libqkrcodecs.so
5705a9c
ln -sf %{_QT_PLUGINS}/codecs/libqtwcodecs.so %{buildroot}%{_QCAD_DIR}/plugins/codecs/libqtwcodecs.so
5705a9c
5705a9c
ln -sf %{_QT_PLUGINS}/designer/libqwebview.so %{buildroot}%{_QCAD_DIR}/plugins/designer/libqwebview.so
5705a9c
5705a9c
ln -sf %{_QT_PLUGINS}/imageformats/libqgif.so %{buildroot}%{_QCAD_DIR}/plugins/imageformats/libqgif.so
5705a9c
ln -sf %{_QT_PLUGINS}/imageformats/libqico.so %{buildroot}%{_QCAD_DIR}/plugins/imageformats/libqico.so
5705a9c
ln -sf %{_QT_PLUGINS}/imageformats/libqjpeg.so %{buildroot}%{_QCAD_DIR}/plugins/imageformats/libqjpeg.so
5705a9c
ln -sf %{_QT_PLUGINS}/imageformats/libqsvg.so %{buildroot}%{_QCAD_DIR}/plugins/imageformats/libqsvg.so
5705a9c
ln -sf %{_QT_PLUGINS}/imageformats/libqtga.so %{buildroot}%{_QCAD_DIR}/plugins/imageformats/libqtga.so
5705a9c
ln -sf %{_QT_PLUGINS}/imageformats/libqtiff.so %{buildroot}%{_QCAD_DIR}/plugins/imageformats/libqtiff.so
5705a9c
5705a9c
ln -sf %{_QT_PLUGINS}/sqldrivers/libqsqlite.so %{buildroot}%{_QCAD_DIR}/plugins/sqldrivers/libqsqlite.so
da5620c
ln -sf %{_QT_PLUGINS}/printsupport/libcupsprintersupport.so %{buildroot}%{_QCAD_DIR}/plugins/printsupport/libcupsprintersupport.so
da5620c
5705a9c
install -pm 644 scripts/qcad_icon.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
5705a9c
install -pm 755 release/*.so %{buildroot}%{_QCAD_DIR}
5705a9c
install -pm 755 release/%{name}-bin %{buildroot}%{_QCAD_DIR}
5705a9c
install -pm 644 readme.txt %{buildroot}%{_QCAD_DIR}
5705a9c
5705a9c
install -pm 644 qcad.1 %{buildroot}%{_mandir}/man1
5705a9c
install -pm 644 scripts/%{name}_icon.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
5705a9c
5705a9c
find %{buildroot}%{_QCAD_DIR} -name ".gitignore" -delete
5705a9c
find %{buildroot}%{_QCAD_DIR} -name "readme.txt" -delete
5705a9c
find %{buildroot}%{_QCAD_DIR} -name "Makefile" -delete
5705a9c
5705a9c
pushd %{buildroot}%{_QCAD_DIR}
8040cbe
for i in `find . -type f \( -name "*.so*" -o -name "qcad-bin" \)`; do
5705a9c
  chmod -c 755 $i
400b457
  chrpath -r %{_QCAD_DIR} $i
5705a9c
done
5705a9c
popd
5705a9c
7e0b93e
cat > %{buildroot}%{_bindir}/%{name} <
7e0b93e
#!/bin/sh
7e0b93e
export \
ff5bf60
LD_LIBRARY_PATH=%{_QCAD_DIR}:%{_QCAD_DIR}/plugins/script \
7e0b93e
QTLIB=%{_qt5_libdir} \
7e0b93e
QTDIR=%{_qt5_libdir} \
7e0b93e
QTINC=%{_qt5_headerdir} \
7e0b93e
WISECONFIGDIR=%{_datadir}/wise2 \
b36d726
QT_QPA_PLATFORM=xcb \
ff5bf60
PATH=%{_libdir}:%{_QCAD_DIR}
7e0b93e
%{_QCAD_DIR}/%{name}-bin "\$@"
7e0b93e
EOF
5705a9c
chmod a+x %{buildroot}%{_bindir}/%{name}
5705a9c
5705a9c
mkdir -p %{buildroot}%{_datadir}/applications
5705a9c
desktop-file-install        \
5705a9c
 --add-category Graphics    \
5705a9c
 --add-category Engineering \
5705a9c
 --dir %{buildroot}%{_datadir}/applications %{SOURCE1}
5705a9c
5e780d7
mkdir -p %{buildroot}%{_metainfodir}
5e780d7
install -pm 644 %{SOURCE2} %{buildroot}%{_metainfodir}/
5e780d7
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
5705a9c
5705a9c
%files
ac393cc
%doc README.md readme.txt
8040cbe
%license LICENSE.txt gpl-3.0.txt gpl-3.0-exceptions.txt cc-by-3.0.txt fonts/hershey.readme
cba8852
%license fonts/README.sazanami fonts/LICENSE_E.mplus fonts/osifont_license.txt
5705a9c
%license src/3rdparty/dxflib/gpl-2.0greater.txt
5705a9c
%license src/3rdparty/spatialindexnavel/COPYING
5705a9c
%license src/3rdparty/stemmer/bsd-2.txt
5705a9c
%license src/3rdparty/opennurbs/readme.txt
5705a9c
%{_bindir}/%{name}
5705a9c
%{_QCAD_DIR}/
5705a9c
%{_datadir}/applications/%{name}.desktop
5e780d7
%{_metainfodir}/%{name}.appdata.xml
5705a9c
%{_datadir}/pixmaps/%{name}.png
5705a9c
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
5705a9c
%{_mandir}/man1/*
5705a9c
5705a9c
%changelog
ae6a18f
%autochangelog