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
|
#!/usr/bin/make -f
# 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.
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
CC = gcc
CFLAGS = -g -O2 -fno-strength-reduce -D_REENTRANT
ELF_CFLAGS = $(CFLAGS) -fPIC
# Never hardwire or duplicate information if you can keep it in one source.
SOMAJOR = \
$(shell (cat src/Makefile ; \
echo "fubar:" ; \
echo -e '\t@echo $$(ELF_MAJOR_VERSION)') \
| make -s -f - fubar)
SONUMBER = \
$(shell (cat src/Makefile ; \
echo "fubar:" ; \
echo -e '\t@echo $$(ELF_MAJOR_VERSION).$$(ELF_MINOR_VERSION)') \
| make -s -f - fubar)
build: build-stamp
build-stamp: Makefile
dh_testdir
$(MAKE) CFLAGS="$(CFLAGS)" all demos
# We specify ELF_DEP_LIBS to get a libc dependency; upstream only has -lm.
$(MAKE) ELF_CFLAGS="$(ELF_CFLAGS)" ELF_DEP_LIBS='-lm -lc -ldl' prefix=/ elf
touch build-stamp
Makefile:
dh_testdir
env CC="$(CC)" INSTALL="/usr/bin/install -p" \
./configure --prefix=/usr --enable-warnings
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
rm -f demo/config.log demo/config.status demo/config.h
rm -f modules/Makefile slsc/Makefile slsh/Makefile
-test -r /usr/share/misc/config.sub && \
cp -f /usr/share/misc/config.sub autoconf/config.sub
-test -r /usr/share/misc/config.guess && \
cp -f /usr/share/misc/config.guess autoconf/config.guess
dh_clean
# Build architecture-independent files here.
binary-indep: build
#
# Nothing to do
#
binary-arch: build
# dh_testversion
dh_testdir -a
dh_testroot -a
dh_clean -a -k
dh_installdirs -a
make prefix=`pwd`/debian/tmp/usr \
ELF_DEP_LIBS='-lm -lc -ldl' install install-elf
dh_movefiles -a
mv debian/slang1/usr/lib/libslang.so.$(SONUMBER) debian/slang1/lib
# The ldconfig symlink to make the library work ASAP.
cd debian/slang1/lib ; ln -sf libslang.so.$(SONUMBER) libslang.so.$(SOMAJOR)
# Correct the .so link
cd debian/tmp/usr/lib ; ln -sf /lib/libslang.so.$(SONUMBER) libslang.so
# Produce the -pic archive for use by the bootfloppies package.
# cd debian/slang1-pic/usr/share/doc ; \
# ln -s slang1-dev slang1-pic
ar cqv debian/slang1-pic/usr/lib/libslang$(SONUMBER)_pic.a src/elfobjs/*.o
# Produce the utf version
rm -rf debian/tmp
$(MAKE) clean
$(MAKE) CFLAGS="$(CFLAGS) -DUTF8" all
$(MAKE) ELF_CFLAGS="$(ELF_CFLAGS) -DUTF8" ELF_DEP_LIBS='-lm -lc -ldl' prefix=/ elf
$(MAKE) prefix=`pwd`/debian/tmp/usr \
ELF_DEP_LIBS='-lm -lc -ldl -DUTF8' install install-elf
mv debian/tmp/usr/lib/libslang.so.$(SONUMBER) debian/slang1-utf8/lib
cd debian/slang1-utf8/lib ; ln -sf libslang.so.$(SONUMBER) libslang.so.$(SOMAJOR)
cd debian/tmp/usr/lib ; ln -sf /lib/libslang.so.$(SONUMBER) libslang.so
# Produce the -pic archive of utf8 for use by the bootfloppies package.
ar cqv debian/slang1-utf8-pic/usr/lib/libslang$(SONUMBER)_pic.a src/elfobjs/*.o
dh_installdocs -a
dh_installexamples -a
cd debian/tmp/usr/share/doc/slang1-dev/examples/ ; \
mv demo/* . ; \
mv objs/* . ; \
rmdir objs demo ; \
rm -f *.o* Makefile Makefile.in ; \
mv Makefile.simple Makefile ; \
rm -f config.status config.log configure configure.in
dh_installmenu -a
# dh_installinit -a
dh_installcron -a
dh_installmanpages -a
# dh_undocumented
dh_installchangelogs -a changes.txt
dh_strip -a
dh_compress -a
gunzip debian/tmp/usr/share/doc/slang1-dev/examples/*.gz
dh_fixperms -a
dh_suidregister -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol
dh_makeshlibs -a
install -m 644 debian/shlibs.local debian/slang1/DEBIAN/shlibs
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
|