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
|
#!/usr/bin/make -f
SONAME=3
SOVERSION=${SONAME}.0
LDEBDIR = debian/tmp/DEBIAN
LLIBDIR = debian/tmp/usr/lib
LDOCDIR = debian/tmp/usr/doc/ftplib${SONAME}
DDEBDIR = debian/tmp-dev/DEBIAN
DLIBDIR = debian/tmp-dev/usr/lib
DINCDIR = debian/tmp-dev/usr/include
DDOCDIR = debian/tmp-dev/usr/doc/ftplib-dev
DEXMDIR = debian/tmp-dev/usr/doc/ftplib-dev/examples
DMANDIR = debian/tmp-dev/usr/man
DMENUDIR = debian/tmp-dev/usr/lib/menu
CFLAGS = -Wall -g -O2
build:
$(checkdir)
# Upstream makefile was not really built for making shared libraries.
cd linux && make -f../debian/Makefile.linux DEBUG="-g -O2"
touch build
clean:
$(checkdir)
-rm -f build
# Assume that if the makefile doesn't exist, it was deleted by a previous
# "make clobber" so there's no need to repeat it.
-cd linux && make -f../debian/Makefile.linux clobber
-rm -f `find . -name "*~"` debian/files* debian/substvars
-rm -rf debian/tmp debian/tmp-dev debian/tmp-man
binary-indep:
binary-arch: build
$(checkdir)
-rm -rf debian/tmp debian/tmp-dev
# Make sure we agree with the package about the soname and version to use.
test -f linux/libftp.so.${SOVERSION}
test -L linux/libftp.so.${SONAME}
# Library package
# shared library
install -d ${LLIBDIR}
install -m 644 linux/libftp.so.${SOVERSION} ${LLIBDIR}
strip --strip-unneeded ${LLIBDIR}/libftp.so.${SOVERSION}
ln -s libftp.so.${SOVERSION} ${LLIBDIR}/libftp.so.${SONAME}
# documentation
install -d ${LDOCDIR}
install -p -m 644 CHANGES ${LDOCDIR}/changelog
install -m 644 debian/changelog ${LDOCDIR}/changelog.Debian
gzip -9 ${LDOCDIR}/*
install -m 644 debian/copyright ${LDOCDIR}
# control files
install -d ${LDEBDIR}
install -m 644 debian/shlibs.local ${LDEBDIR}/shlibs
install -m 755 debian/postinst.ftplib ${LDEBDIR}/postinst
dpkg-shlibdeps ${LLIBDIR}/libftp.so.${SOVERSION}
dpkg-gencontrol -isp -Vsoname=${SONAME} -pftplib${SONAME} -Pdebian/tmp
dpkg --build debian/tmp ..
# Development package
# library
install -d ${DLIBDIR}
ln -s libftp.so.${SOVERSION} ${DLIBDIR}/libftp.so
install -m 644 linux/libftp.a ${DLIBDIR}
strip --strip-debug ${DLIBDIR}/libftp.a
# include files
install -d ${DINCDIR}
install -p -m 644 linux/ftplib.h ${DINCDIR}
# documentation
install -d ${DDOCDIR}
install -p -m 644 README.ftplib ${DDOCDIR}
install -p -m 644 debian/README ${DDOCDIR}/README.Debian
install -p -m 644 CHANGES ${DDOCDIR}/changelog
install -p -m 644 TODO ${DDOCDIR}
install -m 644 debian/changelog ${DDOCDIR}/changelog.Debian
gzip -9f ${DDOCDIR}/*
install -m 644 debian/copyright ${DDOCDIR}
install -d ${DDOCDIR}/html
install -p -m 644 html/* ${DDOCDIR}/html
rm ${DDOCDIR}/html/model.html
# menu entry for html documentation
install -d ${DMENUDIR}
install -p -m 644 debian/menu ${DMENUDIR}/ftplib-dev
# examples
install -d ${DEXMDIR}
install -p -m 644 README.qftp ${DEXMDIR}
install -p -m 644 linux/qftp.c ${DEXMDIR}
install -m 755 -s linux/qftp ${DEXMDIR}
install -p -m 644 debian/Makefile.examples ${DEXMDIR}/Makefile
# man pages
mkdir debian/tmp-man
install -d ${DMANDIR}/man3
python debian/html2man.py html/Ftp*.html debian/tmp-man
set -e; for i in debian/tmp-man/* ; do install -m 644 $$i ${DMANDIR}/man3; done
gzip -9 ${DMANDIR}/man3/*.3
# control files
install -d ${DDEBDIR}
install -m 755 debian/postinst.ftplib-dev ${DDEBDIR}/postinst
install -m 755 debian/postrm.ftplib-dev ${DDEBDIR}/postrm
# If this host does not have ftplib installed, we will get a warning
# here that libftp was not found. The warning can be ignored because
# we already have an explicit dependency on the ftplib package.
dpkg-shlibdeps ${DEXMDIR}/qftp
dpkg-gencontrol -isp -Vsoname=${SONAME} -pftplib-dev -Pdebian/tmp-dev
dpkg --build debian/tmp-dev ..
define checkdir
test -f ftplib.lsm -a -f debian/rules
endef
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean checkroot
|