# HG changeset patch # User Christophe Lincoln # Date 1208785527 -7200 # Node ID ca2ef094c5d605551fca45883eec8e2919db2bc3 # Parent 7f751ebb914ec5ac787f5f488eb3e6768dfffd30 Add: cups (Common UNIX Printing System) diff -r 7f751ebb914e -r ca2ef094c5d6 cups/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cups/receipt Mon Apr 21 15:45:27 2008 +0200 @@ -0,0 +1,63 @@ +# SliTaz package receipt. + +PACKAGE="cups" +VERSION="1.3.7" +CATEGORY="system-tools" +SHORT_DESC="Common UNIX Printing System." +MAINTAINER="pankso@slitaz.org" +DEPENDS="openssl" +BUILD_DEPENDS="openssl-dev" +TARBALL="$PACKAGE-$VERSION-source.tar.bz2" +WEB_SITE="http://www.cups.org/" +WGET_URL="http://ftp.rz.tu-bs.de/pub/mirror/ftp.easysw.com/ftp/pub/cups/$VERSION/$TARBALL" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + ./configure \ + --prefix=$PWD/_pkg/usr \ + --sysconfdir=$PWD/_pkg/etc \ + --localstatedir=$PWD/_pkg/var \ + --mandir=$PWD/_pkg/usr/share/man \ + $CONFIGURE_ARGS + make + make install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/etc $fs/usr/lib $fs/usr/share + + cp -a $_pkg/etc/cups $fs/etc + cp -a $_pkg/usr/bin $fs/usr + cp -a $_pkg/usr/sbin $fs/usr + cp -a $_pkg/usr/lib/*.so* $fs/usr/lib + cp -a $_pkg/usr/lib/cups $fs/usr/lib + cp -a $_pkg/usr/share/cups $fs/usr/share + cp -a $_pkg/var $fs + + # Daemon script + cp -a stuff/etc $fs +} + +# Start cups daemon and edit daemons.conf. +post_install() +{ + /etc/init.d/cupsd start || continue + + local root + root=$1 + if ! grep -q ^CUPSD_OPTIONS $root/etc/daemons.conf; then + echo '# Cups printing daemon options.' >> $root/etc/daemons.conf + echo 'CUPSD_OPTIONS=""' >> $root/etc/daemons.conf + echo '' >> $root/etc/daemons.conf + fi +} + +# Stop cups daemon before rm. +pre_remove() +{ + /etc/init.d/cupsd stop +} diff -r 7f751ebb914e -r ca2ef094c5d6 cups/stuff/cups.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cups/stuff/cups.desktop Mon Apr 21 15:45:27 2008 +0200 @@ -0,0 +1,18 @@ +[Desktop Entry] +Encoding=UTF-8 +Exec=firefox http://localhost:631/ +Icon=cups.png +Name=Manage Printing +Name[de]=Druckerverwaltung +Name[es]=Administrar impresión +Name[fr]=Gestionnaire d'impression +Name[it]=Gestione stampa +Name[zh_TW]=印表管理 +Comment=CUPS Web Interface +Comment[es]=Interfaz Web de CUPS +Comment[fr]=Interface Web de CUPS +Comment[it]=Interfaccia web di CUPS +StartupNotify=false +Terminal=false +Type=Application +Categories=Application;System; diff -r 7f751ebb914e -r ca2ef094c5d6 cups/stuff/cups.png Binary file cups/stuff/cups.png has changed diff -r 7f751ebb914e -r ca2ef094c5d6 cups/stuff/etc/init.d/cupsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cups/stuff/etc/init.d/cupsd Mon Apr 21 15:45:27 2008 +0200 @@ -0,0 +1,40 @@ +#!/bin/sh +# /etc/init.d/cups: Start, stop and restart Cups deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Cupsd +DESC="cups deamon" +DAEMON=/usr/sbin/cupsd +OPTIONS=$CUPSD_OPTIONS +PIDFILE=/var/run/cups/cups.sock + +case "$1" in + stop) + echo -n "Stopping $DESC: $NAME... " + killall $DAEMON 2>/dev/null + rm -f $PIDFILE + status + ;; + start|restart) + echo -n "Restarting $DESC: $NAME... " + killall $DAEMON 2>/dev/null + rm -f $PIDFILE + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0