Browse code

* Core: Changed sip-router to $(MAIN_NAME) in Makefile.

Juha Heinanen authored on 24/06/2009 19:49:26
Showing 1 changed files
... ...
@@ -89,8 +89,8 @@ include Makefile.targets
89 89
 #  an utility fails
90 90
 err_fail?=1
91 91
 
92
-# whether or not to install sip-router.cfg or just sip-router.cfg.default
93
-# (sip-router.cfg will never be overwritten by make install, this is usefull
92
+# whether or not to install $(MAIN_NAME).cfg or just $(MAIN_NAME).cfg.default
93
+# ($(MAIN_NAME).cfg will never be overwritten by make install, this is usefull
94 94
 #  when creating packages)
95 95
 skip_cfg_install?=
96 96
 
... ...
@@ -345,7 +345,7 @@ utils_bin_install=	utils/gen_ha1/gen_ha1 utils/sercmd/sercmd
345 345
 utils_script_install=
346 346
 
347 347
 # This is the list of files to be installed into the arch-independent
348
-# shared directory (by default /usr/local/share/sip-router)
348
+# shared directory (by default /usr/local/share/$(MAIN_NAME))
349 349
 share_install= scripts/mysql/my_create.sql \
350 350
 			   scripts/mysql/my_data.sql   \
351 351
 			   scripts/mysql/my_drop.sql
... ...
@@ -632,9 +632,9 @@ tar:
632 632
 	$(TAR) -C .. \
633 633
 		--exclude=$(notdir $(CURDIR))/test* \
634 634
 		--exclude=$(notdir $(CURDIR))/tmp* \
635
-		--exclude=$(notdir $(CURDIR))/debian/sip-router \
636
-		--exclude=$(notdir $(CURDIR))/debian/sip-router-* \
637
-		--exclude=$(notdir $(CURDIR))/sip-router_tls* \
635
+		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME) \
636
+		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME)-* \
637
+		--exclude=$(notdir $(CURDIR))/$(MAIN_NAME)_tls* \
638 638
 		--exclude=CVS* \
639 639
 		--exclude=.svn* \
640 640
 		--exclude=.cvsignore \
... ...
@@ -646,7 +646,7 @@ tar:
646 646
 		--exclude=*.[do] \
647 647
 		--exclude=*.so \
648 648
 		--exclude=*.il \
649
-		--exclude=$(notdir $(CURDIR))/sip-router \
649
+		--exclude=$(notdir $(CURDIR))/$(MAIN_NAME) \
650 650
 		--exclude=*.gz \
651 651
 		--exclude=*.bz2 \
652 652
 		--exclude=*.tar \
... ...
@@ -667,10 +667,10 @@ tar:
667 667
 # binary dist. tar.gz
668 668
 .PHONY: bin
669 669
 bin:
670
-	mkdir -p tmp/sip-router/usr/local
671
-	$(MAKE) install basedir=tmp/sip-router $(mk_params)
672
-	$(TAR) -C tmp/sip-router/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
673
-	rm -rf tmp/sip-router
670
+	mkdir -p tmp/$(MAIN_NAME)/usr/local
671
+	$(MAKE) install basedir=tmp/$(MAIN_NAME) $(mk_params)
672
+	$(TAR) -C tmp/$(MAIN_NAME)/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
673
+	rm -rf tmp/$(MAIN_NAME)
674 674
 
675 675
 .PHONY: deb
676 676
 deb:
... ...
@@ -684,18 +684,18 @@ deb:
684 684
 
685 685
 .PHONY: sunpkg
686 686
 sunpkg:
687
-	mkdir -p tmp/sip-router
688
-	mkdir -p tmp/sip-router_sun_pkg
689
-	$(MAKE) install basedir=tmp/sip-router prefix=/usr/local $(mk_params)
687
+	mkdir -p tmp/$(MAIN_NAME)
688
+	mkdir -p tmp/$(MAIN_NAME)_sun_pkg
689
+	$(MAKE) install basedir=tmp/$(MAIN_NAME) prefix=/usr/local $(mk_params)
690 690
 	(cd pkg/solaris; \
691
-	pkgmk -r ../../tmp/sip-router/usr/local -o -d ../../tmp/sip-router_sun_pkg/ -v "$(RELEASE)" ;\
691
+	pkgmk -r ../../tmp/$(MAIN_NAME)/usr/local -o -d ../../tmp/$(MAIN_NAME)_sun_pkg/ -v "$(RELEASE)" ;\
692 692
 	cd ../..)
693 693
 	cat /dev/null > ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local
694
-	pkgtrans -s tmp/sip-router_sun_pkg/ ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local \
695
-		IPTELsip-router
694
+	pkgtrans -s tmp/$(MAIN_NAME)_sun_pkg/ ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local \
695
+		IPTEL$(MAIN_NAME)
696 696
 	gzip -9 ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local
697
-	rm -rf tmp/sip-router
698
-	rm -rf tmp/sip-router_sun_pkg
697
+	rm -rf tmp/$(MAIN_NAME)
698
+	rm -rf tmp/$(MAIN_NAME)_sun_pkg
699 699
 
700 700
 
701 701
 .PHONY: install
... ...
@@ -705,8 +705,8 @@ install: install-bin install-every-module install-cfg \
705 705
 
706 706
 .PHONY: dbinstall
707 707
 dbinstall:
708
-	-@echo "Initializing sip-router database"
709
-	scripts/mysql/sip-router_mysql.sh create
708
+	-@echo "Initializing $(MAIN_NAME) database"
709
+	scripts/mysql/$(MAIN_NAME)_mysql.sh create
710 710
 	-@echo "Done"
711 711
 
712 712
 .PHONY: README
... ...
@@ -750,32 +750,32 @@ $(man_prefix)/$(man_dir)/man5:
750 750
 # note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...) 
751 751
 install-cfg: $(cfg_prefix)/$(cfg_dir)
752 752
 		sed $(foreach m,$(modules_dirs),\
753
-				-e "s#/usr/[^:]*lib/sip-router/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
754
-			< etc/sip-router-basic.cfg > $(cfg_prefix)/$(cfg_dir)sip-router.cfg.sample
755
-		chmod 644 $(cfg_prefix)/$(cfg_dir)sip-router.cfg.sample
753
+				-e "s#/usr/[^:]*lib/$(MAIN_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
754
+			< etc/$(MAIN_NAME)-basic.cfg > $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample
755
+		chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample
756 756
 		if [ -z "${skip_cfg_install}" -a \
757
-				! -f $(cfg_prefix)/$(cfg_dir)sip-router.cfg ]; then \
758
-			mv -f $(cfg_prefix)/$(cfg_dir)sip-router.cfg.sample \
759
-				$(cfg_prefix)/$(cfg_dir)sip-router.cfg; \
757
+				! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg ]; then \
758
+			mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample \
759
+				$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg; \
760 760
 		fi
761 761
 		sed $(foreach m,$(modules_dirs),\
762
-			-e "s#/usr/[^:]*lib/sip-router/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
763
-			< etc/sip-router-oob.cfg \
764
-			> $(cfg_prefix)/$(cfg_dir)sip-router-advanced.cfg.sample
765
-		chmod 644 $(cfg_prefix)/$(cfg_dir)sip-router-advanced.cfg.sample
762
+			-e "s#/usr/[^:]*lib/$(MAIN_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
763
+			< etc/$(MAIN_NAME)-oob.cfg \
764
+			> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample
765
+		chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample
766 766
 		if [ -z "${skip_cfg_install}" -a \
767
-				! -f $(cfg_prefix)/$(cfg_dir)sip-router-advanced.cfg ]; then \
768
-			mv -f $(cfg_prefix)/$(cfg_dir)sip-router-advanced.cfg.sample \
769
-				$(cfg_prefix)/$(cfg_dir)sip-router-advanced.cfg; \
767
+				! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg ]; then \
768
+			mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample \
769
+				$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg; \
770 770
 		fi
771 771
 		# radius dictionary
772
-		$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/dictionary.sip-router
773
-		$(INSTALL_CFG) etc/dictionary.sip-router $(cfg_prefix)/$(cfg_dir)
772
+		$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/dictionary.$(MAIN_NAME)
773
+		$(INSTALL_CFG) etc/dictionary.$(MAIN_NAME) $(cfg_prefix)/$(cfg_dir)
774 774
 
775 775
 		# TLS configuration
776 776
 		$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/tls.cfg
777 777
 		$(INSTALL_CFG) modules/tls/tls.cfg $(cfg_prefix)/$(cfg_dir)
778
-		modules/tls/sip-router_cert.sh -d $(cfg_prefix)/$(cfg_dir)
778
+		modules/tls/$(MAIN_NAME)_cert.sh -d $(cfg_prefix)/$(cfg_dir)
779 779
 
780 780
 install-bin: $(bin_prefix)/$(bin_dir) $(NAME)
781 781
 		$(INSTALL_TOUCH) $(bin_prefix)/$(bin_dir)/$(NAME)
... ...
@@ -840,8 +840,8 @@ install-utils: utils $(bin_prefix)/$(bin_dir)
840 840
 	# FIXME: This is a hack, this should be (and will be) done properly in
841 841
     # per-module Makefiles
842 842
 	sed -e "s#^DEFAULT_SCRIPT_DIR.*#DEFAULT_SCRIPT_DIR=\"$(share_prefix)/$(share_dir)\"#g" \
843
-		< scripts/mysql/sip-router_mysql.sh > $(bin_prefix)/$(bin_dir)/sip-router_mysql.sh
844
-	chmod 755 $(bin_prefix)/$(bin_dir)/sip-router_mysql.sh
843
+		< scripts/mysql/$(MAIN_NAME)_mysql.sh > $(bin_prefix)/$(bin_dir)/$(MAIN_NAME)_mysql.sh
844
+	chmod 755 $(bin_prefix)/$(bin_dir)/$(MAIN_NAME)_mysql.sh
845 845
 
846 846
 
847 847
 install-modules-all: install-every-module install-every-module-doc
... ...
@@ -860,21 +860,21 @@ install-doc: $(doc_prefix)/$(doc_dir) install-every-module-doc
860 860
 	$(INSTALL_DOC) README $(doc_prefix)/$(doc_dir)
861 861
 
862 862
 
863
-install-sip-router-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
864
-		sed -e "s#/etc/sip-router/sip-router\.cfg#$(cfg_target)sip-router.cfg#g" \
863
+install-$(MAIN_NAME)-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
864
+		sed -e "s#/etc/$(MAIN_NAME)/$(MAIN_NAME)\.cfg#$(cfg_target)$(MAIN_NAME).cfg#g" \
865 865
 			-e "s#/usr/sbin/#$(bin_target)#g" \
866 866
 			$(foreach m,$(modules_dirs),\
867
-				-e "s#/usr/lib/sip-router/$(m)\([^_]\)#$($(m)_target)\1#g") \
868
-			-e "s#/usr/share/doc/sip-router/#$(doc_target)#g" \
869
-			< sip-router.8 >  $(man_prefix)/$(man_dir)/man8/sip-router.8
870
-		chmod 644  $(man_prefix)/$(man_dir)/man8/sip-router.8
871
-		sed -e "s#/etc/sip-router/sip-router\.cfg#$(cfg_target)sip-router.cfg#g" \
867
+				-e "s#/usr/lib/$(MAIN_NAME)/$(m)\([^_]\)#$($(m)_target)\1#g") \
868
+			-e "s#/usr/share/doc/$(MAIN_NAME)/#$(doc_target)#g" \
869
+			< $(MAIN_NAME).8 >  $(man_prefix)/$(man_dir)/man8/$(MAIN_NAME).8
870
+		chmod 644  $(man_prefix)/$(man_dir)/man8/$(MAIN_NAME).8
871
+		sed -e "s#/etc/$(MAIN_NAME)/$(MAIN_NAME)\.cfg#$(cfg_target)$(MAIN_NAME).cfg#g" \
872 872
 			-e "s#/usr/sbin/#$(bin_target)#g" \
873 873
 			$(foreach m,$(modules_dirs),\
874
-				-e "s#/usr/lib/sip-router/$(m)\([^_]\)#$($(m)_target)\1#g") \
875
-			-e "s#/usr/share/doc/sip-router/#$(doc_target)#g" \
876
-			< sip-router.cfg.5 >  $(man_prefix)/$(man_dir)/man5/sip-router.cfg.5
877
-		chmod 644  $(man_prefix)/$(man_dir)/man5/sip-router.cfg.5
874
+				-e "s#/usr/lib/$(MAIN_NAME)/$(m)\([^_]\)#$($(m)_target)\1#g") \
875
+			-e "s#/usr/share/doc/$(MAIN_NAME)/#$(doc_target)#g" \
876
+			< $(MAIN_NAME).cfg.5 >  $(man_prefix)/$(man_dir)/man5/$(MAIN_NAME).cfg.5
877
+		chmod 644  $(man_prefix)/$(man_dir)/man5/$(MAIN_NAME).cfg.5
878 878
 
879 879
 install-man:  install-sip-router-man install-every-module-man
880 880