OBS User unknown 2007-07-04 23:02:54 +00:00 committed by Git OBS Bridge
parent 93bf0b5219
commit 85565d5249
11 changed files with 296 additions and 168 deletions

View File

@ -1,22 +0,0 @@
--- Makefile.am.orig 2006-12-14 14:40:24.000000000 +0100
+++ Makefile.am 2006-12-14 14:41:49.000000000 +0100
@@ -10,7 +10,7 @@ INCLUDES = -Iip -Iapi
hplipdir = $(datadir)/hplip
rundir = /var/run
-docdir = $(datadir)/doc/$(distdir)
+docdir = $(datadir)/doc/packages/hplip
doc_DATA = COPYING scan/sane/hpaio.desc
wwwsrc = doc
--- prnt/hpijs/Makefile.am.orig 2006-12-14 14:59:55.000000000 +0100
+++ prnt/hpijs/Makefile.am 2006-12-14 15:01:32.000000000 +0100
@@ -2,7 +2,7 @@ if HPLIP_BUILD
INCLUDES = -I../../ip -I../../api
endif
-docdir = $(datadir)/doc/$(distdir)
+docdir = $(datadir)/doc/packages/hplip
ppddir = $(datadir)/cups/model/manufacturer-PPDs/hplip
#APDKLABEL=JetReady_PreMerge_11-08-04

View File

@ -1,20 +0,0 @@
--- Makefile.am.orig 2007-02-22 12:14:08.000000000 +0100
+++ Makefile.am 2007-02-22 12:18:39.000000000 +0100
@@ -66,7 +66,7 @@ dist_cmd_SCRIPTS = align.py info.py prin
cupsdir = $(CUPS_BACKEND_PATH)
cupsppddir = $(CUPS_PPD_PATH)
ppddir = $(datadir)/ppd
-hpppddir = $(datadir)/ppd/HP
+hpppddir = $(datadir)/cups/model/manufacturer-PPDs/hplip
# hp backend.
cups_PROGRAMS = hp
--- prnt/hpijs/Makefile.am.orig 2006-06-15 22:44:32.000000000 +0200
+++ prnt/hpijs/Makefile.am 2006-06-19 15:39:03.000000000 +0200
@@ -1,5 +1,5 @@
docdir = $(datadir)/doc/$(distdir)
-ppddir = $(datadir)/ppd/HP
+ppddir = $(datadir)/cups/model/manufacturer-PPDs/hplip
#APDKLABEL=JetReady_PreMerge_11-08-04
APDKLABEL=HPLIP-0_9_11_11C

9
change-udev-rules.diff Normal file
View File

@ -0,0 +1,9 @@
--- 55-hpmud.rules.orig 2007-05-17 18:48:16.000000000 +0200
+++ 55-hpmud.rules 2007-06-19 14:28:42.000000000 +0200
@@ -1,5 +1,5 @@
# TODO: add PROGRAM rule for 7/xx/xx printer class interface
SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"
ACTION!="add", GOTO="hpmud_rules_end"
-SYSFS{idVendor}=="03f0", GROUP="lp"
+SYSFS{idVendor}=="03f0", OWNER="root", GROUP="lp", MODE="0660"
LABEL="hpmud_rules_end"

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jul 3 12:11:34 CEST 2007 - jsmeix@suse.de
- Updated to version 2.7.6:
Some more supported Photosmart, Color LaserJet, and DeskJet
printers.
-------------------------------------------------------------------
Fri Apr 27 14:30:51 CEST 2007 - jsmeix@suse.de

View File

@ -1,5 +1,5 @@
#
# spec file for package hpijs-standalone (Version 1.7.4a)
# spec file for package hpijs-standalone (Version 2.7.6)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -16,13 +16,13 @@ Summary: HPIJS stand-alone
# HPLIP has reached 1.0 status. With this release a date encoded revision number is used:
# x.y.m : x = major release number, y = year (eg: 6 = 2006), m = month (eg: 6a = second release in June)
# Official releases have a 3 digit number and release candidates have a 4 digit number: x.y.m.rc
Version: 1.7.4a
Release: 15
Version: 2.7.6
Release: 1
Group: Hardware/Printing
License: BSD License and BSD-like, In general all applications are covered by the GNU General Public License (GPL) and the backend is covered by a MIT license. The printer driver HPIJS uses a BSD license. See the COPYING file in the HPLIP tar ball for more details.
License: BSD 3-Clause, In general all applications are covered by the GNU General Public License (GPL) and the backend is covered by a MIT license. The printer driver HPIJS uses a BSD license. See the COPYING file in the HPLIP tar ball for more details.
URL: http://hpinkjet.sourceforge.net/
# Source0...Source9 is for sources from HP:
# URL for Source0: http://switch.dl.sourceforge.net/sourceforge/hplip/hplip-1.7.4a.tar.gz
# URL for Source0: http://switch.dl.sourceforge.net/sourceforge/hplip/hplip-2.7.6.tar.gz
Source0: hplip-%{version}.tar.bz2
# Patch0...Patch9 is for patches from HP:
# Patch10...Patch99 is for Suse patches for the sources from HP:
@ -81,50 +81,19 @@ AUTOMAKE='automake --foreign' autoreconf --force --install
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# We build a special hpijs which does not require the CUPS library.
# One of the HPLIP authors David Suffield told me in a mail:
# > To: Johannes Meixner <jsmeix@suse.de>, <hplip-devel@lists.sourceforge.net>
# > Subject: RE: [HPLIP-Devel] /usr/bin/hpijs requires libcups.so
# > If you want to build hpijs with-out the libcups.so dependency, build
# > hpijs with-out hplip support.
# > For example if you want to build hpijs for use with other spoolers,
# > don't use the top-level hplip makefile, use configure/make in the hpijs
# > directory. There is a hpijs configure time "hplip-build" flag that
# > defaults to false if you don't use the top-level make file.
# To avoid that too much is built (e.g. the full documentation from higher directories)
# the specific make target "make hpijs" is called.
# Regarding the configure options see tech_docs/tarball_install.html (not very explanatory):
# --disable-rpm-install disables sane, icon, /etc/hp and /etc/init.d install (default=disabled)
# --disable-foomatic-install disables foomatic install (HPIJS option, default=enabled)
# --disable-cups-install disables cups install (HPIJS option, default=enabled)
# CUPS install would do:
# (1) remove any old HP HPIJS PPD files from the CUPS PPD directory
# (2) symlink the HP HPIJS PPD files to the CUPS PPD directory
# (3) symlink foomatic-rip to the CUPS filter directory.
# --disable-network-build disables network support, will not link with libsnmp (default=enabled)
# --disable-pp-build disables parallel port support (default=enabled)
# --enable-scan-build enable scanner build (default=yes)
# --enable-gui-build enable gui build (default=yes)
# --enable-fax-build enable fax build (default=yes)
# --disable-cups11-build disable CUPS 1.1 hp/hpfax device discovery message (default=disabled)
# --enable-cups11-build results a "no_device_found" message
# --disable-cups11-build results depend on the following conditions:
# Condition 1 (no HPLIP daemons):
# output nothing on stdout, exit 1
# Condition 2 (no HP device found):
# direct hp "Unknown" "HP Printer (HPLIP)", exit 0
# Condition 3 (HP device found):
# direct hp:/... "HP model" "HP model (HPLIP)" "DeviceID", exit 0
# rpm-install is no longer needed because "make install DESTDIR=/tmp/myhplip" works correctly now.
# disable-cups-install avoids useless stuff when building a RPM.
pushd prnt/hpijs
./configure --prefix=/usr --libdir=%_libdir --disable-hplip-build --disable-cups-install --disable-foomatic-install
make hpijs
popd
./configure --prefix=/usr \
--libdir=%_libdir \
--disable-foomatic-xml-install \
--disable-foomatic-ppd-install \
--disable-doc-build \
--enable-hpijs-only-build
make
%install
# Install only the hpijs binary ("make install" would install full HPLIP documentation):
install -d %{buildroot}%{_bindir}
install -m 755 prnt/hpijs/hpijs %{buildroot}%{_bindir}
make install DESTDIR=%{buildroot}
# Remove installed license files (COPYING and prnt/hpijs/README_LIBJPG)
# which are packaged directly as documentation via the files section:
rm -r %{buildroot}/usr/share/doc/hplip*
# Install the man page for /usr/bin/hpijs:
install -d %{buildroot}%{_mandir}/man1
install -m 644 %{SOURCE102} %{buildroot}%{_mandir}/man1/
@ -133,13 +102,21 @@ install -m 644 %{SOURCE102} %{buildroot}%{_mandir}/man1/
/sbin/ldconfig
exit 0
%postun
/sbin/ldconfig
exit 0
%files
%defattr(-, root, root)
%doc doc/tech_docs/hpijs.html doc/tech_docs/device_classes.html
%doc COPYING prnt/hpijs/README_LIBJPG doc/license.html doc/legal.html doc/tech_docs/hpijs.html doc/tech_docs/device_classes.html doc/tech_docs/page_sizes.html doc/tech_docs/printable_areas.html
%doc %{_mandir}/man1/hpijs.1.gz
%{_bindir}/hpijs
%changelog
* Tue Jul 03 2007 - jsmeix@suse.de
- Updated to version 2.7.6:
Some more supported Photosmart, Color LaserJet, and DeskJet
printers.
* Fri Apr 27 2007 - jsmeix@suse.de
- Updated to version 1.7.4a:
Resolved a build issue that caused a couple missing files

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0df74dd8d07ad4848bb2d12297227365cefce5674c266427ad7d9975e4cf0c86
size 12174811

3
hplip-2.7.6.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:647bd55d47c62c7b127fb441b8ad49842105ae40fcd5b9ee8338db5196a6f147
size 12482738

View File

@ -1,15 +0,0 @@
--- hplip.orig 2006-08-03 11:43:10.000000000 +0200
+++ hplip 2006-08-03 11:57:49.000000000 +0200
@@ -105,10 +105,10 @@
RETVAL=$?
echo
[ $RETVAL = 0 ] && [ -d /var/lock/subsys ] && touch /var/lock/subsys/hpssd.py
-# killall -HUP cupsd
+ echo "Note: You may have to restart the cupsd."
if [ -f /var/lock/subsys/hpiod -a -f /var/lock/subsys/hpssd.py ]; then
touch /var/lock/subsys/hplip
- fi
+ fi
return $RETVAL
}

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Tue Jul 3 11:54:28 CEST 2007 - jsmeix@suse.de
- Updated to version 2.7.6:
No more start-up daemons:
hpiod is replaced by new direct device I/O (via hpmud library),
hpssd (for device status) still exists but is started by default
as a daemon by the first user who needs it which is not nice
because this results a random user which runs hpssd therefore
we (i.e. Novell/Suse) still provide /etc/init.d/hplip which
is used to start hpssd as before during system boot.
Many bug fixes (no Suse bugs) and some enhancements.
Some more supported Photosmart, Color LaserJet, and DeskJet
printers.
For details see release_notes.html
-------------------------------------------------------------------
Thu Jun 21 15:46:12 CEST 2007 - jsmeix@suse.de

View File

@ -1,5 +1,5 @@
#
# spec file for package hplip (Version 1.7.4a)
# spec file for package hplip (Version 2.7.6)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -11,28 +11,23 @@
# norootforbuild
Name: hplip
BuildRequires: cups cups-devel libdrm-devel libjpeg-devel libusb-devel net-snmp-devel pkgconfig python-devel python-openssl python-qt python-tk python-xml qt3-devel readline-devel sane-backends update-desktop-files
BuildRequires: cups cups-devel libdrm-devel libgphoto2-devel libjpeg-devel libusb-devel net-snmp-devel pkgconfig python-devel python-openssl python-qt python-tk python-xml qt3-devel readline-devel sane-backends update-desktop-files
Summary: HP's Printing, Scanning, and Faxing Software
# HPLIP has reached 1.0 status. With this release a date encoded revision number is used:
# x.y.m : x = major release number, y = year (eg: 6 = 2006), m = month (eg: 6a = second release in June)
# Official releases have a 3 digit number and release candidates have a 4 digit number: x.y.m.rc
Version: 1.7.4a
Release: 34
%define hpijsVersion 2.7.4
Version: 2.7.6
Release: 1
Group: Hardware/Printing
License: BSD License and BSD-like, GNU General Public License (GPL), In general all applications are covered by the GNU General Public License (GPL) and the backend is covered by a MIT license. The printer driver HPIJS uses a BSD license. See the COPYING file in the HPLIP tar ball for more details.
License: BSD 3-Clause, GPL v2 or later, In general all applications are covered by the GNU General Public License (GPL) and the backend is covered by a MIT license. The printer driver HPIJS uses a BSD license. See the COPYING file in the HPLIP tar ball for more details.
URL: http://hpinkjet.sourceforge.net/
# Source0...Source9 is for sources from HP:
# URL for Source0: http://switch.dl.sourceforge.net/sourceforge/hplip/hplip-1.7.4a.tar.gz
# URL for Source0: http://sourceforge.net/project/downloading.php?groupname=hplip&filename=hplip-2.7.6.tar.gz&use_mirror=ovh
Source0: %{name}-%{version}.tar.bz2
# Patch0...Patch9 is for patches from HP:
# Patch10...Patch99 is for Suse patches for the sources from HP:
# Fix "... is used uninitialized ..." warnings:
Patch10: fix-uninitialized-variables.diff
# Change installation directory for PPDs:
Patch11: change-ppd-install-dir.diff
# Change installation directory for the documentation:
Patch12: change-doc-install-dir.diff
# Source100... is for special Suse sources:
# Source100 is the primary source for the suse_update_desktop_file stuff.
# It is found automatically in $RPM_SOURCE_DIR by 'suse_update_desktop_file -i hplip':
@ -42,9 +37,11 @@ Source100: %{name}.desktop
Source101: hp-toolbox.wrapper
# Source102 is a small man page for /usr/bin/hpijs:
Source102: hpijs.1.gz
# Source103 is the init script for hpssd:
Source103: rchplip
# Patch100... is for special Suse patches:
# Patch100 changes the init script after it was installed:
Patch100: %{name}-init-script.diff
# Patch101 changes the udev rules file to set explicitely owner, group and permissions:
Patch101: change-udev-rules.diff
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: coreutils, /bin/grep, /bin/sed, /usr/bin/find
@ -141,10 +138,8 @@ Authors:
%setup -q
# Fix "... is used uninitialized ..." warnings:
%patch10
# Change installation directory for PPDs:
%patch11
# Change installation directory for the documentation:
%patch12
# Patch101 changes the udev rules file to set explicitely owner, group and permissions:
%patch101
%build
# If AUTOMAKE='automake --foreign' is not set, autoreconf (in fact automake)
@ -154,31 +149,13 @@ AUTOMAKE='automake --foreign' autoreconf --force --install
# Set our preferred architecture-specific flags for the compiler and linker:
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# Regarding the configure options see tech_docs/tarball_install.html (not very explanatory):
# --disable-rpm-install disables sane, icon, /etc/hp and /etc/init.d install (default=disabled)
# --disable-foomatic-install disables foomatic install (HPIJS option, default=enabled)
# --disable-cups-install disables cups install (HPIJS option, default=enabled)
# CUPS install would do:
# (1) remove any old HP HPIJS PPD files from the CUPS PPD directory
# (2) symlink the HP HPIJS PPD files to the CUPS PPD directory
# (3) symlink foomatic-rip to the CUPS filter directory.
# --disable-network-build disables network support, will not link with libsnmp (default=enabled)
# --disable-pp-build disables parallel port support (default=enabled)
# --enable-scan-build enable scanner build (default=yes)
# --enable-gui-build enable gui build (default=yes)
# --enable-fax-build enable fax build (default=yes)
# --disable-cups11-build disable CUPS 1.1 hp/hpfax device discovery message (default=disabled)
# --enable-cups11-build results a "no_device_found" message
# --disable-cups11-build results depend on the following conditions:
# Condition 1 (no HPLIP daemons):
# output nothing on stdout, exit 1
# Condition 2 (no HP device found):
# direct hp "Unknown" "HP Printer (HPLIP)", exit 0
# Condition 3 (HP device found):
# direct hp:/... "HP model" "HP model (HPLIP)" "DeviceID", exit 0
# rpm-install is no longer needed because "make install DESTDIR=/tmp/myhplip" works correctly now.
# disable-cups-install avoids useless stuff when building a RPM.
./configure --prefix=/usr --libdir=%_libdir --disable-cups-install
./configure --prefix=/usr \
--libdir=%_libdir \
--disable-foomatic-xml-install \
--enable-foomatic-ppd-install \
--with-hpppddir=%{_datadir}/cups/model/manufacturer-PPDs/%{name} \
--with-cupsbackenddir=%{_libdir}/cups/backend \
--with-docdir=%{_defaultdocdir}/%{name}
make
%install
@ -186,16 +163,6 @@ make install DESTDIR=%{buildroot}
# Remove the installed /etc/sane.d/dll.conf
# because this is provided by the sane-backends package:
rm %{buildroot}%{_sysconfdir}/sane.d/dll.conf
# Move /usr/lib/libsane-hpaio.* to where SANE expects them:
mv -f %{buildroot}%{_libdir}/libsane-hpaio.* %{buildroot}%{_libdir}/sane/
# Remove the installed /usr/bin/foomatic-rip
# because this is provided by the foomatic-filters package:
rm %{buildroot}%{_bindir}/foomatic-rip
# Exchange the non-working and deactivated "killall -HUP cupsd" line:
patch %{buildroot}%{_initrddir}/%{name} %{PATCH100}
# Add the usual 'rc'-link to the runlevel script:
install -d %{buildroot}%{_sbindir}
ln -s ../..%{_initrddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}
# Make some general tests and adjustments for all PPDs (see manufacturer-PPDs.spec):
pushd %{buildroot}%{_datadir}/cups/model/manufacturer-PPDs/%{name}
gunzip *.ppd.gz
@ -245,11 +212,17 @@ install -d %{buildroot}%{_datadir}/pixmaps
install -m 644 %{buildroot}%{_datadir}/%{name}/data/images/HPmenu.png %{buildroot}%{_datadir}/pixmaps/HPmenu.png
# Set up and install the desktop menue entry stuff using "Categories=System;Monitor;"
# and remove HP's hplip.desktop file before because we use Source100:
# (additionally there is a typo in HP's install because of the trailing blank at 'applications ')
rm %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -i %{name} System Monitor
# Install the man page for /usr/bin/hpijs:
install -d %{buildroot}%{_mandir}/man1
install -m 644 %{SOURCE102} %{buildroot}%{_mandir}/man1/
# Install the init script for hpssd and the usual 'rc'-link to it:
install -d %{buildroot}%{_initrddir}
install -m 755 %{SOURCE103} %{buildroot}%{_initrddir}/hplip
install -d %{buildroot}%{_sbindir}
ln -s ../..%{_initrddir}/hplip %{buildroot}%{_sbindir}/rchplip
%post
/sbin/ldconfig
@ -281,8 +254,9 @@ exit 0
find /usr/share/hplip/ -name '*.py[co]' -delete
exit 0
%postun
%postun
/sbin/ldconfig
%restart_on_update hplip
%insserv_cleanup
# If the package was removed (but not if it was updated)
# then remove the hpaio lines in /etc/sane.d/dll.conf.
@ -314,10 +288,12 @@ exit 0
%files
%defattr(-, root, root)
%config %{_sysconfdir}/hp/
%{_initrddir}/%{name}
%{_sbindir}/rc%{name}
%dir %{_sysconfdir}/udev
%dir %{_sysconfdir}/udev/rules.d
%config %{_sysconfdir}/udev/rules.d/55-hpmud.rules
%{_initrddir}/hplip
%{_sbindir}/rchplip
%{_datadir}/%{name}/
%{_sbindir}/hpiod
%{_bindir}/hp-align
%{_bindir}/hp-check
%{_bindir}/hp-clean
@ -330,20 +306,23 @@ exit 0
%{_bindir}/hp-makeuri
%{_bindir}/hp-print
%{_bindir}/hp-probe
%{_bindir}/hp-scan
%{_bindir}/hp-sendfax
%{_bindir}/hp-setup
%{_bindir}/hp-testpage
%{_bindir}/hp-timedate
%{_bindir}/hp-toolbox
%{_bindir}/hp-unload
%{_libdir}/python%{py_ver}/site-packages/cupsext*
%{_libdir}/python%{py_ver}/site-packages/pcardext*
%{_libdir}/python%{py_ver}/site-packages/cupsext.*
%{_libdir}/python%{py_ver}/site-packages/hpmudext.*
%{_libdir}/python%{py_ver}/site-packages/pcardext.*
%{_libdir}/python%{py_ver}/site-packages/scanext.*
%dir %{_libdir}/sane
%{_libdir}/sane/libsane-hpaio.*
%dir %{_libdir}/cups
%dir %{_libdir}/cups/backend
%{_libdir}/cups/backend/hp
%{_libdir}/cups/backend/hpfax
%dir %{_libdir}/sane
%{_libdir}/sane/libsane-hpaio.*
%dir %{_datadir}/cups
%dir %{_datadir}/cups/model
%dir %{_datadir}/cups/model/manufacturer-PPDs
@ -359,8 +338,22 @@ exit 0
%doc %{_mandir}/man1/hpijs.1.gz
%{_bindir}/hpijs
%{_libdir}/libhpip.*
%{_libdir}/libhpmud.*
%changelog
* Tue Jul 03 2007 - jsmeix@suse.de
- Updated to version 2.7.6:
No more start-up daemons:
hpiod is replaced by new direct device I/O (via hpmud library),
hpssd (for device status) still exists but is started by default
as a daemon by the first user who needs it which is not nice
because this results a random user which runs hpssd therefore
we (i.e. Novell/Suse) still provide /etc/init.d/hplip which
is used to start hpssd as before during system boot.
Many bug fixes (no Suse bugs) and some enhancements.
Some more supported Photosmart, Color LaserJet, and DeskJet
printers.
For details see release_notes.html
* Thu Jun 21 2007 - jsmeix@suse.de
- Added stop_on_removal to preun, insserv_cleanup to postun,
and ldconfig to post and postun for the hpijs sub-package.

183
rchplip Normal file
View File

@ -0,0 +1,183 @@
#! /bin/bash
#
# Startup/shutdown script for HPLIP
#
# Note, this script file must start before cupsd.
#
# For chkconfig the HPLIP priority (ie: 50) must be less the cupsd
# priority (ie: 55).
#
# For LSB install_initd the cups script file should have "hplip" in the
# Should-Start field.
#
# chkconfig: 2345 50 10
# description: Start/stop script for HP Linux Imaging and Printing (HPLIP).
#
# (c) 2004 Copyright Hewlett-Packard Development Company, LP
#
### BEGIN INIT INFO
# Provides: hplip
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 3 5
# Default-Stop:
# Description: Start/stop script for HP Linux Imaging and Printing (HPLIP)
### END INIT INFO
HPSSDDIR=/usr/share/hplip
RUNDIR=/var/run
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
else
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
export LC_ALL="POSIX"
export LANG="POSIX"
umask 022
daemon() {
( exec -a hpssd python /usr/share/hplip/hpssd.py >/dev/null 2>&1 )
if [ $? -eq 0 ]; then
echo -ne " [ OK ]\r"
else
echo -ne " [FAILED]\r"
fi
}
killproc() {
pid=`pidof -s $1`
pidfile=$RUNDIR/${1}.pid
if [ -z $pid ]; then
if [ -f $pidfile ]; then
read pid < $pidfile
kill $pid
fi
else
kill $pid
fi
retval=$?
if [ -f $pidfile ]; then
rm $pidfile
fi
if [ $retval -eq 0 ]; then
echo -ne " [ OK ]\r"
else
echo -ne " [FAILED]\r"
fi
}
fi
mystatus() {
pid=`pidof -s $1`
if [ -z $pid ]; then
pidfile=$RUNDIR/${1}.pid
if [ -f $pidfile ]; then
read pid < $pidfile
fi
fi
if [ -n "$pid" ]; then
echo $"$1 (pid $pid) is running..."
return 0
fi
echo $"$1 is stopped"
return 3
}
RETVAL=0
start() {
echo -n $"Starting hpssd: "
cd $HPSSDDIR
daemon ./hpssd.py
RETVAL=$?
echo
[ $RETVAL = 0 ] && [ -d /var/lock/subsys ] && touch /var/lock/subsys/hpssd.py
if [ -f /var/lock/subsys/hpssd.py ]; then
touch /var/lock/subsys/hplip
fi
return $RETVAL
}
stop() {
echo -n $"Stopping hpssd: "
killproc hpssd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/hpssd.py
for pidfile in $RUNDIR/*; do
case "$( basename $pidfile )" in
hpguid-*.pid)
read pid < $pidfile
kill $pid
rm $pidfile
esac
done
if [ ! -f /var/lock/subsys/hpssd.py ]; then
rm -f /var/lock/subsys/hplip
fi
return $RETVAL
}
restart() {
stop
start
}
debug() {
# Allow core dumps.
ulimit -c unlimited
echo -n $"Starting hpssd: "
cd $HPSSDDIR
./hpssd.py >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo -ne " [ OK ]\r"
else
echo -ne " [FAILED]\r"
fi
echo
[ $RETVAL = 0 ] && [ -d /var/lock/subsys ] && touch /var/lock/subsys/hpssd.py
if [ -f /var/lock/subsys/hpssd.py ]; then
touch /var/lock/subsys/hplip
return 0
else
return 1
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
mystatus hpssd
;;
restart)
restart
;;
try-restart)
## Restart the service only if it was running before:
mystatus hpssd &>/dev/null && restart || :
;;
condrestart)
[ -f /var/lock/subsys/hpssd.py ] && restart || :
;;
debug)
debug
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
exit 1
esac
exit $?