- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/asterisk.patch
- ### FAX geht noch nicht mit Asterisk 1.2.9.1
- # cp -fv $(DIR_DL)/app_{r,t}xfax.c $(DIR_APP)/apps && \
- # cd $(DIR_APP)/apps && patch < $(DIR_DL)/apps_Makefile.patch
- cd $(DIR_APP) && make clean
- cd $(DIR_APP) && make all ASTETCDIR=/var/ipfire/asterisk
- cd $(DIR_APP) && make install ASTETCDIR=/var/ipfire/asterisk
- cd $(DIR_APP) && make samples ASTETCDIR=/var/ipfire/asterisk
- tar xfz $(DIR_DL)/asterisk-sounds-de-1.2.5.tar.gz -C /var/lib/asterisk/sounds/
- rm -f /var/lib/asterisk/sounds/README.txt
- cd $(DIR_SRC) && tar zxf $(DIR_DL)/asterisk-sounds-1.2.1.tar.gz
- cd $(DIR_SRC)/asterisk-sounds-1.2.1/ && make all install
- rm -rf $(DIR_SRC)/asterisk-sounds-1.2.1
- cd $(DIR_SRC) && tar zxf $(DIR_DL)/asterisk-addons-1.2.3.tar.gz
- cd $(DIR_SRC)/asterisk-addons-1.2.3/ && make all install
- rm -rf $(DIR_SRC)/asterisk-addons-1.2.3
- cd $(DIR_SRC) && tar zxf $(DIR_DL)/asterisk-perl-0.08.tar.gz
- cd $(DIR_SRC)/asterisk-perl-0.08/ && perl Makefile.PL
- cd $(DIR_SRC)/asterisk-perl-0.08/ && make
- cd $(DIR_SRC)/asterisk-perl-0.08/ && make install
- rm -rf $(DIR_SRC)/asterisk-perl-0.08
- @rm -rf $(DIR_APP)
+
+ # remove old directories and extract asterisk
+ @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* $(DIR_SRC)/$(CHAN_CAPI) $(DIR_SRC)/agx-ast-addons && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+
+ # confiure asterisk
+ cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire
+
+ # enable additional features (include following sound-tars)
+ cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts
+
+ # add additional sounds
+ cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz $(DIR_APP)/sounds/
+ cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/
+
+ # Fix wrong cpu optimization (march=armv5tel)
+ cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts
+
+ # Add armv5te to gsm codecs
+ cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile
+
+ # compile and install
+ cd $(DIR_APP) && make $(MAKETUNING) all
+ cd $(DIR_APP) && make install
+ cd $(DIR_APP) && make samples
+
+ # add german sounds and remove README.txt
+ tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
+ -rm -f /var/lib/asterisk/sounds/README.txt
+
+ # remove build directories
+ @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
+
+ # copy additional ipfire scripts for asterisk
+ -mkdir -p /var/ipfire/asterisk
+ cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
+ chmod o+w /var/ipfire/asterisk
+ chown nobody:nobody -R /var/ipfire/asterisk
+ ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh
+
+ # build and install chan capi (needed for isdn)
+ cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tgz
+ cd $(DIR_SRC)/chan-capi-HEAD && sed -i -e 's/^CFLAGS+=-Wno-unused-but-set-variable$$//' Makefile
+ cd $(DIR_SRC)/chan-capi-HEAD && make $(MAKETUNING)
+ cd $(DIR_SRC)/chan-capi-HEAD && make install
+ @rm -rf $(DIR_SRC)/chan-capi-HEAD
+
+ # be sure all source is removed
+ @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
+
+ # remember backup-location
+ install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
+
+ # generate softlink (or asterisk will not work properly)
+ ln -sf /var/ipfire/asterisk /etc/asterisk
+
+ # make asterisk start with reboot
+ ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
+ ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
+ ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
+
+ # all done