-
Notifications
You must be signed in to change notification settings - Fork 0
/
ppr.spec
250 lines (202 loc) · 7.93 KB
/
ppr.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#
# mouse:~ppr/src/ppr.spec
# Last modified: 16 May 2014
#
Name: ppr
Summary: A spooler for PostScript printers
Version: 2.00a1
Release: 1
License: BSD
URL: http://ppr.trincoll.edu/
Source: http://ppr.trincoll.edu/pub/ppr/ppr-%{version}.tar.gz
Packager: David Chappell <ppr-bugs@trincoll.edu>
BuildRoot: %{_tmppath}/%{name}-buildroot
# Mandrake
Distribution: Mandrake Linux
Vendor: MandrakeSoft
Group: System/Servers
# RedHat
#Distribution:
#Vendor:
#Group: System Environment/Daemons
#============================================================================
#
# Building RPM packages as root is not recomended and is uncessary, at least
# in the case of PPR. Instead, it is suggested that you run these commands
# in your home directory to set up an RPM build space for yourself.
#
# mkdir rpmbuild/BUILD
# mkdir rpmbuild/SOURCES
# mkdir rpmbuild/SPECS
# mkdir rpmbuild/SRPMS
# mkdir rpmbuild/RPMS
# mkdir rpmbuild/RPMS/i386
# mkdir rpmbuild/RPMS/i586
# echo "%_topdir $HOME/rpmbuild" >>.rpmmacros
#
# You should then copy the PPR source archive into rpmbuild/SOURCES/ and
# run the following command:
#
# rpmbuild -ba ppr.spec
#
# The source package will appear in rpmbuild/SOURCES and the binary package
# will appear in rpmbuild/RPMS/ in the directory for the appropriate
# architecture.
#
#============================================================================
#
# This filters out spurious requirements. PPR is designed to run without
# Perl. The Tcl/Tk requirement is a result of pprpopup, a very optional
# part of PPR. Lots of spurious completely imaginary Perl requirements
# are generated too.
#
%define __find_requires sh -c '/usr/lib/rpm/rpmdeps --requires $* | grep -v perl | grep -v tclsh | grep -v wish'
#
# Turn auto provides generation off completely since it doesn't find anything
# useful to other packages, just a list of PPR's internal Perl modules.
#
AutoProv: no
%description
PPR is a print spooler for PostScript printers. It can print to parallel,
serial, AppleTalk, LPR/LPD, SocketAPI, and SMB printers. It works well
with Ghostscript, Netatalk, CAP60, and Samba. It has a web interface.
%changelog
* Tue Aug 5 2003 David Chappell <David.Chappell@trincoll.edu> 1.52-1
- for PPR 1.52 release
* Tue Dec 11 2004 David Chappell <David.Chappell@trincoll.edu> 1.53-1
- for PPR 1.53 release
* Tue May 16 2014 David Chappell <David.Chappell@trincoll.edu> 2.00a1-1
- for PPR 2.00a1 release
#============================================================================
# This unpacks the source.
#============================================================================
%prep
%setup -q
#============================================================================
# This configures and builds the source. The current directory is already
# the root of the source code.
#============================================================================
%build
CFLAGS="$RPM_OPT_FLAGS" PERL=/usr/bin/perl GUNZIP=/usr/bin/gunzip \
./Configure --prefix=/usr --user-ppr=ppr --with-gdbm --with-gettext --without-tdb
make
#============================================================================
# This does a dummy install of the program into a directory whose name is
# found in $RPM_BUILD_ROOT. This clean directory is used to create the
# file archive portion of the binary .rpm file.
#
# In case you are wondering, the PPR makefiles and the install scripts in
# makeprogs/ automatically adjust their behavior when they see that
# $RPM_BUILD_ROOT is defined.
#
# The file root.sh gives makeprogs/install*.sh a place to vent when they get
# angry that they can't set the file permissions they want.
#============================================================================
%install
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
touch root.sh
RPM_BUILD_ROOT=$RPM_BUILD_ROOT make install
#============================================================================
# This tells RPM what files go in the cpio section of the binary .rpm file.
# The files list is generated by makeprogs/install*.sh.
#============================================================================
%files -f z_install_begin/installed_files_list
%docdir /usr/share/ppr/man
%docdir /usr/share/ppr/www/docs
#============================================================================
# This removes the build directory when starting a new build or after the
# RPM package has been built.
#============================================================================
%clean
rm -rf $RPM_BUILD_ROOT
#============================================================================
# This is run before unpacking the file archive from the binary .rpm file.
# This is similiar to what "make install" in z_install_begin/ does.
#============================================================================
%pre
#echo "pre of %{name}-%{version}-%{release}: count=$1"
# If this is a first time install, and not an upgrade,
if [ $1 -lt 2 ]
then
#echo " Is a new install."
# Create the PPR users and groups.
/usr/sbin/groupadd ppr
/usr/sbin/useradd -M -d /usr/lib/ppr -c "PPR Spooling System" -g ppr -G lp ppr
/usr/sbin/useradd -M -d /usr/lib/ppr -c "PPR Spooling System" -g ppr pprwww
fi
true
#============================================================================
# This is run after unpacking the archive from the binary .rpm file.
# This is similiar to what make install in z_install_end/ does.
#============================================================================
%post
#echo "post of %{name}-%{version}-%{release}: count=$1"
# Sample empty files are not of value.
#rm -f /etc/ppr/acl/*.rpmnew
# These will just be copies of the .sample files. Nix them.
#rm -f /etc/ppr/*.rpmnew
# Import standard media types into the media database.
/usr/lib/ppr/bin/ppad media import /etc/ppr/media.sample >/dev/null
# Generate or re-generate index of fonts, PPD files, etc.
/usr/lib/ppr/bin/ppr-index >/dev/null
# Install user ppr's current crontab.
/usr/bin/crontab -u ppr - <<END
3 10,16 * * 1-5 /usr/lib/ppr/bin/ppad remind
5 4 * * * /usr/lib/ppr/lib/cron_daily
17 * * * * /usr/lib/ppr/lib/cron_hourly
END
# If this isn't an upgrade,
if [ $1 -lt 2 ]
then
#echo " Is a new install, not an upgrade."
# Setup init scripts to start PPR daemons at boot.
/sbin/chkconfig --add ppr
# Tell Xinetd to pick up the new PPR services. Yes, HUP is right.
# See the xinetd(8) manpage if you don't believe me.
killall -HUP xinetd
fi
# If PPR is running, restart it.
command=`/etc/rc.d/init.d/ppr probe`
[ -n "$command" ] && /etc/rc.d/init.d/ppr $command
true
#============================================================================
# This is run before uninstalling.
#============================================================================
%preun
#echo "preun of %{name}-%{version}-%{release}: count=$1"
# If this is an actual removal and not an upgrade,
if [ $1 -lt 2 ]
then
#echo " Is an actual removal, not an upgrade."
# Stop the PPR daemons while the stop script is still available.
/etc/rc.d/init.d/ppr stop >/dev/null
# Remove init script links.
/sbin/chkconfig --del ppr
# Remove the UPRINT symbolic links and put the native spooler programs back.
/usr/lib/ppr/bin/uprint-newconf --remove >/dev/null
# Remove almost everything PPR ever generated. This includes the indexes.
/usr/lib/ppr/bin/ppr-clean --all-removable >/dev/null
# Remove the crontab.
/usr/bin/crontab -u ppr -r
fi
true
#============================================================================
# This is run after uninstalling (and possibly after installing a newer
# version).
#============================================================================
%postun
#echo "postun of %{name}-%{version}-%{release}: count=$1"
# If this is an actual removal and not an upgrade,
if [ $1 -lt 1 ]
then
#echo " Is an actual removal, not an upgrade."
# Tell Xinetd to reload its configuration files.
killall -HUP xinetd 2>/dev/null
# Remove the PPR users and groups.
/usr/sbin/userdel ppr
/usr/sbin/userdel pprwww
/usr/sbin/groupdel ppr
fi
true
# end of file