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
|
#!/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.
package=libgc
version=$(shell expr `pwd` : '.*-\([0-9.][0-9a-z.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# disable all threading
THREADS :=
build: build-stamp
build-stamp:
dh_testdir
-mkdir shared static
-mkdir shared/cord static/cord
#
# We need to copy some header files into include/private for export
-(cd include/private; \
for i in *.h; do \
cp -af ../../$$i .; \
cp -af ../../cord/private/$$i .; \
done)
# First build the shared library
cd shared ; \
$(MAKE) -f ../Makefile CC="gcc" CXX="g++" VPATH=".." srcdir=".." \
DEBIAN_CFLAGS="-O2 -pipe ${THREADS} -D_REENTRANT" \
DEBIAN_PIC="-fPIC -DPIC" \
gc.a cords c++ && \
gcc -fPIC -shared -Wl,-soname,$(package).so.$(version_major) \
-o $(package).so.$(version) `ls *.o cord/*.o` -lc -lpthread
#
# Build the static library (it does not need Position Independent Code,
# which reserves one register; thus without -fPIC we get more efficient
# code).
#
cd static ; \
$(MAKE) -f ../Makefile CC="gcc" CXX="g++" VPATH=".." srcdir=".." \
DEBIAN_CFLAGS="-O2 -pipe ${THREADS} -D_REENTRANT" \
DEBIAN_PIC="" \
LDFLAGS="-s" \
gc.a cords c++
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp install-stamp
-rm -rf static shared
# Add here commands to clean up after the build process.
-$(MAKE) clean
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.
install shared/$(package).so.$(version) debian/tmp/usr/lib
(cd debian/tmp/usr/lib; \
ln -s $(package).so.$(version) $(package).so.$(version_major); \
ln -s $(package).so.$(version) $(package).so)
install static/gc.a debian/tmp/usr/lib/${package}.a
cp -a include/* debian/tmp/usr/include/gc
cp gc.man debian/tmp/usr/man/man3/gc.3
gzip -9v debian/tmp/usr/man/man3/gc.3
for alias in \
GC_malloc GC_malloc_atomic GC_free GC_realloc GC_enable_incremental \
GC_register_finalizer GC_malloc_ignore_off_page \
GC_malloc_atomic_ignore_off_page GC_set_warn_proc; \
do \
(cd debian/tmp/usr/man/man3; \
ln -s gc.3.gz $${alias}.3.gz); \
done
install README README.linux README.debugging README.QUICK README.alpha \
debian/tmp/usr/doc/libgc5-dev
install cord/README debian/tmp/usr/doc/libgc5-dev/README.cord
dh_movefiles
touch install-stamp
# Build architecture-independent files here.
binary-indep: build install
binary-arch: build install
# dh_testversion
dh_testdir
dh_testroot
# Move the doc pages
(cd debian; for docdir in */usr/doc; \
do \
NEWDIR=`echo $${docdir} | sed 's;doc$$;share/doc;'`; \
mv $${docdir} $${NEWDIR}; \
done)
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installinit
dh_installcron
dh_installchangelogs
# Move the man pages
(cd debian; for mandir in */usr/man; \
do \
NEWDIR=`echo $${mandir} | sed 's;man$$;share/man;'`; \
mv $${mandir} $${NEWDIR}; \
done)
# dh_installmanpages
# dh_undocumented
dh_link
dh_strip
dh_compress
dh_fixperms
dh_suidregister
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_makeshlibs
dh_md5sums
dh_builddeb
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
|