Blob Blame Raw
Name:		qcad
Version:	2.0.5.0
Release:	5%{?dist}
Summary:	Simple 2D CAD program

Group:		Applications/Engineering
License:	GPL
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
URL:		http://www.ribbonsoft.com/qcad.html
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	qt-devel >= 3.1.2, 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).


%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


%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
Comment=A simple 2D CAD program
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
* 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