Blob Blame History Raw
%global nbmversion 1.8
%global geditver 0.4

Name: beesu
Version: 2.7
# Don't ever decrease this version (unless all beesu, nbm, and gbp update) or the subpackages will go backwards.
# It is easier to do this than to track a separate release field.
Release: 26%{?dist}
Summary: Graphical wrapper for su
URL: http://www.honeybeenet.altervista.org
Group: Applications/System
License: GPLv2+
Source0: http://honeybeenet.altervista.org/beesu/files/beesu-sources/%{name}-%{version}.tar.bz2
Source1: http://honeybeenet.altervista.org/beesu/files/beesu-manager/nautilus-beesu-manager-%{nbmversion}.tar.bz2
Source2: http://honeybeenet.altervista.org/beesu/files/beesu-gedit/gedit-beesu-plugin-%{geditver}.tar.bz2
Source3: nemo-beesu-manager-%{nbmversion}.tar.bz2
Source4: caja-beesu-manager-%{nbmversion}.tar.bz2
Source5: pluma-beesu-plugin-%{geditver}.tar.bz2
Patch0:  beesu-gedit-plugin-fix.patch
Patch1:  beesu-gedit-plugin-more-fixes.patch
Patch2:  beesu-nautilus-scripts-fixes.patch
Patch3:  beesu-nemo-scripts-fixes.patch
Patch5:  caja-beesu-manager-pluma-fix.patch
Patch6:  beesu-2.7-pluma-fix.patch
Patch7:  beesu-2.7-gedit-fix.patch
BuildRequires: desktop-file-utils
Requires: pam, usermode, usermode-gtk

%description
Beesu is a wrapper around su and works with consolehelper under
Fedora to let you have a graphic interface like gksu.

%package -n nautilus-beesu-manager
Version:	%{nbmversion}
BuildArch:	noarch
Requires:	beesu, zenity, nautilus
Group:		User Interface/Desktops
Summary:	Utility to add beesu scripts to nautilus

%description -n nautilus-beesu-manager
nautilus-beesu-manager is a little utility to add some useful scripts
to the Nautilus file browser; nautilus-beesu-manager can add scripts
to Nautilus using beesu to elevate the user's privileges to root.

%if 0%{?fedora}
%package -n gedit-beesu-plugin
Version:	%{geditver}
Requires:	gedit, beesu, pygtk2, python3
Group:		User Interface/Desktops
Summary:	Allows normal users to open files in gedit as root

%description -n gedit-beesu-plugin
This package contains a plugin for gedit which allows normal users to open 
files as root (via beesu). After installation, to activate the plugin in
gedit, go to Edit -> Preferences -> Plugins and check the box next to
Open as root.
%endif

%package -n pluma-beesu-plugin
Version:	%{geditver}
Requires:	pluma, beesu, pygtk2, python
Group:		User Interface/Desktops
Summary:	Allows normal users to open files in pluma as root

%description -n pluma-beesu-plugin
This package contains a plugin for pluma which allows normal users to open
files as root (via beesu). 

%package -n caja-beesu-manager
Version:	%{nbmversion}
Requires:	beesu, zenity, caja
Requires:	/usr/bin/pluma
BuildArch:	noarch
Group:		User Interface/Desktops
Summary:	Utility to add beesu scripts to caja

%description -n caja-beesu-manager
caja-beesu-manager is a little utility to add some useful scripts
to the Caja file browser; caja-beesu-manager can add scripts
to Caja using beesu to elevate the user's privileges to root.

%package -n nemo-beesu-manager
Version:	%{nbmversion}
BuildArch:	noarch
Requires:	beesu, zenity, nemo
Group:		User Interface/Desktops
Summary:	Utility to add beesu scripts to nemo

%description -n nemo-beesu-manager
nemo-beesu-manager is a little utility to add some useful scripts
to the Nemo file browser; nemo-beesu-manager can add scripts
to Nemo using beesu to elevate the user's privileges to root.

%prep
%setup -q -a1 -a2 -a3 -a4 -a5
%patch0 -p1 -b .fix
%patch1 -p1
%patch2 -p1
%patch3 -p1
# %%patch4 -p1 -b .gedit312
%patch5 -p1 
%patch6 -p1
%patch7 -p1 -b .geditfix
chmod -x nautilus-beesu-manager-%{nbmversion}/COPYING nautilus-beesu-manager-%{nbmversion}/README
chmod -x nemo-beesu-manager-%{nbmversion}/COPYING nemo-beesu-manager-%{nbmversion}/README
chmod -x caja-beesu-manager-%{nbmversion}/COPYING caja-beesu-manager-%{nbmversion}/README
sed -i 's|MATE-Desktop;||g' caja-beesu-manager-%{nbmversion}/caja-beesu-manager.desktop


%build
make CFLAGS="%{optflags} -fno-delete-null-pointer-checks"

%if 0%{?fedora}
pushd gedit-beesu-plugin-%{geditver}
./configure --frontend beesu --buildroot %{buildroot} --libexecdir %{_libexecdir} --libdir %{_libdir}
make CFLAGS="%{optflags}"
popd
%endif

pushd pluma-beesu-plugin-%{geditver}
./configure --frontend beesu --buildroot %{buildroot} --libexecdir %{_libexecdir} --libdir %{_libdir}
make CFLAGS="%{optflags}"
popd

%install
mkdir -p %{buildroot}%{_datadir}/%{name}
make DESTDIR=%{buildroot} install

#nbm & cbm
for i in nautilus caja; do
	pushd $i-beesu-manager-%{nbmversion}
	mkdir -v -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
	mkdir -v -p %{buildroot}%{_datadir}/applications/
	install -p -m 755 $i-beesu-manager %{buildroot}%{_bindir}
	install -p -m 644 $i-beesu-manager.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
	desktop-file-install --dir %{buildroot}%{_datadir}/applications --mode 0644 $i-beesu-manager.desktop
	mkdir -v -p %{buildroot}%{_libexecdir}/$i-beesu-manager/
	install -p -m 755 libexec/api %{buildroot}%{_libexecdir}/$i-beesu-manager/
	cp -a libexec/scripts %{buildroot}%{_libexecdir}/$i-beesu-manager/
	install -p -m 644 libexec/local-launcher %{buildroot}%{_libexecdir}/$i-beesu-manager/ 
	popd
done

%if 0%{?fedora}
#gbp
pushd gedit-beesu-plugin-%{geditver}
make install
popd
%endif

#pluma
pushd pluma-beesu-plugin-%{geditver}
make install
popd

#nemo
pushd nemo-beesu-manager-%{nbmversion}
install -p -m 755 nemo-beesu-manager %{buildroot}%{_bindir}
install -p -m 644 nemo-beesu-manager.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
desktop-file-install --dir %{buildroot}%{_datadir}/applications --mode 0644 nemo-beesu-manager.desktop
mkdir -v -p %{buildroot}%{_libexecdir}/nemo-beesu-manager/
install -p -m 755 libexec/api %{buildroot}%{_libexecdir}/nemo-beesu-manager/
cp -a libexec/scripts %{buildroot}%{_libexecdir}/nemo-beesu-manager/
install -p -m 644 libexec/local-launcher %{buildroot}%{_libexecdir}/nemo-beesu-manager/ 
popd

mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/
mv %{buildroot}%{_sysconfdir}/profile.d/beesu-bash-completion.sh %{buildroot}%{_sysconfdir}/bash_completion.d/

%post -n nautilus-beesu-manager
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-desktop-database &> /dev/null ||:

%post -n nemo-beesu-manager
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-desktop-database &> /dev/null ||:

%post -n caja-beesu-manager
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-desktop-database &> /dev/null ||:

%postun -n nautilus-beesu-manager
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    if [ -x %{_bindir}/gtk-update-icon-cache ]; then
	gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    fi
fi
update-desktop-database &>/dev/null || :

%postun -n nemo-beesu-manager
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    if [ -x %{_bindir}/gtk-update-icon-cache ]; then
	gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    fi
fi
update-desktop-database &>/dev/null || :

%postun -n caja-beesu-manager
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    if [ -x %{_bindir}/gtk-update-icon-cache ]; then
        gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    fi
fi
update-desktop-database &>/dev/null || :

%posttrans -n nautilus-beesu-manager
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans -n nemo-beesu-manager
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans -n caja-beesu-manager
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi


%files
%doc COPYING README
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/%{name}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
%{_sysconfdir}/bash_completion.d/%{name}-bash-completion.sh
%{_sbindir}/%{name}
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz

%files -n nautilus-beesu-manager
%doc nautilus-beesu-manager-%{nbmversion}/COPYING nautilus-beesu-manager-%{nbmversion}/README
%{_bindir}/nautilus-beesu-manager
%{_datadir}/applications/nautilus-beesu-manager.desktop
%{_datadir}/icons/hicolor/32x32/apps/nautilus-beesu-manager.png 
%{_libexecdir}/nautilus-beesu-manager/

%files -n caja-beesu-manager
%doc caja-beesu-manager-%{nbmversion}/COPYING caja-beesu-manager-%{nbmversion}/README
%{_bindir}/caja-beesu-manager
%{_datadir}/applications/caja-beesu-manager.desktop
%{_datadir}/icons/hicolor/32x32/apps/caja-beesu-manager.png
%{_libexecdir}/caja-beesu-manager/

%if 0%{?fedora}
%files -n gedit-beesu-plugin
%{_libdir}/gedit/plugins/beesu.plugin
%{_libdir}/gedit/plugins/beesu/__init__.py*
%{_libexecdir}/gedit-beesu-plugin
%endif

%files -n pluma-beesu-plugin
%{_libdir}/pluma/plugins/beesu.pluma-plugin
%{_libdir}/pluma/plugins/beesu/__init__.py*
%{_libdir}/pluma/plugins/beesu/beesu.py*
%{_libexecdir}/pluma-beesu-plugin

%files -n nemo-beesu-manager
%doc nemo-beesu-manager-%{nbmversion}/COPYING nemo-beesu-manager-%{nbmversion}/README
%{_bindir}/nemo-beesu-manager
%{_datadir}/applications/nemo-beesu-manager.desktop
%{_datadir}/icons/hicolor/32x32/apps/nemo-beesu-manager.png 
%{_libexecdir}/nemo-beesu-manager/

%changelog
* Tue Sep 15 2015 Tom Callaway <spot@fedoraproject.org> - 2.7-26
- fix gedit plugin

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 2.7-24
- Rebuilt for GCC 5 C++11 ABI change

* Thu Feb  5 2015 Tom Callaway <spot@fedoraproject.org> - 2.7-23
- gedit plugin only works on Fedora (needs python3)
- move bash completion script to the correct place

* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Thu Aug  7 2014 Tom Callaway <spot@fedoraproject.org> - 2.7-21
- fix Edit with Pluma script (bz1118974)

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Apr  7 2014 Tom Callaway <spot@fedoraproject.org>
- add Requires: /usr/bin/pluma for caja-beesu-manager
- add explicit check for /usr/bin/pluma in caja-beesu-manager

* Thu Mar 20 2014 Tom Callaway <spot@fedoraproject.org>
- add support for caja and pluma from D. Charles Pyle

* Wed Sep 25 2013 D. Charles Pyle <dcharlespyle@msn.com> and Bee <http://www.honeybeenet.altervista.org>
- 2.7-13
- Bug fixes gedit-beesu-plugin and beesu scripts to stop crashing of GNOME Shell and added a require of usermode-gtk.
- Bug fixes to nemo scripts and nautilus scripts.

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Jun 29 2013 D. Charles Pyle <dcharlespyle@msn.com> - 2.7-11
- Add fixes to nautilus scripts for better compatibility with GNOME 3.8.
- Added newly-forked Nemo scripts package to distribution.

* Tue Jun 25 2013 Tom Callaway <spot@fedoraproject.org> - 2.7-10
- add fixes for gedit 3.8 from D. Charles Pyle <dcharlespyle@msn.com>

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Mar  1 2012 Tom Callaway <spot@fedoraproject.org> - 2.7-7
- remove --browser from nautilus invocation
- fix gedit-beesu-plugin (this time for real)

* Fri Feb 10 2012 Tom Callaway <spot@fedoraproject.org> - 2.7-6
- fix gedit-beesu-plugin (bz 786734)

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Jan 10 2011 Tom Callaway <spot@fedoraproject.org> 2.7-3
- update gedit-beesu-plugin to 0.4

* Wed Dec 15 2010 Tom Callaway <spot@fedoraproject.org> 2.7-2
- update gedit-beesu-plugin to 0.3

* Thu Aug  5 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.7-1
- update beesu to 2.7
- update nautilus-beesu-manager to 1.7
- include gedit-beesu-plugin (0.2)

* Fri Jul  9 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.6-1
- update beesu to 2.6
- update nautilus-beesu-manager to 1.6

* Wed Feb 24 2010 Tom "spot" Callaway <tcallawa@redhat.com> 2.4-8
- update nautilus-beesu-manager to 1.4
  - one new script to open any file as root with GNOME's associated application

* Thu Aug  6 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.4-7
- fix sources

* Thu Aug  6 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.4-6
- beesu updated to 2.4

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon May 11 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.3-4
- nautilus-beesu-manager update to 1.2
 - one new installable script to change file access
 - new run-once script to fix the access permissions and the 
   file owner on the trash folder

* Thu Apr  9 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.3-3
- fix missing BR: desktop-file-utils

* Thu Apr  9 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.3-2
- enable nautilus-beesu-manager subpackage

* Mon Mar 30 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.3-1
- Update to 2.3

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Feb 13 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.2-1
- Update to 2.2, adds bash auto completion feature

* Thu Jan 29 2009 Tom "spot" Callaway <tcallawa@redhat.com> 2.1-1
- slight package cleanup from Bee

* Fri Nov 28 2008 Bee <http://www.honeybeenet.altervista.org> 2.0-1
- new RPMs for Fedora 10 and some source clean up.

* Mon Oct 27 2008 Bee <http://www.honeybeenet.altervista.org> 1.0-3
- new RPMs

* Wed Oct 15 2008 Bee <http://www.honeybeenet.altervista.org> 1.0-2
- package needs to be arch specific , patch so rpm builds in mock or as non-root & clean up

* Mon Oct 13 2008 Bee <http://www.honeybeenet.altervista.org> 1.0-1
- initial release