elida-0.4-pere/0000775002342100234210000000000011350635677012051 5ustar perepereelida-0.4-pere/README0000664002342100234210000000261311224012473012712 0ustar perepereelida README ============ Anibal Monsalve Salazar Introduction ------------ This is a tool for building .deb packages using a mail interface. It runs pbuilder to build the packages and runs piuparts and lintian. The output is compressed and sent back to the user via email. See the manual page for more information about using the program. elida is licensed under the GNU General Public License, version 2. sudo configuration ------------------ Add the following line to /etc/aliases and run newaliases to enable the mail interface: elida: "|sudo /usr/sbin/elida" and the following line in /etc/sudoers: nobody ALL=NOPASSWD: /usr/sbin/elida Example configuration --------------------- USERNAME=anibal GROUPNAME=src ELIDAHOME=/home/anibal/elida FUNCTIONS=/usr/lib/elida/functions LOCALARCHIVE=/home/anibal/public_html/debian LOCALARCHIVESCRIPT="$ELIDAHOME/bin/local-archive" MIRRORS="http://elida.v7w.com/pbuilder/debian file:$LOCALARCHIVE http://mirror.optus.net/debian http://mirrors.kernel.org/debian" GPGHOMEDIR=$ELIDAHOME/.gnupg FROM="Anibal Monsalve Salazar " BCC="$FROM" SENDMAIL=/usr/lib/sendmail Add a key to elida's keyring ---------------------------- To add key 12345678 to elida's keyring, execute the following command: gpg --homedir ~/elida/.gnupg --keyserver pgp.mit.edu --recv-key 12345678 elida-0.4-pere/elida0000775002342100234210000001414011224015475013041 0ustar perepere#!/bin/bash # Copyright 2007-2009 Anibal Monsalve Salazar # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA set -u set -e . /etc/elida/elida.conf . $FUNCTIONS mail_in() { local line local tmpline local header local value from= message_id= subject= reply_to= while IFS= read -r tmpline do if [[ "$tmpline" =~ ^[[:space:]] ]] then line="$line$tmpline" else if [ -n "$line" ] then IFS=' ' read -r header value <<< "$line" case "$header" in [Ff][Rr][Oo][Mm]: ) from=${value//\"/\\\"} #" ;; [Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]: ) message_id=${value//\"/\\\"} #" ;; [Ss][Uu][Bb][Jj][Ee][Cc][Tt]: ) subject=${value//\"/\\\"} #" ;; [Rr][Ee][Pp][Ll][Yy]-[Tt][Oo]: ) reply_to=${value//\"/\\\"} #" ;; esac fi line=$tmpline if [ -z "$line" ] then break fi fi done return 0 } $LOGGER -p syslog.info $BASENAME: starting set +e makedirs set -e mail_in regex="^.*tp://.+\.dsc$" if [[ "$subject" =~ $regex ]] then dsc=${subject##*/} url=${subject%/*} pkg=${dsc%_*} pdv=${dsc%\.dsc} log=$ELIDAHOME/source/$pkg/${pdv}_$ARCH.source.log sig=$(mktemp $TMP-XXXXXX) md5=$(mktemp $TMP-XXXXXX) dif=$(mktemp $TMP-XXXXXX) tmp=$(mktemp $TMP-XXXXXX) set +e makedir $ELIDAHOME/source/$pkg set -e if [ -e $log.bz2 ] then bunzip2 -f $log.bz2 fi if [ -e $log ] then sed -e '/^Format: 1.0$/,$ d' $log > $tmp rm -f $log mv $tmp $log else touch $log fi chmod 664 $log date -R >> $log echo >> $log set +e wget -nH -N -P $ELIDAHOME/source/$pkg/ $subject >> $log 2>&1 set -e if [ ! -f $ELIDAHOME/source/$pkg/$dsc ] then $LOGGER -p syslog.crit $BASENAME: $dsc download error (echo -e "Subject: Re: $subject\nTo: $from\nFrom: $FROM\nBcc: $BCC\nIn-Reply-To: $message_id\nUser-Agent: elida/$ELIDAVERSION\n"; cat $log) | $SENDMAIL -t exit 0 fi chmod 664 $ELIDAHOME/source/$pkg/$dsc set +e su - $USERNAME -c "gpg --homedir $GPGHOMEDIR --no-permission-warning" < $ELIDAHOME/source/$pkg/$dsc > $tmp 2> $sig rc=$(grep -c "^gpg: Good signature from " $sig) set -e if [ $rc -ne 1 ] then cat $tmp $sig >> $log echo >> $log $LOGGER -p syslog.crit $BASENAME: gpg error (echo -e "Subject: Re: $subject\nTo: $from\nFrom: $FROM\nBcc: $BCC\nIn-Reply-To: $message_id\nUser-Agent: elida/$ELIDAVERSION\n"; cat $tmp $sig) | $SENDMAIL -t exit 0 fi files=$(grep -E "^ [0-9a-f]{32} [0-9]+ .*\.(diff|tar)\.gz$" $tmp | sed "s/.* //") for file in $files do if [ $file != ${dsc%-*}.orig.tar.gz ] then set +e wget -nH -N -P $ELIDAHOME/source/$pkg/ $url/$file >> $log 2>&1 set -e else if [ ! -e $ELIDAHOME/source/$pkg/$file ] then if [[ $pkg =~ ^lib ]] then sdir=${pkg:0:4} else sdir=${pkg:0:1} fi for mirror in $MIRRORS do if [ ! -e $ELIDAHOME/source/$pkg/$file ] then set +e wget -nH -N -P $ELIDAHOME/source/$pkg/ $mirror/pool/main/$sdir/$pkg/$file >> $log 2>&1 set -e fi done if [ ! -e $ELIDAHOME/source/$pkg/$file ] then set +e wget -nH -N -P $ELIDAHOME/source/$pkg/ $url/$file >> $log 2>&1 set -e fi fi fi chmod 664 $ELIDAHOME/source/$pkg/$file done cat $tmp $sig >> $log echo -e '\nMD5s:' >> $log (cd $ELIDAHOME/source/$pkg; md5sum $dsc $files) >> $log echo >> $log sed -e '1,/^Files:/ d' $tmp | cut -d\ -f2,4 | sed -e 's/ / /' > $md5 cd $ELIDAHOME/source/$pkg set +e md5sum --check $md5 >> $log 2>&1 rc=$? set -e if [ ! $rc ] then $LOGGER -p syslog.crit $BASENAME: md5sum error rc=$rc exit $rc fi cat > $ELIDAHOME/pending/$pdv << FIN from="$from" message_id="$message_id" subject="$subject" reply_to="$reply_to" FIN mv $ELIDAHOME/pending/$pdv $ELIDAHOME/ready/$pdv echo >> $log set +e apt-get --download-only source $pkg >> $log set -e if [ -e $pdv.diff.gz ] then echo >> $log echo "diffstat $pdv.diff.gz" >> $log diffstat $pdv.diff.gz >> $log fi diffs=$(ls -1rt *.diff.gz | tail -2) rc=$(wc -w <<< $diffs) if [ $rc -eq 2 ] then set +e interdiff -zp1 $diffs > $dif 2>&1 set -e echo >> $log echo interdiff -zp1 $diffs >> $log diffstat < $dif >> $log echo >> $log cat $dif >> $log fi bzip2 -f -9 $log log="$log.bz2" rm -f $tmp mpack -s "Re: $subject" -o $tmp $log (echo -e "To: $from\nFrom: $FROM\nBcc: $BCC\nIn-Reply-To: $message_id\nUser-Agent: elida/$ELIDAVERSION"; cat $tmp) | $SENDMAIL -t fi exit 0 elida-0.4-pere/elidad0000775002342100234210000001527411224252745013221 0ustar perepere#!/bin/bash # Copyright 2007-2009 Anibal Monsalve Salazar # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . /etc/elida/elida.conf . $FUNCTIONS $LOGGER -p syslog.info $BASENAME: starting makedirs piuparts_mirrors= pbuilder_mirrors= piuparts_bindmounts= pbuilder_bindmounts= regex="^file:(.*)" for mirror in $MIRRORS do if [ -z "$pbuilder_mirrors" ] then pbuilder_mirrors="deb $mirror sid main" piuparts_mirrors="-m '$mirror main'" else pbuilder_mirrors="$pbuilder_mirrors | deb $mirror sid main" piuparts_mirrors="$piuparts_mirrors -m '$mirror main'" fi if [[ $mirror =~ $regex ]] then if [ -z "$pbuilder_bindmounts" ] then pbuilder_bindmounts="${BASH_REMATCH[1]}" piuparts_bindmounts="--bindmount ${BASH_REMATCH[1]}" else pbuilder_bindmounts="$pbuilder_bindmounts ${BASH_REMATCH[1]}" piuparts_bindmounts="$piuparts_bindmounts --bindmount ${BASH_REMATCH[1]}" fi fi done pbuilder_mirrors="'$pbuilder_mirrors'" if [ -n "$pbuilder_bindmounts" ] then pbuilder_bindmounts="'$pbuilder_bindmounts'" pbuilder_bindmounts_option="--bindmounts" fi tmp=$(mktemp $TMP-XXXXXX) if [ -n "$(ls $ELIDAHOME/inprogress)" ]; then mv $ELIDAHOME/inprogress/* $ELIDAHOME/ready fi while [ ! -f $ELIDAHOME/elida-stop ] do #dt=$(perl -e '$dt=time-(stat("'$ELIDAHOME/pbuilder_update_unstable.log'"))[9];print"$dt\n"') if [ -f $ELIDAHOME/pbuilder_update_unstable.log ]; then dt=$(( $( date +%s ) - $( date --reference=$ELIDAHOME/pbuilder_update_unstable.log +%s ) )) else dt=9999999 fi if [ $dt -gt 10800 ]; then log=$ELIDAHOME/pbuilder_update_unstable.log echo pbuilder update --override-config --distribution unstable $pbuilder_bindmounts_option $pbuilder_bindmounts --othermirror $pbuilder_mirrors >> $log eval pbuilder update --override-config --distribution unstable $pbuilder_bindmounts_option $pbuilder_bindmounts --othermirror $pbuilder_mirrors >> $log 2>&1 chmod 664 $log chown $USERNAME:$GROUPNAME $log fi for pdv in $(ls -1rt $ELIDAHOME/ready) do [ -f $ELIDAHOME/elida-stop ] && break log=$ELIDAHOME/apt-get_update.log apt-get update > $log 2>&1 chmod 664 $log chown $USERNAME:$GROUPNAME $log [ -f $ELIDAHOME/ready/$pdv ] || continue mv $ELIDAHOME/ready/$pdv $ELIDAHOME/inprogress/$pdv pkg=${pdv%_*} ver=${pdv#*_} . $ELIDAHOME/inprogress/$pdv if [ -d "$ELIDAHOME/result/$pkg" ]; then dsc_old=$( echo $ELIDAHOME/result/$pkg/${pkg}_*.dsc ) if [ -f "$dsc_old" ]; then pdv_old=${dsc_old##*/} pdv_old=${pdv_old%*.dsc} if [ "$pdv" == "$pdv_old" ]; then rm -fr $ELIDAHOME/result/$pkg/* else rm -fr $ELIDAHOME/result/$pdv_old mv $ELIDAHOME/result/$pkg $ELIDAHOME/result/$pdv_old makedir $ELIDAHOME/result/$pkg fi else rm -fr $ELIDAHOME/result/$pkg/* fi else makedir $ELIDAHOME/result/$pkg fi log=$ELIDAHOME/result/$pkg/${pdv}_$ARCH.result.log rm -f $ELIDAHOME/result/$pkg/*$ver* date -R > $log chmod 664 $log echo $(hostname; dpkg --print-architecture; dpkg -l elida lintian piuparts pbuilder | grep ^ii | awk '{print $2,$3}') >> $log echo >> $log echo pbuilder build --override-config --distribution unstable $pbuilder_bindmounts_option $pbuilder_bindmounts --othermirror $pbuilder_mirrors --buildresult $ELIDAHOME/result/$pkg $ELIDAHOME/source/$pkg/$pdv.dsc "2>&1 | grep -v 'using uid of process'" >> $log eval pbuilder build --override-config --distribution unstable $pbuilder_bindmounts_option $pbuilder_bindmounts --othermirror $pbuilder_mirrors --buildresult $ELIDAHOME/result/$pkg $ELIDAHOME/source/$pkg/$pdv.dsc 2>&1 | grep -v 'using uid of process' >> $log chmod 2775 $ELIDAHOME/result $ELIDAHOME/result/$pkg chmod 664 $ELIDAHOME/result/$pkg/* chown $USERNAME:$GROUPNAME $ELIDAHOME/result/$pkg/* if [ -e $ELIDAHOME/result/$pkg/${pdv}_$ARCH.changes ]; then echo >> $log echo "$ELIDAHOME/result/$pkg/${pdv}_$ARCH.changes:" >> $log cat $ELIDAHOME/result/$pkg/${pdv}_$ARCH.changes >> $log for f in $ELIDAHOME/result/$pkg/*$ver*deb do echo >> $log echo "dpkg -I $f" >> $log dpkg -I $f >> $log 2>&1 done for f in $ELIDAHOME/result/$pkg/*$ver*deb do echo >> $log echo "dpkg -c $f" >> $log dpkg -c $f >> $log 2>&1 done if [ -x "$LOCALARCHIVESCRIPT" ] then su - $USERNAME -c "$LOCALARCHIVESCRIPT $pkg" fi for f in $ELIDAHOME/result/$pkg/*$ver*deb do echo >> $log echo piuparts -p -N $piuparts_bindmounts $piuparts_mirrors $f "2>&1 | grep -v '/dev/pts not mounted'" >> $log eval piuparts -p -N $piuparts_bindmounts $piuparts_mirrors $f 2>&1 | grep -v '/dev/pts not mounted' >> $log 2>&1 done echo >> $log echo "lintian -i --show-overrides --pedantic $ELIDAHOME/result/$pkg/${pdv}_$ARCH.changes" >> $log su - $USERNAME -c "lintian -i --show-overrides --pedantic $ELIDAHOME/result/$pkg/${pdv}_$ARCH.changes" >> $log 2>&1 fi bzip2 -f -9 $log log="$log.bz2" rm -f $tmp mpack -s "Re: $subject" -o $tmp $log (echo -e "To: $from\nFrom: $FROM\nBcc: $BCC\nIn-Reply-To: $message_id\nUser-Agent: elida/$ELIDAVERSION"; cat $tmp) | $SENDMAIL -t mv $ELIDAHOME/inprogress/$pdv "$ELIDAHOME/done/$pdv" if [ -f $ELIDAHOME/elida-hup ]; then rm -f $ELIDAHOME/elida-hup break fi done sleep 10 done rm -f $ELIDAHOME/elida-stop exit 0 elida-0.4-pere/elida.conf0000664002342100234210000000033711224012535013757 0ustar perepereUSERNAME= GROUPNAME=src ELIDAHOME= FUNCTIONS=/usr/lib/elida/functions LOCALARCHIVE= LOCALARCHIVESCRIPT= MIRRORS="http://mirrors.kernel.org/debian" GPGHOMEDIR=$ELIDAHOME/.gnupg FROM="" BCC="$FROM" SENDMAIL=/usr/lib/sendmail elida-0.4-pere/functions0000664002342100234210000000470011224014677013774 0ustar perepere# # Copyright 2007-2009 Anibal Monsalve Salazar # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ELIDAVERSION=0.3 BASENAME=${0##*/} TMP=/tmp/$BASENAME-$$ LOGGER=/usr/bin/logger _trapexit() { local rc=${1:-$?} rm -f -- $TMP-* $LOGGER -p syslog.info $BASENAME: exit rc=$rc exit $rc } trap _trapexit 0 1 2 3 10 12 13 14 15 if [ -z "$ELIDAHOME" ] then $LOGGER -p syslog.crit $BASENAME: variable ELIDAHOME is empty exit 1 fi if [ -z "$USERNAME" ] then $LOGGER -p syslog.crit $BASENAME: variable USERNAME is empty exit 1 fi if [ -z "$FROM" ] then $LOGGER -p syslog.crit $BASENAME: variable FROM is empty exit 1 fi umask=002 ARCH=$(dpkg --print-architecture) makedir() { if [ ! -d $1 ] then local perm=${2:-2775} mkdir -m $perm $1 chown $USERNAME:$GROUPNAME $1 local rc=$? if [ ! $rc ] then $LOGGER -p syslog.crit $BASENAME: error creating $1 rc=$rc exit $rc fi fi return 0 } makedirs() { if [ "${ELIDAHOME:0:1}" != '/' ] then $LOGGER -p syslog.crit $BASENAME: ELIDAHOME=$ELIDAHOME does not start with / exit 11 fi makedir $ELIDAHOME makedir $GPGHOMEDIR 2770 if [ ! -e $GPGHOMEDIR/pubring.gpg ] then touch $GPGHOMEDIR/pubring.gpg $GPGHOMEDIR/secring.gpg chmod 660 $GPGHOMEDIR/pubring.gpg $GPGHOMEDIR/secring.gpg chown $USERNAME:$GROUPNAME $GPGHOMEDIR/pubring.gpg $GPGHOMEDIR/secring.gpg fi for d in done inprogress ready result source pending do makedir $ELIDAHOME/$d done } #run() #{ # local tmp_in=$(mktemp $TMP-XXXXXX) # local tmp_out=$(mktemp $TMP-XXXXXX) # local tmp_err=$(mktemp $TMP-XXXXXX) # # cat > $tmp_in # # $@ < $tmp_in > $tmp_out 2> $tmp_err # local rc=$? #} elida-0.4-pere/elidad.10000664002342100234210000000057111013266415013342 0ustar perepere.TH ELIDAD 1 .SH NAME elidad \- builds packages using pbuilder and runs piuparts and lintian .SH SYNOPSIS .B elidad .SH "DESCRIPTION" Builds Debian binary packages from a queue using pbuilder. After the build process, it runs piuparts and lintian. .SH "SEE ALSO" .BR elida (1) .SH AUTHOR This manual page was written by Anibal Monsalve Salazar for the Debian GNU/Linux system. elida-0.4-pere/elida.10000664002342100234210000000045711013265730013200 0ustar perepere.TH ELIDA 1 .SH NAME elida \- process source package in mail request .SH SYNOPSIS .B elida .SH "DESCRIPTION" Read a mail message request to process a Debian source package. .SH "SEE ALSO" .BR elidad (1) .SH AUTHOR This manual page was written by Anibal Monsalve Salazar for the Debian GNU/Linux system. elida-0.4-pere/debian/0000775002342100234210000000000011350636016013257 5ustar perepereelida-0.4-pere/debian/postrm0000664002342100234210000000017511224015115014520 0ustar perepere#!/bin/sh set -e if [ "$1" = "purge" ]; then update-rc.d elida remove >/dev/null # rm -fr /usr/src/elida fi exit 0 elida-0.4-pere/debian/rules0000775002342100234210000000212611224014763014337 0ustar perepere#!/usr/bin/make -f P = elida T = debian/tmp build: binary: binary-arch binary-indep binary-indep: build rm -rf $T install -d $T $T/DEBIAN install -m 0644 debian/conffiles $T/DEBIAN install -m 0755 debian/postinst $T/DEBIAN install -m 0755 debian/postrm $T/DEBIAN install -d $T/etc/$P install -d $T/etc/init.d install -d $T/usr/sbin install -d $T/usr/lib/$P install -d $T/usr/share/doc/$P install -d $T/usr/share/man/man1 install -m 0755 elida $T/usr/sbin install -m 0755 elidad $T/usr/sbin install -m 0644 functions $T/usr/lib/$P install -m 0644 elida.conf $T/etc/$P install -m 0755 elida.init.d $T/etc/init.d/$P install -m 0644 elida.1 $T/usr/share/man/man1 install -m 0644 elidad.1 $T/usr/share/man/man1 install -m 0644 debian/changelog $T/usr/share/doc/$P/changelog install -m 0644 README $T/usr/share/doc/$P gzip -9 $T/usr/share/man/man1/* gzip -9 $T/usr/share/doc/$P/* install -m 0644 debian/copyright $T/usr/share/doc/$P dpkg-gencontrol -isp chown -R root.root $T chmod -R o-s,go=u,go-ws $T dpkg --build $T .. binary-arch: clean: rm -rf debian/files debian/substvars $T elida-0.4-pere/debian/control0000664002342100234210000000121711224111172014652 0ustar perepereSource: elida Maintainer: Anibal Monsalve Salazar Section: devel Priority: optional Standards-Version: 3.8.2 Package: elida Architecture: all Depends: bzip2, devscripts, diffstat, lintian, mpack, patchutils, pbuilder, piuparts, sudo Description: pbuilder mail interface elida accepts the URL of a .dsc file from the subject of a email message and downloads the rest of the files of the corresponding Debian source package. If there is a previous version in Debian, a diff between the old and new source packages is reported. It then runs pbuilder, piuparts, and lintian. The reports are compressed and emailed back to the user. elida-0.4-pere/debian/copyright0000664002342100234210000000101711224014616015205 0ustar perepereThis is elida, packaged for Debian by Anibal Monsalve Salazar . Original author is also Anibal Monsalve Salazar. Copyright 2007-2009 Anibal Monsalve Salazar elida is free software. You may copy it according to the GNU General Public License, version 2. A copy of the license is not included, but you can get one from most FTP sites that have GNU software, for example, prep.ai.mit.edu. On a Debian GNU/Linux system, the GPL version 2 can be found in /usr/share/common-licenses/GPL-2. elida-0.4-pere/debian/changelog0000664002342100234210000000204611350636016015133 0ustar perepereelida (0.4+nmu1) unstable; urgency=low * Non-maintainer upload to fix release goal. * Correct init.d script dependency information and runlevel setting (Closes: #548868). -- Petter Reinholdtsen Fri, 19 Mar 2010 09:54:54 +0100 elida (0.4) unstable; urgency=low * Don't overwrite result/$pkg if it has an old version of $pkg * Don't use perl to cumpute dates * Support bindmounts (closes: 488335) * Fix out-of-date-standards-version * Fix copyright-refers-to-versionless-license-file * Fix maintainer-script-ignores-errors * Fix wrong-name-for-changelog-of-native-package -- Anibal Monsalve Salazar Sun, 05 Jul 2009 13:14:40 +1000 elida (0.3) unstable; urgency=low * Fix bash regexes * Don't depend on linda (closes: 488521) * Add manpages * Update copyright notices -- Anibal Monsalve Salazar Fri, 16 May 2008 20:41:29 +1000 elida (0.2) unstable; urgency=low * First release -- Anibal Monsalve Salazar Sat, 06 Oct 2007 17:25:43 +1000 elida-0.4-pere/debian/conffiles0000664002342100234210000000005010701672125015145 0ustar perepere/etc/elida/elida.conf /etc/init.d/elida elida-0.4-pere/debian/postinst0000664002342100234210000000076311350635677015107 0ustar perepere#!/bin/sh set -e . /usr/share/debconf/confmodule # Recover from incorrect init.d script runlevel settings in # version 0.4 and earlier if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "0.4" ; then update-rc.d -f elida remove fi if [ "$1" = "configure" ]; then update-rc.d elida start 20 2 3 4 5 . stop 20 0 1 6 . >/dev/null # if [ ! -d /usr/src/elida ]; then # mkdir /usr/src/elida # chmod 2775 /usr/src/elida # chgrp src /usr/src/elida # fi fi exit 0 elida-0.4-pere/elida.init.d0000664002342100234210000000416211350635677014241 0ustar perepere#!/bin/sh # # start/stop elida daemon. ### BEGIN INIT INFO # Provides: elida # Required-Start: $network $remote_fs # Required-Stop: $network $remote_fs # Should-Start: $named # Should-Stop: $named # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: pbuilder mail interface # Description: elida accepts commands from email messages from # a user to build debian packages by running # pbuilder. It then runs piuparts, lintian and # the reports are compressed an emailed back to # the user. ### END INIT INFO test -f /usr/sbin/elidad || exit 0 . /lib/lsb/init-functions if [ -f /etc/elida/elida.conf ] then . /etc/elida/elida.conf else log_begin_msg "/etc/elida/elida.conf does not exist" log_end_msg 0 exit 0 fi if [ -z "$ELIDAHOME" ] then log_begin_msg "variable ELIDAHOME is not defined" log_end_msg 0 exit 0 fi if [ ! -d $ELIDAHOME ] then log_begin_msg "directory $ELIDAHOME does not exist" log_end_msg 0 exit 0 fi case "$1" in start) test -f $ELIDAHOME/elida-stop && rm -f $ELIDAHOME/elida-stop log_begin_msg "Starting elida daemon..." pid=$(pidof elidad) if [ -n "$pid" ] then log_begin_msg "Already running." log_end_msg 0 exit 0 fi if [ -n "$(ps waux | grep /usr/sbin/elidad$)" ] then log_begin_msg "Already running." log_end_msg 0 exit 0 fi start-stop-daemon --start --quiet --oknodo --exec /usr/bin/setsid -- /usr/sbin/elidad & log_end_msg $? ;; stop) log_begin_msg "Stopping elida daemon..." touch $ELIDAHOME/elida-stop start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/elidad log_end_msg $? ;; force-reload) $0 restart ;; restart) $0 stop sleep 11 $0 start ;; *) log_success_msg "Usage: /etc/init.d/elida {start|stop|force-reload|restart}" exit 1 ;; esac exit 0