Blob Blame Raw
Name:		qcad
Version:	2.0.5.0
Release:	12%{?dist}
Summary:	Simple 2D CAD program
Summary(fr):	Un simple programme de conception 2D assistée par ordinateur (CAO)

Group:		Applications/Engineering
License:	GPLv2
Source:		http://www.ribbonsoft.com/archives/qcad/qcad-2.0.5.0-1-community.src.tar.gz
Source1:	http://www.ribbonsoft.com/archives/qcad/qcad-manual-en-2.0.4.0-1.html.zip
Patch:		qcad-qass.patch
Patch1:		qcad-assistant.patch
Patch2:		qcad-manual-bugs.patch
Patch3:         qcad-64bit.patch
Patch4:         qcad-nopedantic.patch
Patch5:         qcad-arc.patch
Patch6:         qcad-gcc43.patch
Patch10:        %{name}-%{version}-latin2.patch
Patch11:        %{name}-%{version}.french-mispelling.patch

URL:		http://www.ribbonsoft.com/qcad.html
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	qt3-devel 
BuildRequires:  python-devel, desktop-file-utils
# Help viewer is Qt Assistant in qt-devel package.
#Requires:       /usr/bin/assistant
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils


%description
QCad is an application for computer aided drafting in two
dimensions. With QCad you can create technical drawings such as plans
for buildings, interiors or mechanical parts. QCad works under Linux,
Unix Systems, Mac OS X and Windows. The source code of QCad is
released under the GPL (Open Source).

%description -l fr
QCad est une application de conception assistée par ordinateur de dessin
en deux dimensions. Avec QCad, vous pouvez créer des dessins techniques
comme des plans architecturaux de construction ou d'intérieur, des pièces
mécaniques.


%prep
%setup -q -n %{name}-%{version}-1-community.src
%setup -q -T -D -a 1 -n %{name}-%{version}-1-community.src
%patch -p1
%patch1 -p1 -b .assistanterror
# no backup file here, so it doesn't get packaged
%patch2 -p0
%patch3 -p1 -b .64bit
%patch4 -p1 -b .nopedantic
%patch5 -p1 -b .arc
%patch6 -p1 -b .gcc43
%patch10 -p0 -b .latin2
%patch11 -p1 -b .french-mispelling


%build
[ -n "$QTDIR" ] || . %{_sysconfdir}/profile.d/qt.sh
(
   cd scripts
#   perl -pi -e "s|^export MAKE=.*|export MAKE=\'make CFLAGS=\"$RPM_OPT_FLAGS\" CXXFLAGS=\"$RPM_OPT_FLAGS\"\'|" build_qcad.sh
   ./build_qcad.sh
)
find -name '*.ts' -exec lrelease '{}' ';'
find -name '*.qm' -exec cp '{}' qcad/qm ';'


%install
rm -rf $RPM_BUILD_ROOT

%define pkgdatadir %{_datadir}/qcad
mkdir -p $RPM_BUILD_ROOT%{pkgdatadir}
mkdir -p $RPM_BUILD_ROOT%{pkgdatadir}/library
mkdir -p $RPM_BUILD_ROOT%{pkgdatadir}/doc

cp -fr qcad-manual-en-2.0.4.0-1.html/* $RPM_BUILD_ROOT%{pkgdatadir}/doc

cd qcad
cp -fr fonts $RPM_BUILD_ROOT%{pkgdatadir}
cp -fr patterns $RPM_BUILD_ROOT%{pkgdatadir}
cp -fr qm $RPM_BUILD_ROOT%{pkgdatadir}

mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp -f src/xpm/qcad.xpm $RPM_BUILD_ROOT%{_datadir}/pixmaps

mkdir -p $RPM_BUILD_ROOT%{_bindir}
cp -f qcad $RPM_BUILD_ROOT%{_bindir}

cat > qcad.desktop <<EOF
[Desktop Entry]
Name=QCad
GenericName=2D CAD drawing
GenericName[fr]=Conception 2D assistée par ordinateur
Comment=A simple 2D CAD program
Comment[fr]=Un simple programme de conception 2D assistée par ordinateur
Exec=qcad
Icon=qcad.xpm
Terminal=false
Type=Application
MimeType=image/vnd.dxf
Encoding=UTF-8
X-Desktop-File-Install-Version=0.4
StartupNotify=true
StartupWMClass=qcad
EOF

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora                     \
        --add-category X-Fedora                          \
        --add-category Application                       \
        --add-category Graphics                          \
        --dir $RPM_BUILD_ROOT%{_datadir}/applications 	 \
        qcad.desktop


%clean
rm -rf $RPM_BUILD_ROOT


%post
%{_bindir}/update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :


%postun
%{_bindir}/update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :


%files
%defattr(-,root,root,-)
%doc qcad/README qcad/data
%{_bindir}/*
%{_datadir}/qcad
%{_datadir}/applications/*
%{_datadir}/pixmaps/*


%changelog
* Sun Jul  4 2010 Alain Portal <alain.portal AT univ-montp2 DOT fr> - 2.0.5.0-12
- Patch to add some missing caracters to the latin1 charset
- Patch to to fix a french mispelling
- Frenchify desktop and spec files

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.5.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.5.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Sep  3 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.0.5.0-9
- fix license tag

* Fri Feb 22 2008 Gerard Milmeister <gemi@bluewin.ch> - 2.0.5.0-8
- patch to compile with GCC 4.3

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.0.5.0-7
- Autorebuild for GCC 4.3

* Wed Jan 23 2008 Gerard Milmeister <gemi@bluewin.ch> - 2.0.5.0-6
- added patch to add arc type tangential to menu

* Mon Aug 28 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.0.5.0-5
- Rebuild for FE6

* Fri Feb 17 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.0.5.0-4
- Rebuild for Fedora Extras 5

* Thu Nov 24 2005 Gerard Milmeister <gemi@bluewin.ch> - 2.0.5.0-3
- generate and include qm files

* Wed Nov 23 2005 Gerard Milmeister <gemi@bluewin.ch> - 2.0.5.0
- New Version 2.0.5.0

* Wed May 25 2005 Jeremy Katz <katzj@redhat.com> - 2.0.4.0-5.fc4
- fix build on 64bit arches (#158650)

* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 2.0.4.0-4.fc4
- rebuild on all arches

* Tue Apr  5 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 2.0.4.0-3.fc4
- Add missing line in qcad-assistant.patch which prevents orphans.

* Mon Feb 14 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 2.0.4.0-2
- Remove /usr/bin/assistant (-> qt-devel) dependency, replace with
  patches to open a warning dialog in case of Qt Assistant error
  conditions. Add a related patch for the English manual which
  removes references to two missing images.

* Sat Feb 12 2005 Gerard Milmeister <gemi@bluewin.ch> - 2.0.4.0-1
- Added documentation
- Fixed code for calling Qt Assistant: qcad-qass.patch

* Mon Nov 15 2004 Gerard Milmeister <gemi@bluewin.ch> - 2.0.4.0-0.fdr.2
- Added mime type to desktop file

* Fri Oct  1 2004 Gerard Milmeister <gemi@bluewin.ch> - 2.0.4.0-0.fdr.1
- New Version 2.0.4.0

* Sat Jun  5 2004 Gerard Milmeister <gemi@bluewin.ch> - 2.0.3.3-0.fdr.1
- New Version 2.0.3.3

* Sun Apr 25 2004 Gerard Milmeister <gemi@bluewin.ch> - 2.0.3.1-0.fdr.2
- Set QTDIR from qt.sh

* Sun Apr 11 2004 Gerard Milmeister <gemi@bluewin.ch> - 2.0.3.1-0.fdr.1
- New Version 2.0.3.1

* Sat Feb 28 2004 Gerard Milmeister <gemi@bluewin.ch> - 2.0.2.0-0.fdr.1
- New Version 2.0.2.0

* Fri Dec 12 2003 Gerard Milmeister <gemi@bluewin.ch> - 2.0.1.3-0.fdr.1
- New Version 2.0.1.3

* Wed Nov 26 2003 Gerard Milmeister <gemi@bluewin.ch> - 2.0.1.2-1.fdr.2
- Respect RPM_OPT_FLAGS

* Wed Nov 26 2003 Gerard Milmeister <gemi@bluewin.ch> - 2.0.1.2-0.fdr.1
- New Version 2.0.1.2

* Tue Oct 21 2003 Gerard Milmeister <gemi@bluewin.ch> - 2.0.1.1-1.fdr.1
- First Fedora release