Blob Blame History Raw
%define		rev	4413
%define		date	20070828

Name:		codeblocks
Version:	1.0
Release:	0.27.%{date}svn%{rev}%{?dist}
Summary:	An open source, cross platform, free C++ IDE
Group:		Development/Tools
License:	GPLv2+
URL:		http://www.codeblocks.org/
Source:		%{name}-svn%{rev}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	wxGTK-devel >= 2.6.0
BuildRequires:	zip
BuildRequires:	dos2unix
BuildRequires:	autoconf, automake, libtool
BuildRequires:	desktop-file-utils
Requires:	%{name}-libs = %{version}-%{release}
Requires:	shared-mime-info
Patch1:		codeblocks-plugins.patch
Patch2:		codeblocks-desktop.patch
Patch3:		codeblocks-autorev.patch
Patch100:	codeblocks-infopane.patch
Source100:	codeblocks-getsvn

%description
Code::Blocks is a free C++ IDE built specifically to meet the most demanding
needs of its users. It was designed, right from the start, to be extensible
and configurable. Built around a plugin framework, Code::Blocks can be
extended with plugin DLLs. It includes a plugin wizard, so you can compile
your own plugins.

%package libs
Summary:	Libraries needed to run Code::Blocks and its plugins
Group:		System Environment/Libraries

%description libs
Libraries needed to run Code::Blocks and its plugins.

%package devel
Summary:	Files needed to build Code::Blocks plugins
Group:		Development/Libraries
Requires:	%{name}-libs = %{version}-%{release}
Requires:	pkgconfig

%description devel
Development files needed to build Code::Blocks plugins.

%package contrib
Summary:	Additional Code::Blocks plugins
Group:		Development/Tools
Requires:	%{name} = %{version}-%{release}

%description contrib
Additional Code::Blocks plugins.


%define		pkgdatadir	%{_datadir}/%{name}
%define		pkglibdir	%{_libdir}/%{name}
%define		plugindir	%{pkglibdir}/plugins


%prep
%setup -q -n codeblocks
%patch1
%patch2 -p1
%patch3
%patch100


%build
find . -type f -and -not -name "*.cpp" -and -not -name "*.h" -and -not -name "*.png" -and -not -name "*.bmp" -and -not -name "*.c" -and -not -name "*.cxx" -and -not -name "*.ico" | sed "s/.*/\"\\0\"/" | xargs dos2unix &> /dev/null
chmod a+x bootstrap src/update

# fix the dir, where plugins are installed
for p in astyle autosave classwizard codecompletion compilergcc debuggergdb defaultmimehandler projectsimporter scriptedwizard todo xpmanifest
do
	sed -i 's|$(pkgdatadir)|@libdir@/@PACKAGE@|' src/plugins/$p/Makefile.am
done

for p in byogames cb_koders codesnippets codestat dragscroll envvars help_plugin keybinder lib_finder profiler regex_testbed source_exporter symtab wxSmith wxSmithContribItems
do
	sed -i 's|$(pkgdatadir)|@libdir@/@PACKAGE@|' src/plugins/contrib/$p/Makefile.am
done

sed -i 's|$(pkgdatadir)|@libdir@/@PACKAGE@|' src/plugins/contrib/wxSmith/plugin/Makefile.am

sed -i 's|@libdir@|%{_libdir}|' src/sdk/configmanager.cpp

# remove execute bits from source files
find src/plugins/contrib/regex_testbed -type f -exec chmod a-x {} ';'

# generate revision.m4
echo "m4_define([SVN_REV], %{rev})" > revision.m4
echo "m4_define([SVN_REVISION], 1.0svn%{rev})" >> revision.m4
echo "m4_define([SVN_DATE], %{date})" >> revision.m4

./bootstrap


%configure --with-contrib-plugins=all

# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install
  
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{plugindir}/*.la

rm -f $RPM_BUILD_ROOT%{_datadir}/applications/codeblocks.desktop
desktop-file-install --vendor fedora \
	--dir $RPM_BUILD_ROOT%{_datadir}/applications \
	--add-category X-Fedora \
	src/setup/mime/codeblocks.desktop


%clean
rm -rf $RPM_BUILD_ROOT


%post
update-mime-database /usr/share/mime &> /dev/null || :

%postun
update-mime-database /usr/share/mime &> /dev/null || :

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%post contrib -p /sbin/ldconfig

%postun contrib -p /sbin/ldconfig


%files
%defattr(-,root,root)
%doc README COPYING AUTHORS BUGS COMPILERS NEWS ChangeLog

%{_bindir}/*
%{_mandir}/man1/*.gz

%dir %{pkglibdir}
%dir %{plugindir}
%{plugindir}/libastyle.so
%{plugindir}/libautosave.so
%{plugindir}/libclasswizard.so
%{plugindir}/libcodecompletion.so
%{plugindir}/libcompiler.so
%{plugindir}/libdebugger.so
%{plugindir}/libdefaultmimehandler.so
%{plugindir}/libprojectsimporter.so
%{plugindir}/libscriptedwizard.so
%{plugindir}/libtodo.so

%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/gnome/48x48/mimetypes/*.png
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/pixmaps/%{name}.png

%dir %{pkgdatadir}
%{pkgdatadir}/icons
%dir %{pkgdatadir}/images
%{pkgdatadir}/images/*.png
%{pkgdatadir}/images/16x16
%{pkgdatadir}/images/codecompletion
%{pkgdatadir}/images/settings
%{pkgdatadir}/lexers
%{pkgdatadir}/scripts
%{pkgdatadir}/templates
%{pkgdatadir}/astyle.zip
%{pkgdatadir}/autosave.zip
%{pkgdatadir}/classwizard.zip
%{pkgdatadir}/codecompletion.zip
%{pkgdatadir}/compiler.zip
%{pkgdatadir}/debugger.zip
%{pkgdatadir}/defaultmimehandler.zip
%{pkgdatadir}/manager_resources.zip
%{pkgdatadir}/projectsimporter.zip
%{pkgdatadir}/resources.zip
%{pkgdatadir}/scriptedwizard.zip
%{pkgdatadir}/start_here.zip
%{pkgdatadir}/todo.zip
%{pkgdatadir}/tips.txt

%files libs
%defattr(-,root,root)
%{_libdir}/lib%{name}.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%files contrib
%defattr(-,root,root)
%{_libdir}/libwxsmithlib.so.*
%exclude %{_libdir}/libwxsmithlib.so

%{pkgdatadir}/byogames.zip
%{pkgdatadir}/cb_koders.zip
%{pkgdatadir}/codesnippets.zip
%{pkgdatadir}/codestat.zip
%{pkgdatadir}/dragscroll.zip
%{pkgdatadir}/envvars.zip
%{pkgdatadir}/exporter.zip
%{pkgdatadir}/help_plugin.zip
%{pkgdatadir}/keybinder.zip
%{pkgdatadir}/lib_finder.zip
%{pkgdatadir}/Profiler.zip
%{pkgdatadir}/RegExTestbed.zip
%{pkgdatadir}/SymTab.zip
%{pkgdatadir}/wxsmith.zip
%{pkgdatadir}/wxsmithcontribitems.zip
%{pkgdatadir}/images/codesnippets
%{pkgdatadir}/images/wxsmith

%{plugindir}/libbyogames.so
%{plugindir}/libcb_koders.so
%{plugindir}/libcodesnippets.so
%{plugindir}/libcodestat.so
%{plugindir}/libdragscroll.so
%{plugindir}/libenvvars.so
%{plugindir}/libexporter.so
%{plugindir}/libhelp_plugin.so
%{plugindir}/libkeybinder.so
%{plugindir}/liblib_finder.so
%{plugindir}/libProfiler.so
%{plugindir}/libRegExTestbed.so
%{plugindir}/libSymTab.so
%{plugindir}/libwxsmith.so
%{plugindir}/libwxsmithcontribitems.so


%changelog
* Wed Aug 29 2007 Dan Horak <dan[at]danny.cz> 1.0-0.27.20070828svn4413
- update to revision 4413
- update the License tag

* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 1.0-0.26.20070718svn4280
- Rebuild for selinux ppc32 issue (F8).

* Thu Jul 19 2007 Dan Horak <dan[at]danny.cz> 1.0-0.25.20070718svn4280
- update to revision 4280
- added missing ldconfig call for the contrib subpackage
- fix permissions for source files

* Sat Apr  7 2007 Dan Horak <dan[at]danny.cz> 1.0-0.24.20070406svn3816
- update to revision 3816

* Tue Feb 13 2007 Dan Horak <dan[at]danny.cz> 1.0-0.23.20070211svn3592
- update the autorev.patch

* Tue Feb 13 2007 Dan Horak <dan[at]danny.cz> 1.0-0.22.20070211svn3592
- update to revision 3592
- added patch for New Project wizard with wxGTK 2.8 (#225058)
- created -libs subpackage to make package multilib-aware (#228356)

* Fri Jan 26 2007 Dan Horak <dan[at]danny.cz> 1.0-0.21.20070125svn3540
- update the listbook.patch

* Fri Jan 26 2007 Dan Horak <dan[at]danny.cz> 1.0-0.20.20070125svn3540
- update to revision 3540

* Thu Jan 18 2007 Dan Horak <dan[at]danny.cz> 1.0-0.19.20070117svn3500
- update to revision 3500
- added patch for compiling with wxGTK 2.8

* Fri Dec  8 2006 Dan Horak <dan[at]danny.cz> 1.0-0.18.20061207svn3357
- update to revision 3357

* Thu Nov 30 2006 Dan Horak <dan[at]danny.cz> 1.0-0.17.20061130svn3315
- update to revision 3315

* Tue Nov 28 2006 Dan Horak <dan[at]danny.cz> 1.0-0.16.20061128svn3295
- update to revision 3295

* Sat Nov 25 2006 Dan Horak <dan[at]danny.cz> 1.0-0.15.20061125svn3268
- update to revision 3268
- fixes #217081

* Tue Nov 21 2006 Dan Horak <dan[at]danny.cz> 1.0-0.14.20061121svn3253
- update to revision 3253

* Fri Nov 10 2006 Dan Horak <dan[at]danny.cz> 1.0-0.13.20061110svn3202
- update to revision 3202
- fixed plugin loading on 64-bit platforms

* Fri Nov  3 2006 Dan Horak <dan[at]danny.cz> 1.0-0.12.20061102svn3170
- update to revision 3170

* Mon Oct 30 2006 Dan Horak <dan[at]danny.cz> 1.0-0.11.20061029svn3157
- update to revision 3157
- kill rpath in the spec file using sed
- fix directory ownership

* Sun Oct  8 2006 Dan Horak <dan[at]danny.cz> 1.0-0.10.20061007svn3030
- update to revision 3030
- change the install paths for plugins in the spec file

* Wed Sep 13 2006 Dan Horak <dan[at]danny.cz> 1.0-0.9.20060909svn2965
- do not require .svn directories for building

* Sun Sep 10 2006 Dan Horak <dan[at]danny.cz> 1.0-0.8.20060909svn2965
- update to revision 2965
- use %%configure macro
- properly install the desktop file
- update the mime database after install and uninstall
- do not own only %%{_libdir}/codeblock/plugins, but also %%{_libdir}/codeblock
- added a script for retrieving and packing a revision from the SVN repo

* Sun Sep  3 2006 Dan Horak <dan[at]danny.cz> 1.0-0.7.20060902svn2944
- update to revision 2944

* Sun Aug 20 2006 Dan Horak <dan[at]danny.cz> 1.0-0.6.20060820svn2882
- update to revision 2882
- added missing Requires for devel subpackage

* Wed Aug 16 2006 Dan Horak <dan[at]danny.cz> 1.0-0.5.20060815svn2854
- update to revision 2854

* Wed Aug 16 2006 Dan Horak <dan[at]danny.cz> 1.0-0.4.20060812svn2840
- make setup section quiet
- use only tabs for indentation

* Tue Aug 15 2006 Dan Horak <dan[at]danny.cz> 1.0-0.3.20060812svn2840
- define libdir in configure

* Sun Aug 13 2006 Dan Horak <dan[at]danny.cz> 1.0-0.2.20060812svn2840
- update to revision 2840
- added BR for autotools

* Tue Aug 08 2006 Dan Horak <dan[at]danny.cz> 1.0-0.1.2824svn
- initial spec file based on upstream