p910nd - symulator printservera (tcp port 9100)

romke romke at estrefa.pl
Thu Feb 3 17:38:49 CET 2005


Witam, szukałem, znalazłem, poprawiłem trochę speca z orginalnego
src.rpm ze strony autora. Proszę o dodanie do cvs:

SPECS/p910nd.spec
SOURCES/p910nd.init
SOURCES/p910nd-makefile.patch

pozdrawiam
-- 
romke Roman Barczyński  ~~~~  tel. +48 12 632 7365  ~~~~  www.romke.info
____________________________________________ JID/email: romke at estrefa.pl
-------------- next part --------------
# $Id$

Summary:	Tiny non-spooling printer daemon.
Name:		p910nd
Version:	0.7
Release:	0.3
License:	GPL
Vendor:		Etherboot project
Group:		Networking/Daemons
Source0:	http://etherboot.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
#Source0-md5:	7bf752532d26c9106f8039db95df3a6b
Source1:	%{name}.init
Patch0:		%{name}-makefile.patch
URL:		http://etherboot.sourceforge.net/p910nd
BuildArch:	i386
Icon:		.p910nd.xpm
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)


%description
Tiny non-spooling printer daemon for Linux hosts. Accepts data over a TCP
network connection from a spooling host. Useful on diskless X terminals
with local printer.

%prep
rm -rf $RPM_BUILD_ROOT
%setup -n %{name}-%{version}
%patch0

%build
make ROOT="$RPM_BUILD_ROOT"
strip p910nd

%install

mkdir -p $RPM_BUILD_ROOT/etc/init.d/
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
mkdir -p $RPM_BUILD_ROOT/usr/lib/p910nd/
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man8/

install %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/p910nd
install p910nd $RPM_BUILD_ROOT/usr/sbin/
install banner.pl $RPM_BUILD_ROOT/usr/lib/p910nd/
install client.pl $RPM_BUILD_ROOT/usr/lib/p910nd/
install p910nd.8 $RPM_BUILD_ROOT/usr/share/man/man8/

%pre

%post
/sbin/chkconfig --add p910nd
if [ -f /var/lock/subsys/p910nd ]; then
	/etc/rc.d/init.d/p910nd restart >&2
else
	echo "Run \"/etc/rc.d/init.d/p910nd start\" to start p910nd daemon." >&2
fi

%preun
if [ "$1" = "0" ]; then
	if [ -f /var/lock/subsys/p910nd ]; then
		/etc/rc.d/init.d/p910nd stop >&2
	fi
	/sbin/chkconfig --del p910nd
fi

%postun

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/etc/init.d/p910nd
/usr/sbin/p910nd
%{_libdir}/p910nd
%{_mandir}/man8/p910nd.8*

%changelog
* %{date} PLD Team <feedback at pld-linux.org>
All persons listed below can be reached at <cvs_login>@pld-linux.org

$Log$
-------------- next part --------------
#!/bin/sh
#
# p910nd.sh	This shell script takes care of starting and stopping
#               p910nd (port 9100+n printer daemon)
#		This script only controls the one on port 9101.
#		You can start others if you wish.
# chkconfig:    2345 11 89

# Source function library
. /etc/rc.d/init.d/functions

P910ND_PRINTERS="0" # 0 for lp0, 1 for lp1 and 2 for lp2
P910ND_0_OPTIONS="" # for lp0
P910ND_1_OPTIONS="-b" # ...etc

# Get service config - may override defaults
[ -f /etc/sysconfig/p910nd ] && . /etc/sysconfig/p910nd

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	for i in $P910ND_PRINTERS; do
		if [ ! -f /var/lock/subsys/p910${i}d ]; then
		
			msg_starting "p910${i}d"
			OPTIONS="\$P910ND_${i}_OPTIONS"
			OPTIONS=`eval echo $OPTIONS`
			daemon p910nd ${OPTIONS} ${i}
			RETVAL=$?
			[ $RETVAL -eq 0 ] && touch /var/lock/subsys/p910${i}d
			unset OPTIONS
			
		else
			msg_already_running "p910${i}d"
		fi
	done
	;;
  stop)
	# Stop daemons.
	for i in $P910ND_PRINTERS; do
		if [ -f /var/lock/subsys/p910${i}d ]; then
			msg_stopping "p910${i}d"
			killproc "p910${i}d"
			rm -f /var/lock/subsys/p910${i}d
		else
			msg_not_running "p910${i}d"
		fi	
	done	
	;;
  status)
    for i in $P910ND_PRINTERS; do
		status p910${i}d
	done
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: p910nd {start|stop|restart|status}"
	exit 1
esac
unset i

exit 0
-------------- next part --------------
--- Makefile.orig	2005-02-03 14:41:19.000000000 +0100
+++ Makefile	2005-02-03 14:41:54.000000000 +0100
@@ -3,8 +3,8 @@
 
 # If you don't have it in /var/log/subsys, uncomment and define
 #CFLAGS+=-DLOCKFILE_DIR=\"/var/log\"
-LIBWRAP=-lwrap
+#LIBWRAP=-lwrap
 
 p910nd:	p910nd.c
-#	$(CC) -Wall $(CFLAGS) -o $@ p910nd.c
-	$(CC) -Wall $(CFLAGS) -DUSE_LIBWRAP -o $@ p910nd.c $(LIBWRAP)
+	$(CC) -Wall $(CFLAGS) -o $@ p910nd.c
+#	$(CC) -Wall $(CFLAGS) -DUSE_LIBWRAP -o $@ p910nd.c $(LIBWRAP)


More information about the pld-devel-pl mailing list