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
|
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter, -*- makefile -*-
# based on the sample debian/rules file for GNU hello by Ian Jackson.
# this does not work
# VERSION=$(expr `pwd` : '.*-\([0-9.]*\)')
# MAJOR=$(expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
VERSION=6.0
MAJOR=6
package=libwn$(MAJOR)
ADDCFLAGS=-g -D_REENTRANT
build:
$(checkdir)
make MAJOR=$(MAJOR) VERSION=$(VERSION) ADDCFLAGS='$(ADDCFLAGS) -fPIC'
touch build
clean:
$(checkdir)
-rm -rf static shared
-rm -f build
-make clean
-rm -f `find . -name "*~"`
-rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
-rm -f acc/libwn.so.*
-rm -f debian/*substvars
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build
$(checkdir)
#
# First, libwn.so.6
#
-rm -rf debian/tmp
install -d debian/tmp
cd debian/tmp && install -d `cat ../dirs`
install -d -o root -m 755 debian/tmp/usr/doc/libwn$(MAJOR)
#
# install -o root -m 755 debian/postinst debian/tmp/DEBIAN
# install -o root -m 755 debian/shlibs debian/tmp/DEBIAN
install -o root -m 644 -s acc/libwn.so.$(VERSION) debian/tmp/usr/lib
# ln -s libwn.so.$(VERSION) debian/tmp/usr/lib/libwn.so.$(MAJOR)
# install -o root -m 644 debian/changelog \
# debian/tmp/usr/doc/libwn$(MAJOR)/changelog
# gzip -9f debian/tmp/usr/doc/libwn$(MAJOR)/*
# install -o root -m 644 debian/copyright \
# debian/tmp/usr/doc/libwn$(MAJOR)/copyright
# dpkg-shlibdeps libwn.so.$(VERSION)
# dpkg-gencontrol -plibwn$(MAJOR) -Pdebian/tmp
# dpkg --build debian/tmp ..
#
# Now build libwn-dev
#
-rm -rf debian/libwn-dev
install -d -o root -m 755 debian/libwn-dev
install -d -o root -m 755 debian/libwn-dev/DEBIAN
install -d -o root -m 755 debian/libwn-dev/usr/lib
install -d -o root -m 755 debian/libwn-dev/usr/include/wn
install -d -o root -m 755 debian/libwn-dev/usr/man/man3
install -d -o root -m 755 debian/libwn-dev/usr/doc/libwn-dev
install -d -o root -m 755 debian/libwn-dev/usr/doc/libwn-dev/examples
for d in anneal arg btr cmp complex conjdir cpy hash list low \
mat mem misc parse random sort spmat str vect; do \
install -d -m 755 debian/libwn-dev/usr/doc/libwn-dev/examples/$$d; \
done
cd acc; for p in */example*.c; do \
sed -e 's,^#include "wn,#include <wn/wn,' -e 's,.h",.h>,' $$p \
>../debian/libwn-dev/usr/doc/libwn-dev/examples/$$p; \
done; cd ..
install -o root -m 644 debian/copyright \
debian/libwn-dev/usr/doc/libwn-dev/copyright
install -o root -m 644 debian/README.debian \
debian/libwn-dev/usr/doc/libwn-dev/README.debian
install -o root -m 644 debian/README.examples \
debian/libwn-dev/usr/doc/libwn-dev/examples/README
#
make MAJOR=$(MAJOR) VERSION=$(VERSION) ADDCFLAGS='$(ADDCFLAGS)'
install -m 644 acc/text.a debian/libwn-dev/usr/lib/$(package).a
install -m 644 `ls acc/*/*.h` debian/libwn-dev/usr/include/wn/
# remove the undocumented one
rm debian/libwn-dev/usr/include/wn/resnet.h
ln -s libwn.so.$(VERSION) debian/libwn-dev/usr/lib/libwn.so
install -m 644 `ls acc/*/*.3` debian/libwn-dev/usr/man/man3/
# install -o root -m 644 debian/changelog \
# debian/libwn-dev/usr/doc/libwn-dev/changelog
# gzip -9f debian/libwn-dev/usr/doc/libwn-dev/*
# install -o root -m 644 COPYRIGHT \
# debian/libwn-dev/usr/doc/libwn-dev/copyright
# gzip -9f debian/libwn-dev/usr/man/*/*
# dpkg-gencontrol -plibwn-dev -Pdebian/libwn-dev
# dpkg --build debian/libwn-dev ..
#
#make install DESTDIR=`pwd`/debian/libwn-dev
#
# Now make both packages
#
debstd -m README INSTALL
dpkg-gencontrol -plibwn-dev -Pdebian/libwn-dev
# chown -R root.root debian/libwn-dev
# chmod -R go=rX debian/libwn-dev
dpkg --build debian/libwn-dev ..
#
dpkg-shlibdeps acc/libwn.so.$(VERSION)
dpkg-gencontrol -plibwn$(MAJOR) -Pdebian/tmp
dpkg --build debian/tmp ..
define checkdir
test -f debian/rules
endef
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|