From f5b0faaaff2792344a9d4981ca73d9a2fab790a8 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 31 Oct 2007 20:12:34 +0100 Subject: [PATCH] Further work on the RPM spec file. --- contrib/Makefile.am | 2 +- contrib/doldaconnect.spec.in | 67 ++++++++++++++++++++++++++++++++++---- contrib/fedora-init.d-doldacond | 71 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 8 deletions(-) create mode 100755 contrib/fedora-init.d-doldacond diff --git a/contrib/Makefile.am b/contrib/Makefile.am index e60f5b1..26f7c63 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -1,2 +1,2 @@ -EXTRA_DIST = gentoo-init.d-doldacond \ +EXTRA_DIST = fedora-init.d-doldacond gentoo-init.d-doldacond \ pam.d-doldacond doldaconnect.spec diff --git a/contrib/doldaconnect.spec.in b/contrib/doldaconnect.spec.in index e2ff5ae..4b8596e 100644 --- a/contrib/doldaconnect.spec.in +++ b/contrib/doldaconnect.spec.in @@ -3,11 +3,14 @@ Name: doldaconnect Version: @VERSION@ Release: 1 License: GPL v2+ -Group: Productivity/Networking/Other +Group: Applications/Internet Summary: Direct Connect client Source0: http://www.dolda2000.com/~fredrik/doldaconnect/%{name}-%{version}.tar.gz URL: http://www.dolda2000.com/~fredrik/doldaconnect/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-data = %{version}-%{release} +Requires: doldacond = %{version}-%{release} %description Dolda Connect is a client program for the Direct Connect peer-to-peer @@ -25,6 +28,7 @@ etc. It can also be used in secure multiuser operation. %package libs Summary: %{name} libraries Group: Libraries +Requires: krb5-libs >= 1.5 %description libs Shared libraries for %{name}. @@ -32,6 +36,7 @@ Shared libraries for %{name}. %package devel Summary: Development files for %{name}. Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} %description devel Header files and development libraries for %{name}. @@ -39,15 +44,46 @@ Header files and development libraries for %{name}. %package guile Summary: Guile module for %{name}. Group: Libraries +Requires: %{name}-libs = %{version}-%{release} +Requires: guile >= 1.8.0 %description guile Guile module for using the %{name} library in Scheme programs. +%package applet +Summary: GNOME applet for %{name} +Group: Applications/Internet +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-data = %{version}-%{release} + +%description applet +A GNOME applet for checking the status of transfers in %{name}. + +%package data +Summary: Common data files for %{name} +Group: Applications/Internet + +%description data +This package contains common data files for other %{name} packages. + +%package -n dolcon +Summary: The Gtk client in %{name}. +Group: Applications/Internet +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-data = %{version}-%{release} +Conflicts: %{name} + +%description -n dolcon +This package contains only the Gtk client for %{name}, so that it can +be used without using a local server. + %package -n doldacond Summary: The daemon in %{name}. Group: Daemons Requires(post,preun): /sbin/chkconfig -Requires: rc-scripts +Requires: initscripts +Requires: krb5-libs >= 1.5 +Requires: gdbm >= 1.8.0 %description -n doldacond Daemon for %{name} that does all the actual work of filesharing. @@ -56,16 +92,18 @@ Daemon for %{name} that does all the actual work of filesharing. %setup %build -echo "rpm" >source +echo "rpm" %{release} >source %configure --disable-rpath --with-guile \ --enable-gtk2ui --enable-guishell --with-pam \ - --with-krb5 --enable-gnomeapplet + --with-krb5 --enable-gnomeapplet --without-keyutils %{__make} %install rm -rf "$RPM_BUILD_ROOT" mkdir "$RPM_BUILD_ROOT" make install DESTDIR="$RPM_BUILD_ROOT" +install -D -m 644 contrib/pam.d-doldacond "$RPM_BUILD_ROOT"%{_sysconfdir}/pam.d/doldacond +install -D contrib/fedora-init.d-doldacond "$RPM_BUILD_ROOT"%{_initrddir}/doldacond rm -f "$RPM_BUILD_ROOT"%{_libdir}/gaim/*.a rm -f "$RPM_BUILD_ROOT"%{_libdir}/libdolcon-guile.a rm -f "$RPM_BUILD_ROOT"%{_libdir}/libdolcon-guile.la @@ -84,12 +122,16 @@ rm -rf "$RPM_BUILD_ROOT" %{_bindir}/dolconf %{_bindir}/dolcon-launch %{_bindir}/doldacond-shell +%{_desktopdir}/dolcon.desktop +%{_mandir}/man1/dolcon.1.gz + +%files applet %{_libdir}/bonobo/servers/*.server %{_libexecdir}/dolcon-trans-applet -%{_desktopdir}/dolcon.desktop + +%files data %{_iconsdir}/* %{_datadir}/locale/*/LC_MESSAGES/doldaconnect.mo -%{_mandir}/man1/dolcon.1.gz %doc AUTHORS ChangeLog README doc/INSTALL doc/gui-shell doc/TODO doc/protorev %files libs @@ -126,6 +168,17 @@ rm -rf "$RPM_BUILD_ROOT" %{_mandir}/man5/doldacond.conf.5.gz %{_mandir}/man8/doldacond.8.gz +%post -n doldacond +/sbin/chkconfig --add doldacond + +%preun -n doldacond +%service doldacond stop +/sbin/chkconfig --del doldacond + +%files -n dolcon +%{_bindir}/dolcon +%{_mandir}/man1/dolcon.1.gz + %changelog * Tue Oct 16 2007 Fredrik Tolf -- Initial spec files. Quite a lot taken from the PLD specfile. +- Initial spec file. Quite a lot taken from the PLD specfile. diff --git a/contrib/fedora-init.d-doldacond b/contrib/fedora-init.d-doldacond new file mode 100755 index 0000000..6ed4174 --- /dev/null +++ b/contrib/fedora-init.d-doldacond @@ -0,0 +1,71 @@ +#!/bin/sh +# Stolen from PLD Linux +# +# doldacond: Direct Connect client as daemon +# +# +# chkconfig: 345 91 09 +# description: doldacond +# +# config: /etc/sysconfig/doldacond + +# Source function library +. /etc/rc.d/init.d/functions + +# Get service config +if [ -f /etc/sysconfig/doldacond ]; then + . /etc/sysconfig/doldacond +fi + +# Check that networking is up. +if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + msg_network_down doldacon + exit 1 +fi + +# See how we were called. +case "$1" in + start) + # Check if service is already running? + if [ ! -f /var/lock/subsys/doldacond ]; then + msg_starting doldacond + daemon doldacond -C /etc/doldaconnect/doldacond.conf -p /var/run/doldacond.pid ${ADD_OPT} + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/doldacond + else + msg_already_running doldacond + fi + ;; + stop) + if [ -f /var/lock/subsys/doldacond ]; then + msg_stopping doldacond + killproc --pidfile /var/run/doldacond.pid doldacond + rm -f /var/lock/subsys/doldacond + else + msg_not_running doldacond + fi + ;; + status) + status doldacond + RESULT=$? + ;; + reload) + if [ -f /var/lock/subsys/doldacond ]; then + msg_reloading doldacond + killproc --pidfile /var/run/doldacond.pid doldacond -HUP + RETVAL=$? + else + msg_not_running doldacond + exit 7 + fi + ;; + restart|force-reload) + $0 stop + $0 start + ;; + *) + msg_usage "$0 {start|stop|restart|force-reload|status}" + exit 3 +esac + +exit 0 -- 2.11.0