initial commit of file from CVS for e-smith-LPRng on Wed 12 Jul 08:48:21 BST 2023

master 2.6.0
Brian Read 10 months ago
parent 6a1964d326
commit 56bb66d687

4
.gitignore vendored

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.xz

@ -0,0 +1,21 @@
# Makefile for source rpm: e-smith-LPRng
# $Id: Makefile,v 1.1 2016/02/05 22:40:30 stephdl Exp $
NAME := e-smith-LPRng
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

@ -1,3 +1,17 @@
# e-smith-LPRng
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> e-smith-LPRng
SMEServer Koozali developed git repo for e-smith-LPRng smeserver
SMEServer Koozali developed git repo for e-smith-LPRng smeserver
## Wiki
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-LPRng&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />
E-smith-LPRng is a powerful and reliable print server software designed to provide secure and efficient printing support for small to medium sized networks. It is built upon the Linux printing system, LPRng, and is a popular choice for Linux-based networks. It is highly customizable, allowing network administrators to easily configure how documents are sent and received. Features such as secure and efficient queuing, print job tracking, and device management make E-smith-LPRng an excellent choice for businesses looking to streamline their printing needs. Additionally, it is open source, so it will not cost anything to install and maintain.

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -0,0 +1 @@
sme10

@ -0,0 +1,77 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("printers", $panel);
#--------------------------------------------------
# actions for printer-create event
#--------------------------------------------------
$event = "printer-create";
event_link("printer-create", $event, "15");
templates2events("/etc/printcap", $event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/lpd");
#--------------------------------------------------
# actions for printer-delete event
#--------------------------------------------------
$event = "printer-delete";
event_link("printer-delete", $event, "15");
templates2events("/etc/printcap", $event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/lpd");
#--------------------------------------------------
# actions for network-create event
#--------------------------------------------------
$event = "network-create";
templates2events("/etc/lpd/lpd.perms", $event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/lpd");
#--------------------------------------------------
# actions for network-delete event
#--------------------------------------------------
$event = "network-delete";
templates2events("/etc/lpd/lpd.perms", $event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/lpd");
#--------------------------------------------------
# actions for bootstrap-console-save event
#--------------------------------------------------
my $event = "bootstrap-console-save";
templates2events("/etc/lpd/lpd.perms", $event);
templates2events("/etc/printcap", $event);
event_link("printer-create", $event, "15");
#--------------------------------------------------
# actions for e-smith-LPRng-update event
#--------------------------------------------------
my $event = "e-smith-LPRng-update";
templates2events("/etc/lpd/lpd.perms", $event);
templates2events("/etc/printcap", $event);
safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/lpd");
templates2events("/etc/systemd/system-preset/49-koozali.preset", $event);
event_link("systemd-default", $event, "06");
#--------------------------------------------------
# remove for systemd
## Make service statup symlinks
#safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/lpd");
#safe_symlink("/etc/rc.d/init.d/e-smith-service", "root/etc/rc.d/rc7.d/S60lpd");
safe_symlink("/var/service/lpd", "root/service/lpd");

@ -0,0 +1,596 @@
# $Id: e-smith-LPRng.spec,v 1.9 2022/07/17 04:45:24 jpp Exp $
Summary: e-smith server and gateway - LPRng module
%define name e-smith-LPRng
Name: %{name}
%define version 2.6.0
%define release 10
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.xz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
Requires: e-smith-base, LPRng
Requires: e-smith-lib >= 1.15.1-19
Requires: e-smith-formmagick >= 1.4.0-12
BuildRequires: e-smith-devtools >= 1.13.1-03
BuildRequires: grep
BuildArchitectures: noarch
AutoReqProv: no
%description
e-smith server and gateway software - LPRng module.
Add printing features, using the LPRng package.
%changelog
* Wed Jul 12 2023 cvs2git.sh aka Brian Read <brianr@koozali.org> 2.6.0-10.sme
- Roll up patches and move to git repo [SME: 12338]
* Wed Jul 12 2023 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Sun Jul 17 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.6.0-9.sme
- untainting port cleanly [SME: 12106]
* Fri Feb 12 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-7.sme
- remove /usr/lib/systemd/system-preset/80-koozali-LPRng.preset [SME: 10958]
* Thu Dec 10 2020 Michel Begue <mab974@gmail.com> 2.6.0-6.sme
- Add 'Requires:runit.service' [SME: 11245]
- Add a fragment for lpd in 49-koozali.preset [SME: 11006]
* Thu Nov 19 2020 Michel Begue <mab974@gmail.com> 2.6.0-5.sme
- Remove init.d/supervise/lpd link [SME: 11006]
* Wed Nov 11 2020 Michel Begue <mab974@gmail.com> 2.6.0-4.sme
- keep runit service for systemd [SME: 11006]
- fix update event name [SME: 11007]
* Sat Sep 05 2020 Michel Begue <mab974@gmail.com> 2.6.0-3.sme
- from service to systemd [SME: 11006]
- add lpd-update event [SME: 11007]
* Thu May 12 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-2.sme
- Rebuild for [SME: 9393]
* Fri Feb 05 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 2.6.0-1.sme
- Initial release to sme10
* Wed Feb 13 2013 Shad L. Lords <slords@mail.com> 2.4.0-1.sme
- Roll new stream for sme9
- Perl modules moved to /usr/share/perl5/vendor_perl [SME: 7223]
* Tue Oct 7 2008 Shad L. Lords <slords@mail.com> 2.2.0-1.sme
- Roll new stream to separate sme7/sme8 trees [SME: 4633]
* Sun Apr 27 2008 Jonathan Martens <smeserver-contribs@snetram.nl> 1.14.0-9
- Add common <base> tags to e-smith-formmagick's general [SME: 4291]
* Wed Mar 12 2008 Shad L. Lords <slords@mail.com> 1.14.0-8
- Cleanup CREATE/ADD tag mixup [SME: 4045]
* Wed Feb 13 2008 Stephen Noble <support@dungog.net> 1.14.0-7
- Remove <base> tags now in general [SME: 3920]
* Tue Jan 08 2008 Stephen Noble <support@dungog.net> 1.14.0-6
- Warn not to use bad terms on Add Printer page [SME: 3667]
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
- Clean up spec so package can be built by koji/plague
* Fri Apr 06 2007 Shad L. Lords <slords@mail.com> 1.14.0-5
- Remove duplicate papd.conf fragment. [SME: 1026]
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
- Update to new release naming. No functional changes.
- Make Packager generic
* Wed Apr 19 2006 Charlie Brady <charlie_brady@mitel.com> 1.14.0-03
- Run printer-create during bootstrap-console-save, to ensure that
spools exist after restore. [SME: 1280]
* Sat Apr 8 2006 Charlie Brady <charlieb@e-smith.com> 1.14.0-02
- Respect UseClientDriver property in smb.conf template fragment.
[SME: 1216]
* Thu Mar 16 2006 Gordon Rowell <gordonr@gormand.com.au> 1.14.0-01
- Roll stable stream version. [SME: 1016]
* Tue Dec 20 2005 Gordon Rowell <gordonr@gormand.com.au> 1.13.3-09
- Revert last patch - not required for supervised services [SME: 351]
* Tue Dec 20 2005 Gordon Rowell <gordonr@gormand.com.au> 1.13.3-08
- And add lpd shutdown links [SME: 351]
* Tue Dec 20 2005 Gordon Rowell <gordonr@gormand.com.au> 1.13.3-07
- Redo -06 with missed patch from -03 [SME: 351]
* Tue Dec 20 2005 Gordon Rowell <gordonr@gormand.com.au> 1.13.3-06
- Create rc?.d and /service symlinks [SME: 351]
* Wed Nov 30 2005 Gordon Rowell <gordonr@gormand.com.au> 1.13.3-05
- Bump release number only
* Mon Nov 21 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.3-04]
- Add /etc/atalk/papd.conf/20printers template (moved from e-smith-netatalk).
[SF: 1361338]
* Mon Nov 21 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.3-03]
- Fix spec file formatting error, resulting in last patch being omitted.
Move service startup symlink creation into createlinks script.
[SF: 1362872]
* Wed Nov 16 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.3-02]
- Use sigterm to reconfigure lpd, since sighup doesn't seem to work reliably.
[SF: 1358283]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.13.3-01]
- Remove L10Ns from base packages [SF: 1309520]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.13.2-01]
- New dev stream before relocating L10Ns
* Fri Sep 30 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.13.1-13]
- Added Italian L10N - Thanks Filippo Carletti [SF: 1309266]
* Mon Sep 26 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.13.1-12]
- Added German L10N - Thanks Dietmar Berteld [SF: 1293325]
* Fri Aug 26 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-11]
- Fix template expansion of /etc/printcap. [SF: 1273768]
- Remove unused and deprecated code from printer-{create,delete}.
* Tue Jul 19 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-10]
- Update to current db access APIs. Patch by Shad Lords. [SF: 1216546]
* Thu Mar 17 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-09]
- Add missing /etc/e-smith/template.metadata tree (which handles
the lpd.perms relocation, without moving the template files).
* Wed Mar 16 2005 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-08]
- Replace all LPRng-restart actions with call to 'adjust-services'.
Use signhup rather than restart - supported by new LPRng.
[MN00065576]
- Use generic_template_expand action in place of LPRng-conf.
[MN00064130]
- Relocate /etc/lpd.perms to /etc/lpd/lpd.perms
- Remove obsolete printer-create-spool event directory
* Wed Dec 29 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-07]
- Add down file, take II. This time for sure, Rocky! [MN00061223]
* Fri Dec 24 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-06]
- Add down file so that supervised lpd stays down until started
by rc7.d symlink. [MN00061223]
* Fri Dec 24 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-05]
- Use /etc/rc.d/init.d, not /etc/init.d (which is a symlink) [MN00061223]
* Thu Dec 16 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-04]
- Add missing execute permission for lpd run script [charlieb MN00061223]
* Thu Dec 16 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-03]
- Fix /etc/init.d/supervise/lpd symlink path [charlieb MN00061223]
* Mon Dec 13 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-02]
- Run lpd under supervise. [charlieb MN00061223]
* Mon Dec 13 2004 Charlie Brady <charlieb@e-smith.com>
- [1.13.1-01]
- New development stream - 1.13.1
* Tue Jul 6 2004 Michael Soulier <msoulier@e-smith.com>
- [1.13.0-02]
- s/get/prop in LPRng-restart. [msoulier MN00036163]
* Thu Jan 22 2004 Michael Soulier <msoulier@e-smith.com>
- [1.13.0-01]
- rolling to dev - 1.13.0
* Thu Jan 22 2004 Michael Soulier <msoulier@e-smith.com>
- [1.12.0-01]
- rolling to stable - 1.12.0
* Tue Jan 6 2004 Michael Soulier <msoulier@e-smith.com>
- [1.11.0-06]
- Added 6.0 styling to printer panel. [msoulier 10876]
* Tue Nov 25 2003 Michael Soulier <msoulier@e-smith.com>
- [1.11.0-05]
- Added "use client driver" option to smb.conf. [msoulier 10623]
* Thu Aug 28 2003 Charlie Brady <charlieb@e-smith.com>
- [1.11.0-04]
- Check for enabled status before trying to restart.
[charlieb 9861]
* Tue Aug 19 2003 Charlie Brady <charlieb@e-smith.com>
- [1.11.0-03]
- Replace LPRng-conf-startup action with default db fragments.
[charlieb 9553]
* Tue Aug 19 2003 Charlie Brady <charlieb@e-smith.com>
- [1.11.0-02]
- Expand /etc/printcap unconditionally. [charlieb 9199]
* Tue Aug 19 2003 Charlie Brady <charlieb@e-smith.com>
- [1.11.0-01]
- Changing version to development stream number - 1.11.0
* Wed Jul 16 2003 Charlie Brady <charlieb@e-smith.com>
- [1.10.0-02]
- Remove obsolete printer-migrate action. [charlieb 9367]
- s/Copyright/License/ in RPM header.
* Thu Jun 26 2003 Charlie Brady <charlieb@e-smith.com>
- [1.10.0-01]
- Changing version to stable stream number - 1.10.0
* Tue Jun 24 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.9.0-20]
- Spanish nav bar [gordonr 9153]
* Tue May 6 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-19]
- Add Spanish lexicon for printers [lijied 3793]
* Thu Apr 24 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-18]
- Change button name "Add Printer" to "Add printer" [lijied 8491]
* Wed Apr 16 2003 Tony Clayton <apc@e-smith.com>
- [1.9.0-17]
- Remove module-load-usb-printer action and local event references [tonyc 6556]
* Tue Apr 8 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-16]
- Standardize the button name [lijied 7921]
* Fri Apr 4 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-15]
- Changed $q->table to $q->start_table where necessary [lijied 8034]
* Thu Mar 27 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-14]
- Modified French lexicon to use lang="fr", rename the lexicon
directory to fr [lijied 6787]
* Mon Mar 17 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-13]
- Deleted empty template-end files,
deleted inappropariate template-begin files [lijied 3295]
* Thu Mar 6 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-12]
- Modified printers panel order [lijied 7356]
* Tue Mar 4 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-11]
- Split en-us lexicon from printer panel [lijied 4030]
* Mon Mar 3 2003 Lijie Deng <lijied@e-smith.com>
- [1.9.0-10]
- Added French lexicon for printers. [lijied 5003]
* Sat Jan 25 2003 Mike Dickson <miked@e-smith.com>
- [1.9.0-09]
- added lexicon tag for 'Action' [miked 6363]
* Thu Jan 2 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.9.0-08]
- And add LPRng-conf-startup here [gordonr 5509]
* Thu Jan 2 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.9.0-07]
- And add the lpd startup here [gordonr 5509]
* Thu Jan 2 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.9.0-06]
- Split lpd startup from e-smith-base [gordonr 5509]
* Fri Dec 27 2002 Mike Dickson <miked@e-smith.com>
- [1.9.0-05]
- minor UI update [miked 5494]
* Mon Dec 16 2002 Mike Dickson <miked@e-smith.com>
- [1.9.0-04]
- UI Update, part of the tweaking for the new UI [miked 5494]
* Mon Dec 2 2002 Mike Dickson <miked@e-smith.com>
- [1.9.0-03]
- ui update [miked 5494]
* Thu Nov 21 2002 Mike Dickson <miked@e-smith.com>
- [1.9.0-02]
- update to new UI system [miked 5494]
* Thu Nov 7 2002 Charlie Brady <charlieb@e-smith.com>
- [1.9.0-01]
- Roll development stream to 1.9.0
* Fri Nov 1 2002 Charlie Brady <charlieb@e-smith.com>
- [1.8.0-02]
- Try to load low level USB drivers before loading printer module.
[charlieb 5288]
* Fri Oct 11 2002 Charlie Brady <charlieb@e-smith.com>
- [1.8.0-01]
- Rolling stable version number to 1.8.0
* Wed Oct 2 2002 Mark Knox <markk@e-smith.com>
- [1.7.3-04]
- Removed stray braces from templates [markk 3786]
* Mon Sep 23 2002 Charlie Brady <charlieb@e-smith.com>
- [1.7.3-03]
- Fix a problem with the "deprecate split" template re-ord. [charlieb 3786]
* Tue Sep 10 2002 Mark Knox <markk@e-smith.com>
- [1.7.3-02]
- Remove deprecated split on pipe [markk 3786]
* Fri Aug 30 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.7.3-01]
- Fixed typo in "Hostname of IP address" [gordonr 4750]
* Mon Aug 26 2002 Mark Knox <markk@e-smith.com>
- [1.7.2-01]
- Limit name and description fields to 32 chars for Appletalk [markk 4322]
* Fri Aug 2 2002 Tony Clayton <apc@e-smith.com>
- [1.7.1-01]
- change if(scalar %printers) to if(keys %printers) as a workaround to
perl-5.6.1 bug with tied hashes [tonyc 4537]
* Wed Jun 5 2002 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-01]
- Changing version to maintained stream number to 1.7.0
* Tue May 28 2002 Kirrily Robert <skud@e-smith.com>
- [1.6.7-01]
- remoteaddress field now checked for valid hostname/ip [skud 3691]
* Thu May 23 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.6.5-01]
- RPM rebuild forced by cvsroot2rpm
* Wed May 1 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.6.4-01]
- esmith::AccountDB -> esmith::AccountsDB [schwern 3287]
* Mon Apr 15 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.6.3-01]
- Language en->en-us
* Thu Apr 11 2002 Mark Knox <markk@e-smith.com>
- [1.6.2-01]
- Converted all code to FormMagick panel and placed it in
esmith::FormMagick::Panel::printers [markk 3156]
- Internationalized [markk 3156]
- Converted to AccountDB API. [markk 3156]
- Added tests dir and test suite. Automatically build suite via buildtests.
[markk 3156]
* Thu Apr 11 2002 Mark Knox <markk@e-smith.com>
- [1.6.1-01]
- rollRPM: Rolled version number to 1.6.1-01. Includes patches up to 1.6.0-02.
* Tue Dec 11 2001 Adrian Chung <adrianc@e-smith.com>
- [1.6.0-02]
- Adding module-load-usb-printer action
- Linking into "local" event.
* Tue Dec 11 2001 Adrian Chung <mac@e-smith.com>
- [1.6.0-01]
- rollRPM: Rolled version number to 1.6.0-01. Includes patches up to 1.5.0-06.
* Wed Nov 14 2001 Charlie Brady <charlieb@e-smith.com>
- [1.5.0-06]
- Add missing hidden state variable in network printer create form.
* Tue Nov 13 2001 Charlie Brady <charlieb@e-smith.com>
- [1.5.0-05]
- Changed "Network Printer (Specify below)" => "Network Printer ..." (thanks
to DanY for reporting).
* Fri Nov 9 2001 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-04]
- Left-justified smb.conf fragments
* Fri Nov 2 2001 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-03]
- Remove comments from output file and unify indentation
* Thu Oct 25 2001 Charlie Brady <charlieb@e-smith.com>
- [1.5.0-02]
- Break "Add printer" screen into two pages, so that network parameter
form elements only appear if a network printer is being added.
* Fri Oct 12 2001 Charlie Brady <charlieb@e-smith.com>
- [1.5.0-01]
- Rolled version number to 1.5.0-01. Includes patches upto 1.4.0-04.
- Add missing event directories to tarball - remove mkdirs from %build.
* Fri Oct 12 2001 Charlie Brady <charlieb@e-smith.com>
- [1.4.0-04]
- Add support for /dev/usb/{lp0,lp1}
* Tue Aug 28 2001 Charlie Brady <charlieb@e-smith.com>
- [1.4.0-03]
- Fixed problem with printer-delete expecting wrong type
- Fixed problem with printer-delete script not having "use esmith::db;".
* Fri Aug 17 2001 gordonr
- [1.4.0-02]
- Autorebuild by rebuildRPM
* Wed Aug 8 2001 Charlie Brady <charlieb@e-smith.com>
- [1.4.0-01]
- Rolled version number to 1.4.0-01. Includes patches upto 1.3.0-03.
* Fri Jul 6 2001 Peter Samuel <peters@e-smith.com>
- [1.3.0-03]
- Changed license to GPL
* Wed Apr 11 2001 Adrian Chung <adrianc@e-smith.com>
- [1.3.0-02]
- changing h4 tags to paragraph bold tags.
* Wed Apr 11 2001 Adrian Chung <mac@e-smith.com>
- [1.3.0-01]
- Rolled version number to 1.3.0-01. Includes patches upto 1.2.0-07.
* Mon Feb 12 2001 Charlie Brady <charlieb@e-smith.com>
- [1.2.0-07]
- Change ownership of printspools to lp.lp (not daemon.daemon).
- Remove obsolete :sf: property from /etc/printcap
* Thu Feb 8 2001 Adrian Chung <adrianc@e-smith.com>
- Rolled version to GPG sign package.
* Mon Jan 29 2001 Paul Nesbit <pkn@e-smith.com>
- [1.2.0-05]
- contents of $OUT now being display properly (I claimed it w/ my)
* Mon Jan 29 2001 Paul Nesbit <pkn@e-smith.com>
- [1.2.0-04]
- fixed bug in printcap template (contents of $OUT were not being returned)
- added missing $printer variable to db_get_prop call
* Mon Jan 29 2001 Paul Nesbit <pkn@e-smith.com>
- [1.2.0-03]
- moved printcap template processing from template-begin to 05printers
- recoded to use accounts db instead of printers db
- updated code to use db utils
* Thu Jan 25 2001 Jason Miller <jmiller@e-smith.com>
- [1.2.0-02]
- Fixed printer-migrate action to call printer-create-spool
when it used to say printer-spool-create (a non-existant
action) as well as a minor compile error regarding db_set
* Thu Jan 25 2001 Peter Samuel <peters@e-smith.com>
- [1.2.0-01]
- Rolled version number to 1.2.0-01. Includes patches upto 1.1.0-04.
* Thu Jan 25 2001 Charlie Brady <charlieb@e-smith.com>
- Migrate "printers" database entries in "accounts" db.
- Iterate over printer entries during post-upgrade (for
use in restore). "printer-create-spool" event created
for this, and printer-create script modified so that it
is non-fatal to run it more than once.
- Replace direct access to hashes to use of esmith::db.
* Tue Jan 23 2001 Gordon Rowell <gordonr@e-smith.com>
- Renamed action scripts to <package>-action form
* Fri Jan 05 2001 Jason Miller <jmiller@e-smith.com>
- updated copyright information and added prototypes
for all subroutines to avoid the warning messages
sent to the log files
* Fri Nov 10 2000 Peter Samuel <peters@e-smith.com>
- Rolled version number to 1.1.0. Includes patches up to 0.2-2.
* Mon Oct 30 2000 Charlie Brady <charlieb@e-smith.com>
- Merge services database back into configuration database
* Thu Oct 26 2000 Peter Samuel <peters@e-smith.com>
- Rolled version number to 0.2. Includes patches up to 0.1-17.
* Thu Oct 19 2000 Adrian Chung <adrian.chung@e-smith.com>
- Updated scripts in web/functions directory to pass
merged configuration/services hash to esmith::cgi
functions.
* Fri Oct 06 2000 Tony Clayton <tonyc@e-smith.com>
- Fixed require dependency (was e-smith-lib >= 1.0-21)
* Fri Oct 06 2000 Adrian Chung <adrian.chung@e-smith.com>
- Removed %post directive. Enabling this service is handled
for now in e-smith-base.
- Added require dependency for e-smith-lib.
* Wed Oct 04 2000 Adrian Chung <adrian.chung@e-smith.com>
- Changed restart action to use serviceControl(restart).
* Wed Oct 04 2000 Adrian Chung <adrian.chung@e-smith.com>
- Changed so that templates are only expanded if service is enabled.
* Tue Oct 03 2000 Charlie Brady <charlieb@e-smith.com>
- Make lpd restart depend on services database.
* Tue Oct 03 2000 Adrian Chung <mac@e-smith.com>
- Rebuilt on allspice.
* Thu Sep 28 2000 Paul Nesbit <pkn@e-smith.com>
- updated URL and support contact info
* Tue Sep 26 2000 Peter Samuel <peters@e-smith.com>
- upgraded createlinks to a perl script using standard event_link
- and panel_link subroutines
- upgraded spec file to use /sbin/e-smith/genfilelist instead of
- hardwired internal routines
- created /etc/lpd.perms template to tighten security
- added conf-LPRng action to:
- console-save, network-create and network-delete
- added restart-LPRng action to
- network-create and network-delete
* Wed Jul 12 2000 Joseph Morrison <jdm@e-smith.net>
- Add -1 argument to split command in case of blank last configuration field
* Tue Jun 13 2000 Charlie Brady <charlieb@e-smith.net>
- Fix missing panel/manager/cgi-bin directory
- Add missing "print command = .." line in smb.conf
* Mon Jun 12 2000 Charlie Brady <charlieb@e-smith.net>
- Add missing conf-LPRng action script
- Fix some broken event symlinks
* Thu Jun 1 2000 Charlie Brady <charlieb@e-smith.net>
- First created - broken out of e-smith-base 4.0.11.
%prep
%setup
%build
perl createlinks
/sbin/e-smith/buildtests 30e-smith-LPRng
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-%{release}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--file /var/service/lpd/run 'attr(0755,root,root)' \
> %{name}-%{version}-%{release}-filelist
echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
%post
rm -f /etc/lpd.perms
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}-%{release}-filelist
%defattr(-,root,root)

@ -0,0 +1,65 @@
#!/usr/bin/perl
#----------------------------------------------------------------------
# copyright (C) 1999 Ip, Tak Hong
# copyright (C) 2000-2006 Mitel Networks Corporation
#
# 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
#
#----------------------------------------------------------------------
package esmith;
use strict;
use warnings;
use Errno;
use esmith::util;
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();
my $event = $ARGV [0];
my $printerName = $ARGV [1];
my @printers;
#------------------------------------------------------------
# Create the printer
#------------------------------------------------------------
if ($printerName)
{
my $p = $adb->get($printerName);
die "Invalid printer $printerName; create printer failed.\n"
unless ($p and $p->prop('type') eq 'printer');
@printers = ($p);
}
else
{
@printers = $adb->printers;
}
foreach (@printers)
{
$printerName = $_->key;
unless (-d "/var/spool/lpd/$printerName")
{
mkdir ("/var/spool/lpd/$printerName", 0700)
or die "Could not create spool directory " .
"'/var/spool/lpd/$printerName'; $! : create printer failed.\n";
esmith::util::chownFile ("lp", "lp", "/var/spool/lpd/$printerName");
}
}
exit (0);

@ -0,0 +1,48 @@
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# copyright (C) 1999 Ip, Tak Hong
# copyright (C) 2000-2005 Mitel Networks Corporation
#
# 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
#
#----------------------------------------------------------------------
package esmith;
use strict;
use Errno;
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();
my $event = $ARGV [0];
my $printerName = $ARGV [1];
#------------------------------------------------------------
# delete the printer
#------------------------------------------------------------
die "printerName argument missing." unless defined ($printerName);
my $p = $adb->get($printerName);
die "Invalid printer $printerName; delete printer failed.\n" unless
(defined $p && $p->prop('type') eq 'printer-deleted');
system("/bin/rm", "-rf", "/var/spool/lpd/$printerName") == 0
or die "Could not delete spool directory '/var/spool/lpd/$printerName';" .
"delete printer failed.\n";
exit (0);

@ -0,0 +1,177 @@
<lexicon lang="en-us">
<entry>
<base>FORM_TITLE</base>
<trans>Add or remove printers</trans>
</entry>
<entry>
<base>INITIAL_DESC</base>
<trans>
<![CDATA[
<P><A class="button-like" HREF="printers?page=0&Next=Add">Add printer</A></P>
]]>
</trans>
</entry>
<entry>
<base>NO_PRINTERS</base>
<trans>There are no printers in the system.</trans>
</entry>
<entry>
<base>CURRENT_LIST</base>
<trans>Current List of printers</trans>
</entry>
<entry>
<base>REMOTE_ADDRESS</base>
<trans>Remote address</trans>
</entry>
<entry>
<base>REMOTE_NAME</base>
<trans>Remote name</trans>
</entry>
<entry>
<base>CREATE_NEW_PRINTER</base>
<trans>Create a new printer</trans>
</entry>
<entry>
<base>CREATE_NEW_DESC</base>
<trans>
Please choose a unique name for the printer and enter a brief
description. The printer name should contain only lower-case
letters and numbers, and should start with a lower-case
letter. For example "hplaser", "epsonlp", and
"canonbj" are valid choices, but "HP Laser Jet",
"Canon BubbleJet", and
"HP JetDirect Printer" are not.
Avoid names and descriptions that contain these terms,
"offline", "disabled", "down", "off", "waiting", "jam",
"paper", "error" and "responding".
</trans>
</entry>
<entry>
<base>PRINTER_NAME</base>
<trans>Printer name</trans>
</entry>
<entry>
<base>LOCAL_PRINTER_0</base>
<trans>Local printer port 0 (LPT1)</trans>
</entry>
<entry>
<base>LOCAL_PRINTER_1</base>
<trans>Local printer port 1 (LPT2)</trans>
</entry>
<entry>
<base>LOCAL_PRINTER_2</base>
<trans>Local printer port 2 (LPT3)</trans>
</entry>
<entry>
<base>NET_PRINTER</base>
<trans>Network printer ...</trans>
</entry>
<entry>
<base>FIRST_USB_PRINTER</base>
<trans>First USB attached printer</trans>
</entry>
<entry>
<base>SECOND_USB_PRINTER</base>
<trans>Second USB attached printer</trans>
</entry>
<entry>
<base>ERR_UNEXPECTED_NAME</base>
<trans>
<![CDATA[
<P>Error: unexpected characters in printer name.</P>
<P>The printer name should contain only lower-case
letters and numbers, and should start with a lower-case
letter. For example "hplaser", "epsonlp", and
"canonbj" are valid names.</P>
]]>
</trans>
</entry>
<entry>
<base>ERR_UNEXPECTED_DESC</base>
<trans>
Error: unexpected or missing characters in description.
Did not create new printer.
</trans>
</entry>
<entry>
<base>ERR_EXISTS</base>
<trans>Error: An account with the same name exists with type: </trans>
</entry>
<entry>
<base>ERR_INVALID_ADDRESS</base>
<trans>Error: invalid network address. Did not create new printer.</trans>
</entry>
<entry>
<base>ERR_INVALID_REMOTE_NAME</base>
<trans>Error: invalid network printer name. Did not create new printer.</trans>
</entry>
<entry>
<base>ERR_CREATING</base>
<trans>Error occurred while creating printer.</trans>
</entry>
<entry>
<base>CREATED_SUCCESSFULLY</base>
<trans>Successfully created printer: </trans>
</entry>
<entry>
<base>CREATE_NETWORK_PRINTER</base>
<trans>Create a new network printer</trans>
</entry>
<entry>
<base>ERR_OPENING_DB</base>
<trans>Error occurred while opening accounts database.</trans>
</entry>
<entry>
<base>CREATE_NETWORK_DESC</base>
<trans>Please enter the address and name of the network printer</trans>
</entry>
<entry>
<base>HOSTNAME_OR_IP</base>
<trans>Hostname or IP address of the network printer</trans>
</entry>
<entry>
<base>REMOTE_NAME_DESC</base>
<trans>
<![CDATA[
Network printer name (enter raw if not sure)
]]>
</trans>
</entry>
<entry>
<base>REMOVE_PRINTER</base>
<trans>Remove printer</trans>
</entry>
<entry>
<base>ABOUT_TO_REMOVE</base>
<trans>You are about to remove the printer: </trans>
</entry>
<entry>
<base>SPOOL_FILE_WARNING</base>
<trans>All the spool files for this printer will be deleted.</trans>
</entry>
<entry>
<base>ARE_YOU_SURE</base>
<trans>Are you sure you wish to remove this printer?</trans>
</entry>
<entry>
<base>ERR_INTERNAL_FAILURE</base>
<trans>Error: internal failure while removing printer: </trans>
</entry>
<entry>
<base>ERR_DELETING</base>
<trans>Error occurred while deleting printer.</trans>
</entry>
<entry>
<base>DELETED_SUCCESSFULLY</base>
<trans>Successfully deleted printer: </trans>
</entry>
<entry>
<base>MUST_BE_VALID_HOSTNAME_OR_IP</base>
<trans>Must be a valid hostname or IP number</trans>
</entry>
<entry>
<base>Printers</base>
<trans>Printers</trans>
</entry>
</lexicon>

@ -0,0 +1,9 @@
#--------------------------------------------------------------------------
#
# Printing (ie unspooling) requests
#
#--------------------------------------------------------------------------
# Accept all requests
ACCEPT SERVICE=P

@ -0,0 +1,9 @@
#--------------------------------------------------------------------------
#
# Spooling (ie lpr) requests
#
#--------------------------------------------------------------------------
# Accept all requests
ACCEPT SERVICE=R

@ -0,0 +1,15 @@
#--------------------------------------------------------------------------
#
# Control (ie lpc) requests
#
#--------------------------------------------------------------------------
# Allow root on the server to control jobs
ACCEPT SERVICE=C SERVER REMOTEUSER=root
# Allow all others access only to server, status and printcap
ACCEPT SERVICE=C LPC=lpd,status,printcap
# Reject all other requests
REJECT SERVICE=C

@ -0,0 +1,15 @@
#--------------------------------------------------------------------------
#
# Removal (ie lprm) requests
#
#--------------------------------------------------------------------------
# Allow same user on originating host to remove a job
ACCEPT SERVICE=M SAMEHOST SAMEUSER
# Allow root on the server to remove a job
ACCEPT SERVICE=M SERVER REMOTEUSER=root
# Reject all other requests
REJECT SERVICE=M

@ -0,0 +1,9 @@
#--------------------------------------------------------------------------
#
# Information (ie lpq) requests
#
#--------------------------------------------------------------------------
# Allow all requests
ACCEPT SERVICE=Q

@ -0,0 +1,37 @@
#--------------------------------------------------------------------------
#
# Connection access. This controls access to ALL the request types. If
# a host does not match one of these rules it will be denied access,
# regardless of ANY of the other rules above.
#
#--------------------------------------------------------------------------
# Allow connections from the localhost
ACCEPT SERVICE=X REMOTEIP=127.0.0.1
# Allow connections from subnets in our control
{
use esmith::NetworksDB;
my $ndb = esmith::NetworksDB->open_ro();
my $prefix = "ACCEPT SERVICE=X REMOTEIP=";
my ($network, undef) =
esmith::util::computeNetworkAndBroadcast($LocalIP, $LocalNetmask);
my $result = $prefix . "${network}/${LocalNetmask}";
foreach my $net ($ndb->get_all_by_prop(type=>'network'))
{
my $key = $net->key;
my %properties = $net->props;
$result .= "\n" . $prefix . "${key}/$properties{'Mask'}";
}
return $result;
}
# Reject all other connections
REJECT SERVICE=X

@ -0,0 +1,9 @@
#--------------------------------------------------------------------------
#
# Default action
#
#--------------------------------------------------------------------------
# Reject anything which has not been explicitly allowed
DEFAULT=REJECT

@ -0,0 +1,13 @@
#--------------------------------------------------
# Example printcap entry:
#
# hplaser|HP Laser 5:\
# :server:\
# :mx#0:\
# :sh:\
# :ff_separator=false:\
# :sd=/var/spool/lpd/hplaser:\
# :lp=/dev/lp0:
#--------------------------------------------------

@ -0,0 +1,42 @@
{
# process all accounts
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();
$OUT = "";
foreach my $printer ( $adb->printers )
{
$OUT .= "\n";
$OUT .= $printer->key;
$OUT .= "|" . $printer->prop('Description') . ":\\\n";
$OUT .= "\t:server:\\\n";
$OUT .= "\t:mx#0:\\\n";
$OUT .= "\t:sh:\\\n";
$OUT .= "\t:ff_separator=false:\\\n";
$OUT .= "\t:sd=/var/spool/lpd/" . $printer->key . ":\\\n";
if ($printer->prop('Location') eq 'remote')
{
$OUT .= "\t:rm=" . $printer->prop('Address') . ":\\\n";
# no trailing backslash for last entry
if (defined $printer->prop('RemoteName'))
{
$OUT .= "\t:rp=" . $printer->prop('RemoteName') . ":\n";
}
else
{
$OUT .= "\t:rp=raw:\n";
}
}
else
{
# no trailing backslash for last entry
$OUT .= "\t:lp=/dev/" . $printer->prop('Location') . ":\n";
}
}
}

@ -0,0 +1,14 @@
{
# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
$OUT .= <<HERE;
printcap name = /etc/printcap
load printers = yes
printing = lprng
print command = /usr/bin/lpr -b -h -r -P%p %s
HERE
}

@ -0,0 +1,16 @@
{
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
# Set public = yes to allow user 'guest account' to print
$OUT = <<HERE;
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
HERE
$OUT .= "use client driver = ";
$OUT .= $smb{UseClientDriver} || "yes";
}

@ -0,0 +1,7 @@
# lpd specific service (lpd in init.d)
{
$status = $lpd{status} || 'disabled';
$status = ($status eq "enabled") ? "enable" : "disable";
$OUT .= "$status lpd.service\n";
}

@ -0,0 +1,6 @@
# DO NOT MODIFY THIS FILE.
# This file is automatically maintained by the Mitel Networks SME Server
# configuration software. Manually editing this file may put your
# system in an unknown state.
#
# updated: Tue May 28 15:10:57 2002

@ -0,0 +1,83 @@
#!/usr/bin/perl -wT
#----------------------------------------------------------------------
# heading : Configuration
# description : Printers
# navigation : 6000 6400
#
# copyright (C) 2002 Mitel Networks Corp.
#
# 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
#
#----------------------------------------------------------------------
use strict;
use esmith::FormMagick::Panel::printers;
my $fm = esmith::FormMagick::Panel::printers->new();
$fm->display();
__DATA__
<form title="FORM_TITLE" header="/etc/e-smith/web/common/head.tmpl"
footer="/etc/e-smith/web/common/foot.tmpl">
<page name="First" pre-event="print_status_message">
<description>INITIAL_DESC</description>
<subroutine src="show_printers()"/>
</page>
<page name="Add" pre-event="print_status_message"
post-event="create_printer">
<title>CREATE_NEW_PRINTER</title>
<description>CREATE_NEW_DESC</description>
<field id="name" type="text" validation="nonblank, maxlength(32)">
<label>PRINTER_NAME</label>
</field>
<field id="description" type="text" validation="nonblank, maxlength(32)">
<label>DESCRIPTION_BRIEF</label>
</field>
<field id="location" type="select" options="'lp0'=>'LOCAL_PRINTER_0',
'lp1'=>'LOCAL_PRINTER_1','lp2'=>'LOCAL_PRINTER_2','remote'=>'NET_PRINTER',
'usb/lp0'=>'FIRST_USB_PRINTER','usb/lp1'=>'SECOND_USB_PRINTER'"
value="remote" validation="nonblank">
<label>LOCATION</label>
</field>
<subroutine src="print_button('ADD')"/>
</page>
<page name="AddNetwork" pre-event="turn_off_buttons"
post-event="create_printer">
<title>CREATE_NETWORK_PRINTER</title>
<description>CREATE_NETWORK_DESC</description>
<field id="address" type="text" validation="hostname_or_ip">
<label>HOSTNAME_OR_IP</label>
</field>
<field id="remoteName" type="text" value="raw" validation="nonblank">
<label>REMOTE_NAME_DESC</label>
</field>
<subroutine src="print_hidden_fields()"/>
<subroutine src="print_button('ADD')"/>
</page>
<page name="Delete" pre-event="turn_off_buttons">
</page>
<page name="ConfirmDelete" pre-event="turn_off_buttons"
post-event="delete_printer">
<title>REMOVE_PRINTER</title>
<subroutine src="show_delete_confirmation()"/>
<subroutine src="print_button('REMOVE')"/>
</page>
</form>

@ -0,0 +1,15 @@
[Unit]
Description=lpd, LPRng print spool
After=network.target
Requires=runit.service
[Service]
Type=oneshot
ExecStartPre=/sbin/e-smith/service-status lpd
ExecStart=/usr/bin/sv u /service/lpd
ExecStop=/usr/bin/sv stop /service/lpd
ExecReload=/usr/bin/sv t /service/lpd
RemainAfterExit=yes
[Install]
WantedBy=sme-server.target

@ -0,0 +1,486 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2002 Mitel Networks Corporation
#
# $Id: printers.pm,v 1.9 2004/01/07 01:43:22 msoulier Exp $
#
#----------------------------------------------------------------------
package esmith::FormMagick::Panel::printers;
use esmith::FormMagick;
use esmith::AccountsDB;
use esmith::cgi;
use Exporter;
our @ISA = qw(esmith::FormMagick Exporter);
our @EXPORT = qw(
show_printers create_printer print_hidden_fields
show_delete_confirmation delete_printer
hostname_or_ip
);
our @VERSION = sprintf '%d.%03d', q$Revision: 1.9 $ =~ /: (\d+).(\d+)/;
=pod
=head1 NAME
esmith::FormMagick::Panel::printers - useful panel functions
=head1 SYNOPSIS
use esmith::FormMagick::Panel::printers;
my $panel = esmith::FormMagick::Panel::printers->new();
$panel->display();
=head1 DESCRIPTION
=head2 new
Exactly as for esmith::FormMagick.
=begin testing
use_ok('esmith::FormMagick::Panel::printers');
$FM = esmith::FormMagick::Panel::printers->new();
isa_ok($FM, 'esmith::FormMagick::Panel::printers');
$FM->{testing} = 1; # set test mode
$FM->{cgi} = CGI->new();
truncate("30e-smith-LPRng/accounts",0);
=end testing
=cut
sub new
{
shift;
my $self = esmith::FormMagick->new();
$self->{calling_package} = (caller)[0];
bless $self;
return $self;
}
=head2 hostname_or_ip
Validation routine for the remote address field for network printers.
=for testing
my $fm = esmith::FormMagick::Panel::printers->new();
can_ok('main', 'hostname_or_ip');
can_ok('CGI::FormMagick::Validator', 'ip_number');
isnt(CGI::FormMagick::Validator::ip_number($fm, '1.2.3'), "OK", "ip_number works OK");
like(CGI::FormMagick::Validator::ip_number($fm, '1.2.3'), qr(enough octets), "ip_number works OK");
foreach ("1.2.3.4", "255.255.255.255", "foo.com", "foo.bar.com", "123.foo.xxx"){
is(hostname_or_ip($fm, $_), "OK", "$_ should be OK");
}
foreach ("1.2.3", "foo bar", "foo;bar;com", " ", undef) {
isnt(hostname_or_ip($fm, $_), "OK", "$_ should not be OK");
}
=cut
sub hostname_or_ip
{
my ($fm, $data) = @_;
if ($data =~ /^[\d\.]+$/) {
if (CGI::FormMagick::Validator::ip_number($fm, $data) eq "OK")
{
return "OK";
}
else
{
return "MUST_BE_VALID_HOSTNAME_OR_IP";
}
}
elsif ($data =~ /^([a-zA-Z0-9\.\-]+)$/ )
{
return "OK";
}
else
{
return "MUST_BE_VALID_HOSTNAME_OR_IP";
}
}
=pod
=head2 show_printers
Reads the list of printers from accounts database and shows it as a table.
=begin testing
$FM->show_printers();
like($_STDOUT_, qr/NO_PRINTERS/, 'show_printers');
=end testing
=cut
sub show_printers
{
my $self = shift;
my $q = $self->{cgi};
my $adb;
if ($self->{testing})
{
$adb = esmith::AccountsDB->open('30e-smith-LPRng/accounts');
}
else
{
$adb = esmith::AccountsDB->open();
}
my @printerDrivers;
if ($adb)
{
@printerDrivers = $adb->printers();
}
print '<tr><td colspan="2">';
my $numPrinters = @printerDrivers;
if ($numPrinters == 0)
{
print $q->p($self->localise('NO_PRINTERS'));
}
else
{
print $q->h3($self->localise('CURRENT_LIST'));
print $q->start_table ({-CLASS => "sme-border"});
print $q->Tr (esmith::cgi::genSmallCell($q, $self->localise('NAME'),"header"),
esmith::cgi::genSmallCell($q, $self->localise('DESCRIPTION'),"header"),
esmith::cgi::genSmallCell($q, $self->localise('LOCATION'),"header"),
esmith::cgi::genSmallCell($q, $self->localise('REMOTE_ADDRESS'),"header"),
esmith::cgi::genSmallCell($q, $self->localise('REMOTE_NAME'),"header"),
esmith::cgi::genSmallCell($q, $self->localise('ACTION'),"header"));
my $printer;
foreach $printer (sort @printerDrivers)
{
my $address = ($printer->prop('Location') eq 'remote')
? $printer->prop('Address') : 'N/A';
my $remoteName = ($printer->prop('Location') eq 'remote')
? $printer->prop('RemoteName') : 'N/A';
unless ($remoteName)
{
$remoteName = 'raw';
}
print $q->Tr (esmith::cgi::genSmallCell ($q, $printer->key, "normal"),
esmith::cgi::genSmallCell ($q, $printer->prop('Description'), "normal"),
esmith::cgi::genSmallCell ($q, $printer->prop('Location'), "normal"),
esmith::cgi::genSmallCell ($q, $address, "normal"),
esmith::cgi::genSmallCell ($q, $remoteName, "normal"),
esmith::cgi::genSmallCell ($q,
$q->a ({href => $q->url (-absolute => 1)
."?page=".$self->get_page_by_name('Delete')
."&Next=Delete&printer=". $printer->key},
$self->localise('REMOVE')), "normal"));
}
print $q->end_table,"\n";
}
print '</td></tr>';
return '';
}
=pod
=head2 create_printer
Process the output of the Add page, validate the data and create the printer
if all is well.
=begin testing
$FM->{cgi}->param(-name=>'name', -value=>'testprn');
$FM->{cgi}->param(-name=>'description', -value=>'A test printer');
$FM->{cgi}->param(-name=>'location', -value=>'lp0');
$FM->create_printer();
like($FM->{cgi}->param('status_message'), qr/SUCCESS/, 'create_printer');
=end testing
=cut
sub create_printer
{
my $self = shift;
my $q = $self->{cgi};
#------------------------------------------------------------
# Validate parameters and untaint them
#------------------------------------------------------------
my $name = $q->param ('name');
if ($name =~ /^([a-z][a-z0-9]*)$/)
{
$name = $1;
}
else
{
return $self->error('ERR_UNEXPECTED_NAME', 'Add');
}
my $description = $q->param ('description');
if ($description =~ /^([\'\w\s]+)$/)
{
$description = $1;
}
else
{
return $self->error('ERR_UNEXPECTED_DESC', 'Add');
}
my $location = $q->param ('location');
if ($location =~ /^(lp[0-9]+|remote|usb\/lp0|usb\/lp[0-9]+)$/)
{
$location = $1;
}
else
{
$location = "lp0";
}
my $remoteName = $q->param ('remoteName');
my $address = $q->param ('address');
#------------------------------------------------------------
# Looks good. Find out if this printer has been taken
#------------------------------------------------------------
my $adb;
if ($self->{testing})
{
$adb = esmith::AccountsDB->open('30e-smith-LPRng/accounts')
|| return $self->error('ERR_OPENING_DB');
}
else
{
$adb = esmith::AccountsDB->open()
|| return $self->error('ERR_OPENING_DB');
}
my $rec = $adb->get($name);
my $type;
if ($rec and ($type = $rec->prop('type')))
{
return $self->error('ERR_EXISTS', 'Add');
}
if ($location eq 'remote')
{
unless (defined $address)
{
$q->param(-name=>'wherenext', -value=>'AddNetwork');
return '';
}
if ($address =~ /^([a-zA-Z0-9\.\-]+)$/)
{
$address = $1;
}
else
{
return $self->error('ERR_INVALID_ADDRESS', 'Add');
}
if ($remoteName =~ /^([^\|]*)$/)
{
$remoteName = $1;
}
else
{
return $self->error('ERR_INVALID_REMOTE_NAME', 'Add');
}
}
else
{
$address = "";
$remoteName = "";
}
#------------------------------------------------------------
# Printer name is available! Update printers database and
# singal the create-printer event.
#------------------------------------------------------------
$rec = $adb->new_record($name,
{type=>'printer',
Description => $description,
Address => $address,
RemoteName => $remoteName,
Location => $location});
unless ($self->{testing})
{
system ("/sbin/e-smith/signal-event printer-create $name") == 0
or return $self->error('ERR_CREATING');
}
$self->success('CREATED_SUCCESSFULLY');
}
=pod
=head2 print_hidden_fields
Print hidden fields needed by the AddNetwork page.
=begin testing
$FM->print_hidden_fields();
like($_STDOUT_, qr/name/, 'hidden name field');
like($_STDOUT_, qr/description/, 'hidden description field');
like($_STDOUT_, qr/location/, 'hidden location field');
=end testing
=cut
sub print_hidden_fields
{
my $self = shift;
my $q = $self->{cgi};
my $name = $q->param('name');
my $description = $q->param('description');
my $location = $q->param('location');
print $q->hidden (-name => 'name',
-override => 1, -default => $name);
print $q->hidden (-name => 'description',
-override => 1, -default => $description);
print $q->hidden (-name => 'location',
-override => 1, -default => $location);
return '';
}
=pod
=head2 show_delete_confirmation
Display the delete printer confirmation page contents.
=begin testing
$FM->{cgi}->param(-name=>'printer', -value=>'testprn');
$FM->show_delete_confirmation();
like($_STDOUT_, qr/ABOUT_TO_REMOVE/, 'show_delete_confirmation');
=end testing
=cut
sub show_delete_confirmation
{
my $self = shift;
my $q = $self->{cgi};
my $printer = $q->param ('printer');
unless ($printer)
{
$q->param(-name=>'wherenext', -value=>'First');
return '';
}
my $adb;
if ($self->{testing})
{
$adb = esmith::AccountsDB->open('30e-smith-LPRng/accounts')
|| return $self->error('ERR_OPENING_DB');
}
else
{
$adb = esmith::AccountsDB->open()
|| return $self->error('ERR_OPENING_DB');
}
my $rec = $adb->get($printer);
if ($rec and $rec->prop('type') eq 'printer')
{
my $description = $rec->prop('Description');
print '<tr><td>';
print $q->p($self->localise('ABOUT_TO_REMOVE').
"$printer ($description)");
print $q->p($self->localise('SPOOL_FILE_WARNING'));
print $q->p($q->b($self->localise('ARE_YOU_SURE')));
print '</td></tr>';
}
return '';
}
=pod
=head2 delete_printer
Remove a printer from the accounts database
=begin testing
$FM->{cgi}->param(-name=>'printer', -value=>'testprn');
$FM->delete_printer();
like($FM->{cgi}->param('status_message'), qr/DELETED_SUCCESSFULLY/,
'delete_printer');
=end testing
=cut
sub delete_printer
{
my $self = shift;
my $q = $self->{cgi};
#------------------------------------------------------------
# Attempt to delete printer
#------------------------------------------------------------
my $printer = $q->param ('printer');
if ($printer =~ /^([a-z][a-z0-9]*)$/)
{
$printer = $1;
}
else
{
return $self->error('ERR_INTERNAL_FAILURE');
}
my $adb;
if ($self->{testing})
{
$adb = esmith::AccountsDB->open('30e-smith-LPRng/accounts')
|| return $self->error('ERR_OPENING_DB');
}
else
{
$adb = esmith::AccountsDB->open()
|| return $self->error('ERR_OPENING_DB');
}
my $rec = $adb->get($printer);
unless ($rec)
{
return $self->error('ERR_INTERNAL_FAILURE');
}
$rec->set_prop('type', 'printer-deleted');
unless ($self->{testing})
{
system ("/sbin/e-smith/signal-event printer-delete $printer") == 0
or return $self->error('ERR_DELETING');
}
$rec->delete();
$self->success('DELETED_SUCCESSFULLY');
}
1;

@ -0,0 +1,2 @@
#! /bin/sh
exec /usr/sbin/lpd -F
Loading…
Cancel
Save