Blob Blame History Raw
%define revision 17542
%define version_ 6_4

Summary:	The BOINC client core
Name:		boinc-client
Version:	6.4.7
Release:	5.r%{revision}svn%{?dist}
License:	LGPLv2+
Group:		Applications/Engineering
URL:		http://boinc.berkeley.edu/
# The source for this package was pulled from upstream's vcs. Use the
# following commands to generate the tarball:
# svn export http://boinc.berkeley.edu/svn/tags/boinc_core_release_%{version_}
# pushd boinc_core_release_%{version_}
# ./_autosetup
# ./trim . Trim all binaries and other unnecessary things.
# popd
# tar -cjvf boinc-%{version}.tar.bz2 boinc_core_release_%{version_}/
Source0:	boinc-%{version}.tar.bz2
Source1:	boinc-client-init-d
Source2:	boinc-client-logrotate-d
Source3:	boinc-manager.desktop
Source8:	trim
#Remove -fomit-frame-pointer and -ffast-math gcc flags:
#Reported in upstream bugtracker: http://boinc.berkeley.edu/trac/ticket/647
Patch1:		boinc-gccflags.patch
#Fix security bug BZ#479664
#Reported in upstream bugtracker: http://boinc.berkeley.edu/trac/ticket/823
Patch2:		boinc-rsa.patch
#Change locales filenames from "BOINC Manager.mo" into "BOINC-Manager.mo"
#so that we can use the find_lang macro.
#Reported in upstream bugtracker: http://boinc.berkeley.edu/trac/ticket/722
#Fixed in SVN trunk, not yet in BOINC 6 branch.
Patch3:		boinc-locales.patch
#Both of these patches fix the gcc 4.4 build
#Reported in upstream bugtracker: http://boinc.berkeley.edu/trac/ticket/823
#Patch4:		boinc-gcc44.patch
#Patch5:		boinc-client-6.4.5-event.patch
#Create password file rw for group, this enables passwordless connection
#of manager from users of the boinc group.
Patch6:		boinc-guirpcauth.patch
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

Requires:	logrotate
Requires:	chkconfig
Requires(pre):  shadow-utils

BuildRequires:	MySQL-python
BuildRequires:	curl-devel
BuildRequires:	desktop-file-utils
BuildRequires:	freeglut-devel
BuildRequires:	mesa-libGLU-devel
BuildRequires:	openssl-devel
BuildRequires:	wxGTK-devel
BuildRequires:  gettext
BuildRequires:  mysql-devel
BuildRequires:  libXmu-devel
BuildRequires:  libjpeg-devel
BuildRequires:	docbook2X

%description
The Berkeley Open Infrastructure for Network Computing (BOINC) is an open-
source software platform which supports distributed computing, primarily in
the form of "volunteer" computing and "desktop Grid" computing.  It is well
suited for problems which are often described as "trivially parallel".  BOINC
is the underlying software used by projects such as SETI@home, Einstein@Home,
ClimatePrediciton.net, the World Community Grid, and many other distributed
computing projects.

This package installs the BOINC client software, which will allow your
computer to participate in one or more BOINC projects, using your spare
computer time to search for cures for diseases, model protein folding, study
global warming, discover sources of gravitational waves, and many other types
of scientific and mathematical research.

%package -n boinc-manager
Summary:	GUI to control and monitor %{name}
Group:		Applications/Engineering

Requires:	hicolor-icon-theme
Requires:	%{name} = %{version}-%{release}

%description -n boinc-manager
The BOINC Manager is a graphical monitor and control utility for the BOINC
core client. It gives a detailed overview of the state of the client it is
monitoring. The BOINC Manager has two modes of operation, the "Simple View" in
which it only displays the most important information and the "Advanced View"
in which all information and all control elements are available.

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

Requires:	%{name} = %{version}-%{release}
Requires:	openssl-devel
Requires:	mysql-devel
Provides:	%{name}-static = %{version}-%{release}

%description devel
This package contains development files for %{name}.

%prep
%setup -q -n boinc_core_release_%{version_}
%patch1 -p1
%patch2 -p1
%patch3 -p1
#%patch4
#%patch5 -p1
%patch6

# fix utf8
iconv -f ISO88591 -t UTF8 < checkin_notes_2004 > checkin_notes_2004.utf8
touch -r checkin_notes_2004 checkin_notes_2004.utf8
mv checkin_notes_2004.utf8 checkin_notes_2004

iconv -f ISO88591 -t UTF8 < checkin_notes_2005 > checkin_notes_2005.utf8
touch -r checkin_notes_2005 checkin_notes_2005.utf8
mv checkin_notes_2005.utf8 checkin_notes_2005

iconv -f ISO88591 -t UTF8 < checkin_notes_2006 > checkin_notes_2006.utf8
touch -r checkin_notes_2006 checkin_notes_2006.utf8
mv checkin_notes_2006.utf8 checkin_notes_2006

%build
%ifarch %{ix86}
%define boinc_platform i686-pc-linux-gnu
%endif
%ifarch powerpc ppc
%define boinc_platform powerpc-linux-gnu
%endif
%ifarch powerpc64 ppc64
%define boinc_platform ppc64-linux-gnu
%endif

#quick fix to make build & install to work, filed in upstream's bugtracker under
#http://boinc.berkeley.edu/trac/ticket/811
sed -i "s/boincmgr.16x16.png boincmgr.32x32.png boincmgr.48x48.png//" clientgui/res/Makefile.in
echo "install:" >> samples/example_app/Makefile

%define confflags --disable-static --enable-unicode STRIP=: DOCBOOK2X_MAN=/usr/bin/db2x_docbook2man

%if %{defined boinc_platform}
%configure %{confflags} --with-boinc-platform=%{boinc_platform}
%else
%configure %{confflags}
%endif


# Parallel make does not work.
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/boinc
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/

make install INSTALL="%{__install} -p" DESTDIR=$RPM_BUILD_ROOT

rm -rf $RPM_BUILD_ROOT%{_bindir}/1sec
rm -rf $RPM_BUILD_ROOT%{_bindir}/concat
rm -rf $RPM_BUILD_ROOT%{_bindir}/create_work
rm -rf $RPM_BUILD_ROOT%{_bindir}/dir_hier_move
rm -rf $RPM_BUILD_ROOT%{_bindir}/dir_hier_path
rm -rf $RPM_BUILD_ROOT%{_bindir}/sign_executable
rm -rf $RPM_BUILD_ROOT%{_bindir}/start
rm -rf $RPM_BUILD_ROOT%{_bindir}/status
rm -rf $RPM_BUILD_ROOT%{_bindir}/stop
rm -rf $RPM_BUILD_ROOT%{_bindir}/updater
rm -rf $RPM_BUILD_ROOT%{_bindir}/upper_case

pushd $RPM_BUILD_ROOT%{_bindir}
ln -s boinc_client boinc
mv boinc_cmd boinccmd
cat > boincmgr <<EOF
#!/bin/bash
# wrapper script to allow passwordless manager connections from users of the boinc group

# Look for any local configuration settings of \$BOINCDIR
if [ -f %{_sysconfdir}/sysconfig/%{name} ]; then
	. %{_sysconfdir}/sysconfig/%{name} 
elif [ -f %{_sysconfdir}/default/%{name} ]; then
	. %{_sysconfdir}/default/%{name}
fi

# Otherwise pull \$BOINCDIR from the init script
if [ -z \$BOINCDIR ]; then
	BOINCDIR=\`grep 'BOINCDIR=' %{_sysconfdir}/init.d/%{name} | tr '"' ' ' | sed 's|BOINCDIR=||'\`;
fi

cd \$BOINCDIR
boinc_gui >& /dev/null
EOF
chmod a+x boincmgr
popd

rm $RPM_BUILD_ROOT%{_bindir}/ca-bundle.crt
#because it's already included in curl

# own init script and logrotate configuration file
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/%{name}
install -p -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name}
install -p -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}

# icon
install -p -m644 sea/boincmgr.16x16.png \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/boincmgr.png
install -p -m644 sea/boincmgr.32x32.png \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/boincmgr.png
install -p -m644 sea/boincmgr.48x48.png \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/boincmgr.png

desktop-file-install %{?_remove_encoding} --vendor fedora \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE3}

# locales
mv locale/client/* locale
find locale -not -name "BOINC Manager.mo" -type f -delete
cp -rp locale $RPM_BUILD_ROOT%{_datadir}
find $RPM_BUILD_ROOT%{_datadir}/locale -name "BOINC Manager.mo" -execdir mv {} BOINC-Manager.mo \;

%find_lang BOINC-Manager

# bash-completion
install -Dp -m644 client/scripts/boinc.bash $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/boinc-client

# usability hints
cat > USAGE_FEDORA <<-EOF
	For up-to-date instructions on how to setup BOINC client on Fedora, please have a look at: http://boinc.berkeley.edu/wiki/Installing_BOINC_on_Fedora
EOF

%clean
rm -rf $RPM_BUILD_ROOT

%pre

# Create BOINC user and group
getent group boinc >/dev/null || groupadd -r boinc
getent passwd boinc >/dev/null || \
useradd -r -g boinc -d %{_localstatedir}/lib/boinc -s /sbin/nologin \
	-c "BOINC client account." boinc
exit 0

%post
/sbin/chkconfig --add boinc-client

#correct wrong owner and group on files under /var/lib/boinc and log files
#caused by bug fixed in 5.10.45-8
chown --silent -R boinc:boinc %{_localstatedir}/log/boinc* \
%{_localstatedir}/lib/boinc/* 2>/dev/null || :

%preun
if [ $1 -eq 0 ]; then #if uninstalling, not only updating
	/sbin/service boinc-client stop
	/sbin/chkconfig --del boinc-client
fi

%post -n boinc-manager
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun -n boinc-manager
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%files
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/bash_completion.d/
%doc COPYING COPYRIGHT checkin_notes checkin_notes_2007 checkin_notes_2006
%doc checkin_notes_2005 checkin_notes_2004 checkin_notes_2003 checkin_notes_2002
%doc USAGE_FEDORA
%{_bindir}/boinc
%{_bindir}/boinc_client
%{_bindir}/boinccmd
%{_bindir}/crypt_prog
%{_bindir}/switcher
%{_initrddir}/%{name}
%{_sysconfdir}/sysconfig/%{name}
%{_mandir}/man1/boinccmd.1.gz
%{_mandir}/man1/boinc.1.gz
%defattr(-,boinc,boinc,-)
%{_localstatedir}/lib/boinc/

%files -n boinc-manager -f BOINC-Manager.lang
%defattr(-,root,root,-)
%{_bindir}/boinc_gui
%{_bindir}/boincmgr
%{_datadir}/applications/fedora-boinc-manager.desktop
%{_datadir}/icons/hicolor/16x16/apps/boincmgr.png
%{_datadir}/icons/hicolor/32x32/apps/boincmgr.png
%{_datadir}/icons/hicolor/48x48/apps/boincmgr.png
%{_mandir}/man1/boincmgr.1.gz

%files devel
%defattr(-,root,root,-)
%{_libdir}/libboinc.a
%{_libdir}/libboinc_api.a
%{_libdir}/libboinc_zip.a
%{_libdir}/libsched.a
%{_libdir}/libboinc_graphics2.a

%dir %{_includedir}/boinc
%{_includedir}/boinc/*

%changelog
* Tue Mar 17 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.7-5.r17542svn
- Wait longer when checking start/stop result in the init script.

* Wed Mar 11 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.7-4.r17542svn
- Rewritten init script: honours localisation, fixed reload action, doesn't 
  output garbage into logfiles (resolves BZ#489378), do not leave stale init 
  script process on startup, uses /etc/init.d/functions instead of own stuff.

* Tue Mar 10 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.7-3.r17542svn
- Fix damn typos in boincmgr wrapper script (resolves BZ#489463).

* Sun Mar 08 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.7-2.r17542svn
- Fix overriding $BOINCOPTS from /etc/sysconfig/boinc-client in the init script
  (BZ#489199).
- Fixed boinc-gccflags.patch
- Honour data dir in boincmgr wrapper script.

* Fri Mar 06 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.7-1.r17542svn
- i386 arch conditional replaced by the %%{ix86} macro.
- Rebase to current 6.4 branch, therefore using new suffix "r[revision]svn"
  instead of "[date]svn", fixes help button in the simple GUI (BZ#478713).
- Trim CUDA prebuilt libraries from sources.
- UTF8 conversion now done in spec, not in a separate 'unicode' script.
- Add a short link to upstream's wiki about usage in Fedora into %%doc.
- boincmgr turned into a wrapper script to allow passwordless connections
  from users of the boinc group (fix BZ#478715).

* Tue Feb 24 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.5-6.20081217svn
- Added boinc-client-6.4.5-event.patch to fix build with gcc 4.4

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

* Wed Feb  4 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.5-4.20081217svn
- Added boinc-gcc44.patch to fix build with gcc 4.4

* Mon Jan 26 2009 Tomas Mraz <tmraz@redhat.com> - 6.4.5-3.20081217svn 
- rebuild with new openssl and mysql

* Thu Jan 15 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.5-2.20081217svn
- Fix security bug BZ#479664

* Wed Dec 17 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 6.4.5-1.20081217svn
- Update to 6.4.5
- Updated boinc-gccflags.patch and boinc-locales.patch
- Not trimming doc/ subdirectory
- Bash completion now provided by the source tarball,
  not packaged as separate sources anymore.
- Supplied example /etc/sysconfig configuration file
- Added BR: docbook2X for autogenerating manpages, not packaged as separate
  sources anymore.

* Sat Dec 13 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 6.2.15-2.20080818svn
- Fix usage of $BOINCDIR in the init script

* Tue Aug 19 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 6.2.15-1.20080818svn
- Update to 6.2.15
- Removed the 'noexec' script (fixed upstream)
- Removed boinc-gcc43.patch and boinc-parsecolor.patch (both merged upstream)
- Updated boinc-gccflags.patch
- Sources now compressed as tar.bz2 (was tar.gz)

* Mon Aug 04 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-15.20080315svn
- Fixed return value when managing the daemon with insufficient rights to 4
  according to the guidelines.
- There is now a delay up to 10 seconds when starting the service to check
  that it is up.
- Fixed boinc platform on PPC/PPC64.

* Sat May 17 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-14.20080315svn
- Fixed opening locales by adding boinc-locales.patch

* Sat May 17 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-13.20080315svn
- Fixed boincmgr segfaulting on F9/x86_64 (#445902) by adding
  boinc-parsecolor.patch (Patch2).

* Mon May 12 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-12.20080315svn
- Do not ship ca-bundle.crt as it is already included in curl.
- Fixed the almost empty debuginfo package (do not strip anything).
- Patches documented according to the guidelines (PatchUpstreamStatus)

* Sun May 04 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-11.20080315svn
- Fixed find command because starting with findutils-4.4.0-1.fc10, find 
  returns a non-zero value when "-delete" fails.
  (for more details on this see bug #20802 on savannah.gnu.org)

* Sat May 03 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-10.20080315svn
- Fixed handling stale lockfiles (#444936).
- Initscript fixed to be compliant with current SysVInit guidelines
  (added condrestart, try-restart, force-reload actions).

* Wed Apr 23 2008 Lubomir Kundrak <lkundrak@redhat.com> - 5.10.45-9.20080315svn
- Do not expect chown of nonexistent files to succeed (#443568)

* Mon Apr 14 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-8.20080315svn
- Fixed projects permissions (calling chown recursively).

* Mon Apr 14 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-7.20080315svn
- Fixed running the boinc daemon as boinc user instead of root, file
  permissions changed accordingly.

* Mon Apr 07 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-6.20080315svn
- Using --with-boinc-platform=i686-pc-linux-gnu on i386 instead of --build,
  --host, --target
- Added bash completion script.

* Fri Apr 04 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-5.20080315svn
- Fixed build on i386 since it needs to be configured as i686-pc-linux-gnu 
  and not i386-pc-linux-gnu.

* Mon Mar 24 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-4.20080315svn
- Removed unnecessary slash before the {_localstatedir} macro.

* Sun Mar 23 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-3.20080315svn
- Logs moved to /var/log so that all SELinux related things could be removed.
- The error.log file has been renamed to boincerr.log.

* Sun Mar 16 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-2.20080315svn
- Fixed typo in the semanage command (missing boinc subdirectory and quotes).
- Fixed installing empty log files.
- Fixed Patch1 (has been created before propagating the flags using the
  _autosetup script).

* Sat Mar 15 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.45-1.20080315svn
- Updated to 5.10.45
- Added Patch1 removing -fomit-frame-pointer and -ffast-math compiler flags.
- Updated Patch0 (/lib/boinc_cmd.C changes have been merged in upstream).
- Log files (/var/lib/{boinc,error}.log) are touched during the installation
  so that correct(?) SELinux context can be set on them.
- Added Requires(post, postun): policycoreutils because of previous point.

* Sat Mar 08 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-8.20080206svn
- Added missing Requires: mysql-devel for the -devel subpackage

* Fri Mar 07 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-7.20080206svn
- Removed unnecessary client stopping when upgrading.
- Removed unnecessary ldconfig calls.
- A few changes unifying macros usage.
- Fixed missing directory ownership of {_localstatedir}/lib/boinc
- Added missing Requires: openssl-devel for the -devel subpackage

* Wed Feb 27 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-6.20080206svn
- Added patch making the sources compatible with GCC4.3

* Mon Feb 25 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-5.20080206svn
- Added the "stripchart" source directory to be trimmed.
- Removed all translations (will be added later through l10n specspo module).
- Fixed logrotate in case that boinc won't be running at the logrotate time.
- Changed summary and description according to upstream's choice.
- Fixed wrong SELinux context on error.log and boinc.log.
- Removed .svn directories from the source.
- Fixed missing Short-Description field in the init script.
- Service disabled by default.
- Fixed missing reload action in the init script.
- Changed the way of using the subsys directory for locking so that 
  rpmlint doesn't complain.
- Added script converting non-unicode files into UTF8.
- Added script removing execution rights on documentation files.
- Added documentation: checkin_notes_2007
- Init script behaves polite now when starting/stopping the service which
  has been already started/stopped (i.e. exits with 0).

* Fri Feb 16 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-4.20080206svn
- Fixed locales installation path
- Fixed missing Provides: boinc-client-static in the -devel subpackage

* Thu Feb 14 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-3.20080206svn
- Fixed the init script (now using the daemon function properly)
- Fixed missing chkconfig setup
- Added Requires: chkconfig

* Tue Feb 12 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-2.20080206svn
- Fixed missing boinc user and group

* Tue Feb 06 2008 Milos Jakubicek <xjakub@fi.muni.cz> - 5.10.40-1.20080206svn
- Updated to 5.10.40.
- Fixed unpackaged files: libboinc_graphics*.
- Fixed missing BuildRequires: mysql-devel, libXmu-devel, libjpeg-devel.
- Added locales.
- Added script trimming binaries and other unnecessary code from the source.
- Added ldconfig call for the -devel subpackage.
- Added Czech and German translation.

* Wed Jan 09 2008 Debarshi Ray <rishi@fedoraproject.org> - 5.10.32-1.20080109svn
- Initial build. Imported SPEC written by Eric Myers and Milos Jakubicek.
- Disabled parallel make to prevent failure with -j3.