distributed.net client RPM Package

This week I decided to dust off my RPM hat and build an RPM for the distributed.net client application.  Firstly to test my setup here and secondly to make the client easier to deploy and remove from my systems.  I have packaged the core DNETC application (v2.9104.510), and added my own DNETC System V init script

I thought I would post the files here, as they maybe of use. 

dnetc-2.9104.510-2.i386.rpm
dnetc.spec
dnetc.init

Spec File:

Summary: distributed.net Client
Name: dnetc
Version: 2.9104.510
Release: 2
Source0: dnetc-2.9104.510.tar.gz
License: UNKNOWN
Group: UNKNOWN
BuildArch: i386
BuildRoot: %{_tmppath}/%{name}-buildroot

%description
This distributed.net client will make your computer a part of the world's largest computer, distributed.net. The client is capable of working on two of distributed.net's ongoing projects: The brute-force decryption of a RC5-72 message, and the search for Optimal Golomb Rulers (OGR). Both are long-term projects that will go on for some time. (http://www.distributed.net)

%prep

%setup -q

%build

%install
install -m 0755 -d $RPM_BUILD_ROOT/etc/init.d
install -m 0755 init/dnetc $RPM_BUILD_ROOT/etc/init.d/dnetc
install -m 0755 -d $RPM_BUILD_ROOT/opt/dnetc
install -m 0755 dnetc $RPM_BUILD_ROOT/opt/dnetc/dnetc
install -m 0755 dnetc.1 $RPM_BUILD_ROOT/opt/dnetc/dnetc.1
install -m 0755 -d $RPM_BUILD_ROOT/opt/dnetc/docs/
install -m 0755 docs/readme.1st $RPM_BUILD_ROOT/opt/dnetc/docs/readme.1st
install -m 0755 docs/readme.linux $RPM_BUILD_ROOT/opt/dnetc/docs/readme.linux
install -m 0755 docs/readme.uclib $RPM_BUILD_ROOT/opt/dnetc/docs/readme.uclib
install -m 0755 docs/CHANGES.txt $RPM_BUILD_ROOT/opt/dnetc/docs/CHANGES.txt
install -m 0755 docs/dnetc.txt $RPM_BUILD_ROOT/opt/dnetc/docs/dnetc.txt

%clean
rm -rf $RPM_BUILD_ROOT

%post
echo " "
echo "This will display after rpm installs the package!"

%files
/etc/init.d/dnetc
%dir /opt/dnetc
/opt/dnetc/dnetc
/opt/dnetc/dnetc.1
%dir /opt/dnetc/docs/
/opt/dnetc/docs/readme.1st
/opt/dnetc/docs/readme.linux
/opt/dnetc/docs/readme.uclib
/opt/dnetc/docs/CHANGES.txt
/opt/dnetc/docs/dnetc.txt

%changelog
* Wed Feb 24 2010 Rob Jervis 
- added my own dnetc System V init script (http://www.jervis.ws/2010/01/22/dnetc-system-v-init-script/)

* Tue Feb 23 2010 Rob Jervis 
- First RPM package of core dnetc v2.9104.510 for EL5

dnetc.init script:

#!/bin/bash
#
# dnetc This shell script takes care of starting and stopping distributed.net client
#
# chkconfig: 345 90 12
# description: distributed.net client program, a \
# distributed computing project. The program \
# uses only the computers idle time.
# processname: dnetc

# config: /etc/dnetc/dnetc.ini
# pidfile: /var/run/dnetc.pid

# Get function from functions library
. /etc/init.d/functions

start() {
echo -n "Starting DNET client: "
/opt/dnetc/dnetc -quiet
touch /var/lock/subsys/dnetc
success $"DNET client startup"
echo
}

stop() {
echo -n "Stopping DNET client: "
killproc dnetc
rm -f /var/lock/subsys/dnetc
echo
}

# ......................
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status dnetc
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac

exit 0

Distributed.net recommend that you only download and install clients from their site, I have packaged the above and use it on my systems so the choice is yours, but if you wish to build your own RPM, the spec file etc may save you a few mins.

(Visited 185 times, 1 visits today)
Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.