Blob Blame History Raw
# For svn
# svn checkout svn://svn.berlios.de/cairo-dock/trunk
# mkdir -p opt/cairo-dock
# mv trunk opt/cairo-dock
# tar cjf cairo-dock-sources-%%{tag}.tar.bz2 opt/

%define		tarballver	svn990_trunk
%define		mainver		1.5.5.4
%define		build_gecko	1


%define		fedora_rel	5


%if 0%{?fedora} >= 9
%define		gecko_ver	1.9
%endif
%if 0%{?fedora} == 8
%define		gecko_ver	1.8.1.14
%endif

Name:		cairo-dock
Version:	%{mainver}
Release:	%{fedora_rel}.%{tarballver}%{?dist}
Summary:	Light eye-candy fully themable animated dock

Group:		User Interface/Desktops
License:	GPLv3+
URL:		http://www.cairo-dock.org/
Source0:	http://download.berlios.de/cairo-dock/%{name}-sources-%{tarballver}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	automake
BuildRequires:	desktop-file-utils
BuildRequires:	gettext
BuildRequires:	intltool
BuildRequires:	libtool

# For main package
BuildRequires:	dbus-glib-devel
BuildRequires:	gtk2-devel
BuildRequires:	glitz-glx-devel
BuildRequires:	librsvg2-devel
BuildRequires:	libxml2-devel
BuildRequires:	libXtst-devel
BuildRequires:	perl(XML::Parser)

# For plug-ins
BuildRequires:	alsa-lib-devel
BuildRequires:	gnome-vfs2-devel
BuildRequires:	gnutls-devel
BuildRequires:	libgnomeui-devel
BuildRequires:	libXxf86vm-devel
BuildRequires:	vte-devel

# For plug-ins-xfce
BuildRequires:	Thunar-devel

# For plug-ins-gecko
%if %{build_gecko} > 0
BuildRequires:	gecko-devel %{?gecko_ver:= %{gecko_ver}}
%if 0%{?fedora} >= 9
BuildRequires:	gecko-devel-unstable
%endif
%endif

%description
An light eye-candy fully themable animated dock for any 
Linux desktop. It has a family-likeness with OSX dock,
but with more options.

%package	themes
Summary:	Additional themes for %{name}
Group:		User Interface/Desktops
Requires:	%{name} = %{version}-%{release}

%description	themes
This package contains a set of additional themes for %{name}.

%package	plug-ins
Summary:	Plug-ins files for %{name}
Group:		User Interface/Desktops
Requires:	%{name} = %{version}-%{release}
%if %{build_gecko} == 0
Obsoletes:	%{name}-plug-ins-gecko < 1.5.5.4-4
%endif

%description	plug-ins
This package contains plug-ins files for %{name}.

%package	plug-ins-xfce
Summary:	Plug-ins files for %{name} related to Xfce
Group:		User Interface/Desktops
Requires:	%{name} = %{version}-%{release}

%description	plug-ins-xfce
This package contains plug-ins files for %{name} related
to Xfce.

%package	plug-ins-gecko
Summary:	Plug-ins files for %{name} related to Gecko
Group:		User Interface/Desktops
Requires:	%{name} = %{version}-%{release}
Requires:	gecko-libs %{?gecko_ver:= %{gecko_ver}}

%description	plug-ins-gecko
This package contains plug-ins files for %{name} related
to Gecko.

%package	devel
Summary:	Development files for %{name}
Group:		Development/Libraries

Requires:	%{name} = %{version}-%{release}
Requires:	pkgconfig
Requires:	dbus-glib-devel
Requires:	gtk2-devel
Requires:	glitz-glx-devel
Requires:	librsvg2-devel
Requires:	libxml2-devel
Requires:	libXtst-devel

%description	devel
The %{name}-devel package contains libraries, build data, and header
files for developing applications that use %{name}.

%prep
%setup -q -c
find . -type d -name \.svn | sort -r | xargs %{__rm} -rf
find . -type d -name \*CVS | sort -r | xargs %{__rm} -rf

# A. main
pushd opt/cairo-dock/trunk/cairo-dock

# permission
for dir in */
	do
	find $dir -type f | xargs %{__chmod} 0644
done
%{__chmod} 0644 [A-Z]*

# Makefile issue
%{__sed} -i.debuglevel -e '/-O3/d' src/Makefile.am

autoreconf -i -f

# B. themes
cd ../themes
autoreconf -i -f

# C. plug-ins
cd ../plug-ins

#
# Note:
# * gnome-integration requires gio-2.0.pc, which are in F-9+ glib2-devel
# * weblets is gecko related, needs investigating
# * mail plug-ins is GPLv2 only, 
#   however source codes include "cairo-dock.h", which includes "cairo-dock-log.h",
#   which is GPLv3+, which makes license conflict.
#

# permission
%{__chmod} 0644 Applets.stable
find . -name \*.h -or -name \*.c | xargs %{__chmod} 0644

# gnome-integration: needs F-9+
%if 0%{?fedora} < 9
%{__rm} -rf gnome-integration/
%endif

# mail: license conflict
%{__rm} -rf mail/

# template: upstream says this is not needed
%{__rm} -rf template/

# weblets
%if %{build_gecko} > 0
%if 0%{?fedora} < 9
cd weblets/
%{__sed} -i.gecko \
	-e 's|mozilla-gtkmozembed|firefox-gtkmozembed|' \
	configure.ac
cd ..
%endif
%else
%{__rm} -rf weblets/
%endif

for dir in */
	do
	cd $dir
	%{__sed} -i.error \
		-e 's|-O3|-O2|' \
		-e 's|-Werror\\|\\|' \
		src/Makefile.am 
	autoreconf -i -f
	cd ..
done

popd # from opt/cairo-dock/trunk/cairo-dock

%build
status=0

# A. main
pushd opt/cairo-dock/trunk/cairo-dock

%configure
%{__make} %{?_smp_mflags} -k || status=$((status+1))

# For plug-ins & themes
export CFLAGS="%optflags -I$(pwd)/src"
export PKG_CONFIG_PATH=$(pwd):${PKG_CONFIG_PATH}

# B themes
cd ../themes

%configure
%{__make} %{?_smp_mflags} -k || status=$((status+1))

# C plug-ins
cd ../plug-ins
for dir in */
	do
	cd $dir

	%configure
	# Parallel make fails some times, but it is gerenally fast
	# so do parallel make anyway first
	%{__make} %{?_smp_mflags} -k || :
	%{__make} -k && echo "SUCCESS: $dir" || status=$((status+1))

	cd ..
	# "while read dir" does not save \$status value....
done

popd # from opt/cairo-dock/trunk/cairo-dock
if [ $status -gt 0 ] ; then exit 1 ; fi

%install
%{__rm} -rf $RPM_BUILD_ROOT
TOPDIR=$(pwd)

# A. main
pushd opt/cairo-dock/trunk/cairo-dock
export PKG_CONFIG_PATH=$(pwd):${PKG_CONFIG_PATH}

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT \
	INSTALL="%{__install} -p"
%{__chmod} 0755 $RPM_BUILD_ROOT%{_bindir}/*.sh

# desktop files
desktop-file-install \
	--dir $RPM_BUILD_ROOT%{_datadir}/applications \
	--vendor fedora \
	data/%{name}.desktop

# documents
%{__rm} -rf $TOPDIR/documents/main
%{__mkdir} -p $TOPDIR/documents/main
for f in \
	LICENSE \
	data/ChangeLog.txt \
	doc/HOW-TO__applets.txt \
	doc/dox.config
	do
	%{__cp} -pr $f $TOPDIR/documents/main/
done

%find_lang %{name}
%{__mv} -f %{name}.lang $TOPDIR

# B. themes
cd ../themes
%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT \
	INSTALL="%{__install} -p"

# clean up
pushd $RPM_BUILD_ROOT%{_datadir}/%{name}/themes
# no...
%{__rm} -rf ./_Ubuntu_/
popd # from $RPM_BUILD_ROOT

# C plug-ins
%{__rm} -rf $TOPDIR/{lang-plug-ins,lang-gecko}
%{__mkdir} -p $TOPDIR/{lang-plug-ins,lang-gecko}

cd ../plug-ins
for dir in */
	do
	cd $dir
	%{__make} install \
		DESTDIR=$RPM_BUILD_ROOT \
		INSTALL="%{__install} -p"

	# read GETTEXT_PACKAGE
	if [ ! -r po/Makefile.in ] ; then
		cd ..
		continue
	fi

	GETTEXT_MO_PACKAGES=`sed -n -e 's|^GETTEXT_PACKAGE = ||p' po/Makefile.in`
	case $GETTEXT_MO_PACKAGES in
		*weblet* )
			%find_lang $GETTEXT_MO_PACKAGES && \
				%{__mv} -f ${GETTEXT_MO_PACKAGES}.lang \
				$TOPDIR/lang-gecko/
				;;
		* )
			%find_lang $GETTEXT_MO_PACKAGES && \
				%{__mv} -f ${GETTEXT_MO_PACKAGES}.lang \
				$TOPDIR/lang-plug-ins/
				;;
	esac
	cd ..
done

# documents
%{__cp} -p Applets.stable $TOPDIR/documents/main/

# lang files
cat $TOPDIR/lang-plug-ins/*.lang > $TOPDIR/lang-plug-ins.lang
%if %{build_gecko} > 0
cat $TOPDIR/lang-gecko/*.lang > $TOPDIR/lang-gecko.lang
%endif

popd # from opt/cairo-dock/trunk/cairo-dock

# final clean up
# remove all unneeded files
pushd $RPM_BUILD_ROOT
%{__rm} -f ./%{_datadir}/%{name}/{ChangeLog.txt,License}
find .%{_libdir}/%{name} -name \*.la | xargs %{__rm} -f

# just to suppress rpmlint...
for f in \
	`find ./%{_datadir}/%{name} -name \*.desktop` \
	`find . -name \*.conf`
	do
	echo > $f.tmp
	cat $f >> $f.tmp
	touch -r $f $f.tmp
	%{__mv} -f $f.tmp $f
done

set +x
for f in .%{_libdir}/%{name}/*/*
	do
	if head -n 1 $f 2>/dev/null | grep -q /bin/ ; then 
		set -x
		%{__chmod} 0755 $f
		set +x
	fi
done
set -x

popd # from $RPM_BUILD_ROOT

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc	documents/main/*

%{_bindir}/*%{name}*
%{_datadir}/applications/fedora-%{name}.desktop

%dir	%{_datadir}/%{name}/
%{_datadir}/%{name}/*.conf
%{_datadir}/%{name}/*.png
%{_datadir}/%{name}/*.svg
%{_datadir}/%{name}/*view
%{_datadir}/%{name}/gauges/
%dir	%{_datadir}/%{name}/themes/
%{_datadir}/%{name}/themes/_default_/
# only directory
%dir	%{_libdir}/%{name}/

%files	themes
%defattr(-,root,root,-)
%{_datadir}/%{name}/themes/_[A-Z]*/

%files	plug-ins -f lang-plug-ins.lang
%defattr(-,root,root,-)
%{_libdir}/%{name}/*
%if %{build_gecko}
%exclude	%{_libdir}/%{name}/*weblet*
%endif
%exclude	%{_libdir}/%{name}/*xfce*

%files	plug-ins-xfce
%defattr(-,root,root,-)
%{_libdir}/%{name}/*xfce*

%if %{build_gecko} > 0
%files	plug-ins-gecko -f lang-gecko.lang
%defattr(-,root,root,-)
%{_libdir}/%{name}/*weblet*
%endif

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

%changelog
* Sat May 17 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.5.4-5.svn990_trunk
- Update to svn 990
- 2 issues fixed in upstream
  * plug-in directory moved to %%_libdir/%%name
  * %%name.pc fixed

* Sat May 17 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.5.4-4.date20080506
- F-10: don't build weblets plugin until xulrunner BR dependency is solved

* Sat May 17 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.5.4-3.date20080506
- Misc cleanup
- Remove template, upstream says this is not needed

* Sun May 11 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.5.4-2.date20080506
- Remove mail plug-in for now as there is license conflict
- Enable weblet plug-in

* Fri May  9 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.5.4-1.date20080506
- 1.5.5.4

* Thu May  1 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.5.5.3-1.date20080501
- Initial packaging
- remove Ubuntu related themes
- plugin dir is moved to %%_libdir/%%name/plug-in