%define cvsdate 20060307

Summary: GNOME CUPS printer management tool
Summary(ja): GNOME CUPS プリンタ管理ツール
Name: gnome-cups-manager
Version: 0.31.0.%{cvsdate}
Release: 1%{?_dist_release}
License: GPL
Group: Applications/System
URL: http://www.ximian.com
Source0: ftp://ftp.gnome.org/pub/GNOME/sources/%{name}/%{version}/%{name}-%{version}.tar.bz2
Source11: %{name}.desktop
Source100: vine-testpage-a4.eps
Patch10: %{name}-0.31cvs-gksu.patch
Patch11: %{name}-0.30-vine.patch
Patch12: %{name}-0.31cvs-gksu-quote-args.patch

Patch20: gnome-cups-manager-0.31.0-add-printer.patch
Patch21: gnome-cups-manager-0.31.0-gnome-cups-icon.patch
Patch22: gnome-cups-manager-0.31.0-gnome-cups-manager.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: libgnomeui-devel
BuildRequires: libglade2-devel
BuildRequires: libgnomecups-devel
BuildRequires: samba-libsmbclient-devel
Requires: libgnomecups, libgnomeui, libglade2, hicolor-icon-theme, cups
Requires: gksu
#Requires: pam, usermode, usermode-gtk
Obsoletes: printman
Provides: printman

%description
gnome-cups-manager is CUPS printer management tool for GNOME environment.

%description -l ja
gnonme-cups-manager は GNOME 用 CUPS プリンタ管理ツールです。


%package devel
Summary: Development files for GNOME-CUPS library
Summary(ja): GNOME-CUPS 統合ライブラリ用開発ファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Provides: libgnomecupsui-devel = %{version}-%{release}

%description devel
Development files for GNOME-CUPS library


%prep
%setup -q
%patch10 -p1 -b .gksu
%patch11 -p1 -b .vine
%patch12 -p1 -b .gksu-quote-args
%patch20 -p1 -b .add-printer
%patch21 -p1 -b .gnome-cups-icon
%patch22 -p1 -b .gnome-cups-manager

# copy vine-testpage-a4
cp -f %{SOURCE100} gnome-cups-manager/xd2-testpage-a4.eps

sed -i -e 's/GNOME_COMPILE_WARNINGS(maximum)//g' configure.in

%build
intltoolize -f -c
autoreconf
%configure
%__make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall

# remove unpackaged files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%find_lang %{name}

desktop-file-install --vendor=gnome             \
  --dir %{buildroot}%{_datadir}/applications    \
  --add-category Application                    \
  --add-category System                         \
  %{SOURCE11}


%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README ChangeLog NEWS
%{_bindir}/*
%{_sbindir}/*
%{_datadir}/gnome-cups-manager
%{_datadir}/icons/hicolor/48x48/devices/*
%{_datadir}/icons/hicolor/48x48/stock/*
%{_datadir}/pixmaps/*
%{_datadir}/applications/*.desktop
%{_libdir}/*.so.*
%{_libdir}/bonobo/servers/*
#%{_sysconfdir}/security/console.apps/*
#%{_sysconfdir}/pam.d/*

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


%changelog
* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 0.31.0.20060307-1vl5
- applied new versioning policy, spec in utf-8

* Tue Aug 28 2007 Shu KONNO <owa@bg.wakwak.com> 0.31.0.20060307-0vl5
- add BuildRequires: samba-libsmbclient-devel
- add Patch20: gnome-cups-manager-0.31.0-add-printer.patch
- add Patch21: gnome-cups-manager-0.31.0-gnome-cups-icon.patch
- add Patch22: gnome-cups-manager-0.31.0-gnome-cups-manager.patch

* Wed May 16 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.31.0.20060307-0vl4
- add Patch12 to fix <BTS:373> 

* Mon May 14 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.31.0.20060307-0vl3
- rebuild with new environment/toolchain

* Sat Mar 11 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.31.0.20060307-0vl2
- fix broken testpage

* Tue Mar 07 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.31.0.20060307-0vl1
- update to cvs snapshot
- add vine-testpage-a4.eps

* Sun Mar 27 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 0.30-0vl1
- new upstream release

* Tue Aug 10 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.22-0vl2
- update Patch11 to use gksu instead of gnomesu (to remove printer)

* Tue Aug 10 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.22-0vl1
- new upstream release

* Sun Aug 01 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.19-0vl1
- new upstream release
- update ja.po
- add Patch11 to not use gnomesu
- use consolehelper for gnome-cups-add
- add Requires to usermode and usermode-gtk
- add Reuiqres to hicolor-icon-theme

* Sun Jul 18 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.18-0vl2
- copy hicolor icons to gnome2.4 default icon directory

* Mon Jun 21 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.18-0vl1
- new upstream release

* Sun Nov 09 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 0.17-0vl3
- update ja.po
- add desktop-files

* Sun Nov 09 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 0.17-0vl2
- update Patch10 to add missing entry to POTFILES
- update ja.po

* Sun Nov 09 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 0.17-0vl1
- Initial build for Vine Linux
