File qcad.spec of Package qcad

#
# spec file for package qcad (Version 2.0.5.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           qcad
Summary:        Free Open-source 2D CAD System
Url:            http://www.qcad.org/
License:        GPL v2 or later
Group:          Productivity/Graphics/CAD
AutoReqProv:    on
Version:        2.0.5.0
Release:        180
PreReq:         shared-mime-info
BuildRequires:  fdupes libdrm-devel qt3-devel-tools update-desktop-files
Source:         %{name}-%{version}-1.tar.bz2
Source1:        %{name}.desktop
Source2:        partlibrary-2.0.1.2-1.tar.bz2
Source3:        %{name}-manual-en-2.0.4.0-1.html.tar.bz2
Source4:        qcad.mime.desktop
Patch1:         qcad-qmake-pro.patch
Patch2:         %{name}-%{version}-64b.patch
Patch3:         release_translations_sh.patch
Patch4:         %{name}-%{version}-help.patch
Patch5:         %{name}-%{version}_missing-includes.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
QCad (community edition) is a free, open-source 2D CAD system for
Linux, various Unices, and Windows. The developers main goals are to
build a stable, fast, and easy to use CAD for everyone. You do not need
any knowledge of CAD programs to start working with QCad.



Authors:
--------
    Andrew Mustun <andrew@qcad.org>

%prep
%setup -q -n %{name}-%{version}-1
%patch1
%patch2
%patch3
%patch4
%patch5

%build
#/u/lib/qt3/bin/qmake
#make
export QTDIR=/usr/lib/qt3
export PATH=$QTDIR/bin:$PATH
cd scripts
sh ./build_qcad.sh

%install
# binary
install -Dm 755 qcad/qcad $RPM_BUILD_ROOT%{_bindir}/qcad
#
# data
install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/%{name}/
cp -a qcad/data      $RPM_BUILD_ROOT%{_datadir}/%{name}/
cp -a qcad/fonts     $RPM_BUILD_ROOT%{_datadir}/%{name}/
cp -a qcad/patterns  $RPM_BUILD_ROOT%{_datadir}/%{name}/
cp -a qcad/qm        $RPM_BUILD_ROOT%{_datadir}/%{name}/
#cp -a qcad/scripts   $RPM_BUILD_ROOT%{_datadir}/%{name}/
#
# documentation
install -m 755 -d $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}/
install -m 644 qcad/README $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}/
#
# desktop files
install -Dm 644 qcad/src/xpm/qcad.xpm $RPM_BUILD_ROOT%{_datadir}/pixmaps/qcad.xpm
install -Dm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/mime/image/dxf.desktop
%suse_update_desktop_file -i %name Engineering
%suse_update_desktop_file $RPM_BUILD_ROOT%{_datadir}/mime/image/dxf.desktop
#
# part library
cd $RPM_BUILD_ROOT%{_datadir}/%{name}/
tar xjvf %{S:2}
mv partlibrary-2.0.1.2-1 partlibrary
cd partlibrary
chmod 644 `find electrical/denzuq -name *.dxf`
chmod 755 `find mechanical -name tag_files_peter.sh`
#
# manual (English)
cd $RPM_BUILD_ROOT%{_datadir}/%{name}/
tar xjvf %{S:3}
mv %{name}-manual-en-2.0.4.0-1.html doc
%fdupes -s $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%post
if [ -x usr/bin/update-mime-database ]; then
    usr/bin/update-mime-database usr/share/mime >/dev/null
fi

%postun
if [ -x usr/bin/update-mime-database ]; then
    usr/bin/update-mime-database usr/share/mime >/dev/null
fi

%files
%defattr(-,root,root)
%doc %{_defaultdocdir}/%{name}/
%{_bindir}/qcad
%{_datadir}/applications/%name.desktop
%{_datadir}/pixmaps/qcad.xpm
%{_datadir}/mime/image/dxf.desktop
%{_datadir}/%{name}/

%changelog
* Tue Jun 03 2008 pgajdos@suse.cz
- /usr/lib/qt3/bin exported in PATH on first place [bnc#394305]
* Mon Apr 28 2008 lrupp@suse.de
- added desktop icon
- added mime information
- removed outdated qcad-assistantclient.patch
* Mon Oct 15 2007 pgajdos@suse.cz
- added missing includes
  * missing-includes.patch
- fdupes stuff
- repaired some executable permissions
* Mon Feb 26 2007 mvaner@suse.cz
- Fixing non-working help (#222885)
  - help.patch
* Wed Nov 22 2006 pnemec@suse.cz
- another fix for (#222860)
  menu bar translations are added now
* Wed Nov 22 2006 pnemec@suse.cz
- fixed bug (#222860)
  there is missing script in this release which build and install
  translation. Patch release_translations_sh.patch add original
  script back
- Require again qt3-devel-tools
* Fri Mar 10 2006 dmueller@suse.de
- remove Requires: qt3-devel-doc: assistant now in qt3
- remove BuildRequires: qt3-devel-doc: libassistantclient now in
  qt3-devel
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jan 20 2006 pnemec@suse.cz
- fixing errors on x64
* Tue Jan 17 2006 pnemec@suse.cz
- updated to 2.0.5.0
* Thu Sep 29 2005 dmueller@suse.de
- add norootforbuild
* Fri Sep 23 2005 pnemec@suse.cz
- building again after find was fixed
* Fri May 06 2005 yxu@suse.de
- fixed for GCC4
* Wed Jan 05 2005 ltinkl@suse.cz
- update to 2.0.4.0
- integrate the standalone HTML docu (#48843)
- fix usage of the manual viewer (assistantclient)
* Tue Aug 31 2004 ltinkl@suse.cz
- updated to 2.0.3.3
* Thu Apr 29 2004 ro@suse.de
- added missing return value
* Mon Mar 15 2004 adrian@suse.de
- fix build (libqassistant is in qt3-devel-doc now)
* Fri Feb 13 2004 ltinkl@suse.cz
- update to 2.0.2.0
* Fri Dec 05 2003 ltinkl@suse.cz
- update to 2.0.1.3
* Wed Nov 26 2003 ltinkl@suse.cz
- update to 2.0.1.2
* Thu Nov 13 2003 ltinkl@suse.cz
- update to 2.0.1.1
* Tue Oct 14 2003 ltinkl@suse.cz
- updated to version 2.0.1.0
- integrated the part library
* Wed Sep 03 2003 adrian@suse.de
- fix Categories
* Sat Aug 16 2003 adrian@suse.de
- added desktop file
* Tue Nov 19 2002 ro@suse.de
- use qmake instead of tmake
* Thu Nov 07 2002 pmladek@suse.cz
- changed to build with qt3
* Thu Oct 24 2002 pmladek@suse.cz
- updated to version 1.5.4:
  * support for up to 4096 characters in each font
  * Korean translation
  * Japanese cxf Font
  * Latin2 font
  * new parts in part library
  * new hatching patterns
  * new fonts
  * bugfixes
- removed obsolete patch
- used tmake to create Makefile
- used BuildRoot
- qcad binary moved to /usr/bin
- data files moved to /usr/share
- did not install unused cur and xpm directories
- installed part libraries
* Tue May 14 2002 pmladek@suse.de
- used macro %%{_lib} to fix for lib64
* Fri Nov 09 2001 ro@suse.de
- use qt-devel-packages in neededforbuild
* Fri Aug 17 2001 rvasice@suse.cz
- update to version 1.4.7
* Mon Jul 23 2001 rvasice@suse.cz
- fix to compile on axp, s390
* Thu May 10 2001 mfabian@suse.de
- bzip2 sources
* Wed Mar 07 2001 ro@suse.de
- changed neededforbuild <mesadev> to <mesa-devel>
* Thu Nov 30 2000 ro@suse.de
- neededforbuild += liblcms
* Fri Nov 17 2000 ro@suse.de
- fixed neededforbuild: += libmng-devel
* Mon Nov 06 2000 ro@suse.de
- fixed neededforbuild
* Mon Oct 16 2000 ro@suse.de
- added libmng to neededforbuild (qt)
* Thu Sep 21 2000 ro@suse.de
- added mesa-stuff not neededforbuild: qt needs it
* Wed Jun 07 2000 ro@suse.de
- fixed to compile
* Tue Jan 25 2000 ray@suse.de
- fix path to documetation
* Mon Jan 24 2000 ray@suse.de
- update to version 1.4.0
* Fri Oct 29 1999 ray@suse.de
- new package version 1.2.0
openSUSE Build Service is sponsored by