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
|
#!/usr/bin/make -f
#
# John Lapeyre modified the gmp2 rules file
# This is a debian/rules make file. It supports the targets:
# build, clean, binary-indep, binary-arch, and binary
#
# This file was created by Dale Scheetz <dwarf@polaris.net> and modified
# to create "versioned" package names in late November of 1997.
# This file is copyright 1997 by Software in the Public Interest and
# is thereby licensed under the GPL.
# Package names
#
P=sipp
P2=sipp-dev
INSTALL = /usr/bin/install
# Create the two so version strings for the symbolic link names
#
command=/usr/lib/dpkg/parsechangelog/debian <debian/changelog
v1 := $(shell $(command) |sed -n '/Version: /s;;;p' |sed -e 's/\..\+//')
v2 := $(shell $(command) |sed -n '/Version: /s;;;p' |sed -e 's/-.\+//')
# Construct the library dependency entry for shlibs
#
shl1=lib$(P) $(v1) $(P) (>= $(v2))
# Build the binary components and assemble the libraries
# =====================================================================
build:
$(checkdir)
$(MAKE) library
cd libsipp; rm -f *.o
$(MAKE) MA_N=$(v1) MI_N=$(v2) EXTRA_FLAGS=-fPIC shared
# $(MAKE) MA_N=$(v1) MI_N=$(v2) $(P)-static
# $(MAKE) MA_N=$(v1) MI_N=$(v2) $(P)-shared
cd doc; texi2html sipp.texinfo
touch build
# Clean up after a build and before building a source package
#======================================================================
clean:
$(checkdir)
-rm -f build
-$(MAKE) clean
-rm libsipp.a libsipp.so*
-cd libsipp; rm -f libsipp*
-cd doc; rm -f *.html
-rm -rf debian/tmp debian/files debian/substvars \
debian/*~ *~ *.orig ./#*# *.log
# No binary independent components to this package
#======================================================================
binary-indep:
#None:
@echo >&2 'No independent packages'
# Install package components into debian/tmp to be built into packages
#======================================================================
binary binary-arch: checkroot build
# First round...package sipp...........................................
#
# Clean out old tmp directory
#
-rm -rf debian/tmp
# copy libs to root of source
cp libsipp/lib* .
# Create new directories in debian/tmp
#
mkdir debian/tmp debian/tmp/DEBIAN
# Insert appropriate lines into shlibs file
#
echo -e '$(shl1)\n' >debian/tmp/DEBIAN/shlibs
# Create additional installation directories
#
$(INSTALL) -d debian/tmp/usr/doc/$(P)
$(INSTALL) -d debian/tmp/usr/{info,lib}
# $(INSTALL) -d debian/tmp/usr/lib
# Install docs in proper directory and gzip them
#
cp debian/changelog debian/tmp/usr/doc/$(P)/changelog.Debian
cp ChangeLog debian/tmp/usr/doc/$(P)/changelog
$(INSTALL) -m 644 debian/README.debian debian/tmp/usr/doc/$(P)
$(INSTALL) -m 644 README debian/tmp/usr/doc/$(P)
-gzip -9v debian/tmp/usr/doc/$(P)/*
# but don't gzip the copyright statement
#
cp debian/copyright debian/tmp/usr/doc/$(P)/copyright
# Install installation scripts
#
cp debian/postinst debian/tmp/DEBIAN/.
chmod +x debian/tmp/DEBIAN/postinst
# Install shared library
#
strip --strip-unneeded lib$(P).so.$(v2)
$(INSTALL) -m 644 lib$(P).so.$(v2) debian/tmp/usr/lib/.
# Create .so link
#
ln -s lib$(P).so.$(v2) debian/tmp/usr/lib/lib$(P).so.$(v1)
# Create dependency information
#
dpkg-shlibdeps ./lib$(P).so.$(v2)
# Generate control file for $(P)
#
dpkg-gencontrol -p$(P) -isp
# Clean up file ownership
#
chown -R root.root debian/tmp
# and permissions
#
chmod -R g-ws debian/tmp
# and build the package
#
dpkg --build debian/tmp ..
####################################################################################
# Second round...package sipp-dev......................................
#
# Clean out old tmp directory
#
-rm -rf debian/tmp
# Create new directories in debian/tmp
#
mkdir debian/tmp debian/tmp/DEBIAN
# Create additional installation directories
#
$(INSTALL) -d debian/tmp/usr/doc/$(P2)
$(INSTALL) -d debian/tmp/usr/doc/$(P2)/html
$(INSTALL) -d debian/tmp/usr/doc/$(P2)/examples
$(INSTALL) -d debian/tmp/usr/lib
$(INSTALL) -d debian/tmp/usr/include/$(P)
# Install docs in proper directory and gzip them
#
$(INSTALL) -m 644 INSTALL COMPATIBILITY IAFA-PACKAGE \
COMPATIBILITY README \
debian/tmp/usr/doc/$(P2)/.
$(INSTALL) -m 644 debian/README.debian debian/tmp/usr/doc/$(P2)
cp debian/changelog debian/tmp/usr/doc/$(P2)/changelog.Debian
cp ChangeLog debian/tmp/usr/doc/$(P2)/changelog
cp CHANGES debian/tmp/usr/doc/$(P2)/CHANGES
# Install html
$(INSTALL) -m 644 doc/*.html debian/tmp/usr/doc/$(P2)/html
# Install other docs
$(INSTALL) -m 644 doc/sipp.ps doc/sipp.texinfo debian/tmp/usr/doc/$(P2)
-gzip -9fv debian/tmp/usr/doc/$(P2)/*
# but don't gzip the copyright statement
#
cp debian/copyright debian/tmp/usr/doc/$(P2)/copyright
# Install man pages
$(INSTALL) -d debian/tmp/usr/man
$(INSTALL) -d debian/tmp/usr/man/man3
$(INSTALL) -m 644 doc/sipp.man debian/tmp/usr/man/man3/sipp.3
$(INSTALL) -m 644 doc/sipp_geometric.man debian/tmp/usr/man/man3/sipp_geometric.3
$(INSTALL) -m 644 doc/sipp_pixmap.man debian/tmp/usr/man/man3/sipp_pixmap.3
$(INSTALL) -m 644 doc/sipp_primitives.man debian/tmp/usr/man/man3/sipp_primitives.3
$(INSTALL) -m 644 doc/sipp_shaders.man debian/tmp/usr/man/man3/sipp_shaders.3
gzip -9v debian/tmp/usr/man/man3/*
# Install test files
-$(INSTALL) -m 644 demo/* debian/tmp/usr/doc/$(P2)/examples
$(INSTALL) -d debian/tmp/usr/doc/$(P2)/examples/animation
$(INSTALL) -m 644 demo/animation/* debian/tmp/usr/doc/$(P2)/examples/animation
-gzip -9vf debian/tmp/usr/doc/$(P2)/examples/*
gzip -9vf debian/tmp/usr/doc/$(P2)/examples/*/*
# Install contrib files
$(INSTALL) -d debian/tmp/usr/doc/$(P2)/contrib
$(INSTALL) -m 644 contrib/* debian/tmp/usr/doc/$(P2)/contrib
gzip -9vf debian/tmp/usr/doc/$(P2)/contrib/*
# Install header files
#
cd libsipp ; cp sipp.h geometric.h shaders.h primitives.h noise.h \
sipp_pixmap.h sipp_bitmap.h ../debian/tmp/usr/include/$(P)
chmod 644 debian/tmp/usr/include/$(P)/*
# Install static library
#
strip --strip-debug lib$(P).a
$(INSTALL) -m 644 lib$(P).a debian/tmp/usr/lib/.
# Create .so link
#
ln -s lib$(P).so.$(v2) debian/tmp/usr/lib/lib$(P).so
# Generate control file for sipp-dev
#
dpkg-gencontrol -p$(P2) -isp
# Clean up file ownership
#
chown -R root.root debian/tmp
# and permissions
#
chmod -R g-ws debian/tmp
# and build the package
#
dpkg --build debian/tmp ..
define checkdir
test -f libsipp/sipp.h
endef
# Below here is fairly generic really
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|