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
|
#!/usr/bin/make -f
#-*- makefile -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independant
# package.
package=cupsys
version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
HTMLDOC_IS17=$(shell expr `htmldoc --help 2>&1 | head -1 | fgrep 1.7 | wc -l`)
ifeq ($(HTMLDOC_IS17), 1)
HTMLDOC_TITLEOPT=--title
else
HTMLDOC_TITLEOPT=--titleimage
endif
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=1
build: build-stamp
build-stamp:
dh_testdir
CFLAGS="-O2 -g" ./configure --prefix=/usr --mandir=/usr/share/man --enable-fhs
# First, build the shared and static libs properly
cd cups ; \
$(MAKE) libcups.a ; \
rm *.o ; \
$(MAKE) OPTIM="-fPIC -O2 -g" libcups.so.1 ; \
touch libcups.a
cd filter ; \
$(MAKE) libcupsimage.a ; \
rm *.o ; \
$(MAKE) OPTIM="-fPIC -O2 -g" libcupsimage.so.1 ; \
touch libcupsimage.a
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp install-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
-rm man/*.gz
-rm cups/libcups.so
-rm cups/libcups.a
-rm filter/libcupsimage.so
-rm filter/libcupsimage.a
-rm backend/http
-rm systemv/disable systemv/enable systemv/reject
-rm config.log config.h config.cache config.status Makedefs
dh_clean
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp.
$(MAKE) install prefix=`pwd`/debian/tmp/usr \
SERVERROOT=`pwd`/debian/tmp/var/lib/cups \
LOCALEDIR=`pwd`/debian/tmp/usr/share/locale \
DATADIR=`pwd`/debian/tmp/usr/share/cups \
MANDIR=`pwd`/debian/tmp/usr/share/man
# Move the documentation into the right place
-mkdir debian/tmp/usr/share/doc
mv debian/tmp/usr/share/cups/doc debian/tmp/usr/share/doc/cupsys
ln -s ../doc/cupsys debian/tmp/usr/share/cups/doc
cp CHANGES.txt debian/tmp/usr/share/doc/cupsys/changelog
gzip -9 debian/tmp/usr/share/doc/cupsys/changelog
# Now remove the upstream corruption from the HTML docs
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/sam.html \
doc/sam.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/spm.html \
doc/spm.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/sum.html \
doc/sum.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif --numbered \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/cmp.html \
doc/cmp.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif --numbered \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/idd.html \
doc/idd.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif --numbered \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/sdd.html \
doc/sdd.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif --numbered \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/ssr.html \
doc/ssr.shtml
htmldoc $(HTMLDOC_TITLEOPT) images/cups-large.gif --numbered \
--outfile `pwd`/debian/tmp/usr/share/doc/cupsys/stp.html \
doc/stp.shtml
# Move configuration files also
-mkdir -p debian/tmp/etc/cups
-mkdir -p debian/tmp/etc/cups/ppd
mv debian/tmp/var/lib/cups/conf/* debian/tmp/etc/cups
rmdir debian/tmp/var/lib/cups/conf
ln -sf /etc/cups debian/tmp/var/lib/cups/conf
rmdir debian/tmp/var/lib/cups/ppd
ln -sf /etc/cups/ppd debian/tmp/var/lib/cups/ppd
# Kill off the catx stuff
-rm -rf `pwd`/debian/tmp/usr/share/man/cat1
-rm -rf `pwd`/debian/tmp/usr/share/man/cat5
-rm -rf `pwd`/debian/tmp/usr/share/man/cat8
# Add any necessary copies and symlinks for ld.so/dev needs
cp cups/*.a `pwd`/debian/tmp/usr/lib
cp filter/*.a `pwd`/debian/tmp/usr/lib
ln -sf libcups.so.1 `pwd`/debian/tmp/usr/lib/libcups.so
ln -sf libcupsimage.so.1 `pwd`/debian/tmp/usr/lib/libcupsimage.so
# Create "cups*" equivalent commands (& their man pages)
ln -sf accept debian/tmp/usr/sbin/cupsaccept
ln -sf accept debian/tmp/usr/sbin/cupsreject
ln -sf ../sbin/accept debian/tmp/usr/bin/cupsenable
ln -sf ../sbin/accept debian/tmp/usr/bin/cupsdisable
ln -sf accept.8.gz debian/tmp/usr/share/man/man8/cupsaccept.8.gz
ln -sf accept.8.gz debian/tmp/usr/share/man/man8/cupsreject.8.gz
ln -sf enable.8.gz debian/tmp/usr/share/man/man8/cupsenable.8.gz
ln -sf enable.8.gz debian/tmp/usr/share/man/man8/cupsdisable.8.gz
# Remove lpd backend; it's a security hole.
-rm debian/tmp/var/lib/cups/backend/lpd
# Wrap up
-mkdir -p debian/tmp/var/log/cups
rmdir debian/tmp/var/lib/cups/logs
ln -s ../../log/cups debian/tmp/var/lib/cups/logs
dh_movefiles
-mkdir -p debian/cupsys-bsd/usr/share/doc
ln -sf cupsys debian/cupsys-bsd/usr/share/doc/cupsys-bsd
touch install-stamp
# Build architecture-independent files here.
binary-indep: build install
# dh_testversion
# dh_testdir -i
# dh_testroot -i
# dh_installdocs -i
# dh_installexamples -i
# dh_installmenu -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installinit -i
# dh_installcron -i
# dh_installmanpages -i
# dh_installinfo -i
# dh_undocumented
# dh_installchangelogs -i
# dh_link -i
# dh_compress -i
# dh_fixperms -i
# You may want to make some executables suid here.
# dh_suidregister -i
# dh_installdeb -i
# dh_perl -i
# dh_gencontrol -i
# dh_md5sums -i
# dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
# dh_testversion
dh_testdir -a
dh_testroot -a
dh_installdocs -a -Ncupsys-bsd
dh_installexamples -a
dh_installmenu -a
# dh_installemacsen -a
# dh_installpam -a
dh_installinit -a
dh_installcron -a
# dh_installmanpages -a
dh_installinfo -a
# dh_undocumented
dh_installchangelogs -a -Ncupsys-bsd
dh_strip -a
dh_link -a
dh_compress -a -X.pdf
dh_fixperms -a
# You may want to make some executables suid here.
# chmod u+s debian/tmp/var/lib/cups/backend/lpd
# dh_suidregister -a
# dh_makeshlibs -a
dh_installdeb -a
# dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|