summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-01-21 22:49:26 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-01-21 22:49:26 +0000
commit285e2417b6283c0b31eb9151e1350c55bad244cb (patch)
treeb60e9350723c996da69a49da64805a293ab588a4 /Makefile
parentd4abecffcb475e6d472368850ccf3c7c40224a20 (diff)
Improve portability for debian (bug #3390)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@571 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0dc0216..e2af664 100755
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ KFLAGS+=-DSTANDALONE_ZAPATA
CFLAGS+=-DSTANDALONE_ZAPATA
ROOT_PREFIX=
-INSTALL_PREFIX=
+INSTALL_PREFIX=$(DESTDIR)
CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
@@ -203,9 +203,10 @@ libtonezone.a: $(TZOBJS)
ar rcs libtonezone.a $(TZOBJS)
$(LIBTONEZONE): $(TZOBJS)
- $(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS)
+ $(CC) -shared -Wl,-soname,$(LIBTONEZONE) -lm -o $@ $(TZOBJS)
[ `id -u` = 0 ] && /sbin/ldconfig || :
- ln -sf libtonezone.so.1 libtonezone.so
+ ln -sf $(LIBTONEZONE) libtonezone.so
+ ln -sf $(LIBTONEZONE) libtonezone.so.1
ztcfg.c: ztcfg.h
@@ -301,6 +302,7 @@ install: all devices $(LIBTONEZONE)
install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h
install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
+ ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so.1 ; ln -sf $(LIBTONEZONE) libtonezone.so.1 )
[ `id -u` = 0 ] && /sbin/ldconfig || :
if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
cat $(MODCONF).bak | grep -v "alias char-major-250" | \
@@ -343,7 +345,10 @@ config:
install -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
chkconfig --add zaptel; \
fi
- if [ ! -f /etc/sysconfig/zaptel ]; then \
+ if [ -d /etc/default ] && [ ! -f /etc/default/zaptel ]; then \
+ install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \
+ fi
+ if [ -d /etc/sysconfig ] && [ ! -f /etc/sysconfig/zaptel ]; then \
install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
fi
if [ -d /etc/sysconfig/network-scripts ]; then \
@@ -370,3 +375,5 @@ clean:
rm -f tor2ee
rm -f fxotune
rm -f core
+ [ -d .tmp_versions ] && rm -rf .tmp_versions
+