This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
oslec.mk
81 lines (59 loc) · 1.86 KB
/
oslec.mk
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
# oslec.mk
include rules.mk
OSLEC_NAME=oslec
export OSLEC_DIR=$(BUILD_DIR)/$(OSLEC_NAME)
OSLEC_SITE=http://svn.astfin.org/software/oslec/trunk
TARGET_DIR=$(TOPDIR)/tmp/oslec/ipkg/oslec
PKG_NAME:=oslec
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(TOPDIR)/tmp/oslec
MOD_PATH:=$(UCLINUX_DIST)/root/lib/modules
MOD_DIR:=$(shell ls $(UCLINUX_DIST)/root/lib/modules)
$(OSLEC_DIR):
mkdir -p $(TOPDIR)
svn co $(OSLEC_SITE) $(OSLEC_NAME)
patch -p0 < patch/oslec.patch
oslec: $(OSLEC_DIR)
make -C $(UCLINUX_DIST)/linux-2.6.x SUBDIRS=$(OSLEC_DIR)/kernel modules
bfin-linux-uclibc-gcc $(OSLEC_DIR)/user/sample.c -o $(OSLEC_DIR)/user/sample -Wall
mkdir -p $(TARGET_DIR)/lib/modules/$(MOD_DIR)/misc
cp -f $(OSLEC_DIR)/kernel/oslec.ko \
$(TARGET_DIR)/lib/modules/$(MOD_DIR)/misc
mkdir -p $(TARGET_DIR)/bin
cp -f $(OSLEC_DIR)/user/sample $(TARGET_DIR)/bin
touch $(PKG_BUILD_DIR)/.built
all: oslec
oslec-dirclean:
rm -Rf $(OSLEC_DIR)
define Package/oslec
SECTION:=net
CATEGORY:=Network
TITLE:=Oslec echo canceller
DESCRIPTION:=\
Open Source Line Echo Canceller, a high quality free echo \\\
canceller for Asterisk.
URL:=http://www.rowetel.com/ucasterisk/oslec.html
endef
# post installation - add the modules.dep entry
define Package/oslec/postinst
#!/bin/sh
cd /lib/modules/$(MOD_DIR)
cat modules.dep | sed '/.*oslec.ko:/ d' > modules.tmp
cp -f modules.tmp modules.dep
rm -r modules.tmp
echo /lib/modules/$(MOD_DIR)/misc/oslec.ko: >> modules.dep
# device node for sample util
mknod -m 666 /dev/sample c 33 0
endef
# pre-remove - remove the modules.dep entry
define Package/oslec/prerm
#!/bin/sh
cd /lib/modules/$(MOD_DIR)
cat modules.dep | sed '/.*oslec.ko:/ d' > modules.tmp
cp -f modules.tmp modules.dep
rm -r modules.tmp
rm -f -r /dev/sample
endef
$(eval $(call BuildPackage,oslec))
oslec-package: oslec $(PACKAGE_DIR)/oslec_$(VERSION)_$(PKGARCH).ipk