Permalink
Browse files

moved confs out of the backup system, there are too many and they sho…

…uld be packages separately. Went to a symlink as /etc/freeswitch, handled in the .install file
  • Loading branch information...
1 parent 5d3d984 commit c194166e60279a97958ae2972a26958cb7da0458 @bougyman committed Jan 21, 2012
Showing with 36 additions and 66 deletions.
  1. +16 −47 PKGBUILD
  2. +2 −14 Rakefile
  3. +18 −5 freeswitch.install
View
@@ -69,8 +69,8 @@ _disabled_modules=(languages/mod_spidermonkey
# #
pkgname=freeswitch-git
-pkgver=20120110
-pkgrel=2
+pkgver=20120121
+pkgrel=1
pkgdesc="Open Source soft switch (telephony engine) built from a specific, stable git commit tag"
arch=('i686' 'x86_64')
url="http://freeswitch.org"
@@ -142,7 +142,13 @@ build() {
--bindir=/usr/bin --sbindir=/usr/sbin --localstatedir=/var \
--sysconfdir=/etc/freeswitch --datarootdir=/usr/share \
--libexecdir=/usr/lib/freeswitch --libdir=/usr/lib/freeswitch \
- --includedir=/usr/include/freeswitch ${_odbc}
+ --includedir=/usr/include/freeswitch ${_odbc} \
+ --with-recordingsdir=/var/spool/freeswitch/recordings \
+ --with-dbdir=/var/spool/freeswitch/db \
+ --with-pkgconfigdir=/usr/lib/pkgconfig \
+ --with-logfiledir=/var/log/freeswitch \
+ --with-modinstdir=/usr/lib/freeswitch/mod \
+ --with-rundir=/run/freeswitch
# COMPILE
make
@@ -179,19 +185,14 @@ package() {
cd "$pkgdir" # MUY IMPORTANT, $PWD is $pkgdir from here on out
# Mangle freeswitch's installed dirs into a more compliant structure,
# leaving symlinks in their place so freeswitch doesn't notice.
- [ -d var/spool/freeswitch ] || install -D -m 0755 -d var/spool/freeswitch
- [ -d var/log/freeswitch ] || install -D -m 0755 -d var/log/freeswitch
ln -s /var/log/freeswitch var/lib/freeswitch/log
- mv var/lib/freeswitch/db var/spool/freeswitch/ &&
- ln -s /var/spool/freeswitch/db var/lib/freeswitch/db
- mv var/lib/freeswitch/recordings var/spool/freeswitch/ && \
- ln -s /var/spool/freeswitch/recordings var/lib/freeswitch/recordings
+ ln -s /var/spool/freeswitch/db var/lib/freeswitch/db
+ ln -s /var/spool/freeswitch/recordings var/lib/freeswitch/recordings
install -D -m 0755 -d var/spool/freeswitch/storage && \
ln -s /var/spool/freeswitch/storage var/lib/freeswitch/storage
- rm var/lib/freeswitch/mod/*.la 2>/dev/null|| true
- rm usr/lib/freeswitch/*.la 2>/dev/null|| true
- mv var/lib/freeswitch/mod usr/lib/freeswitch/ && \
- ln -s /usr/lib/freeswitch/mod var/lib/freeswitch/mod
+ rm usr/lib/freeswitch/mod/*.la 2>/dev/null|| true
+ rm usr/lib/freeswitch/*.la 2>/dev/null || true
+ ln -s /usr/lib/freeswitch/mod var/lib/freeswitch/mod
install -D "$srcdir/freeswitch.rc.conf" etc/rc.d/freeswitch
install -D -m 0644 "$srcdir/freeswitch.conf.d" etc/conf.d/freeswitch
install -D -m 0644 "$srcdir/README.freeswitch" usr/share/doc/freeswitch/README
@@ -204,8 +205,6 @@ package() {
install -D -m 0755 -d usr/share/doc/freeswitch/examples/conf.default
install -D -m 0755 -d usr/share/doc/freeswitch/examples/conf.archlinux
ln -s /etc/freeswitch var/lib/freeswitch/conf
- install -D -m 0755 -d usr/lib/pkg-config/ && \
- ln -s /usr/lib/freeswitch/pkgconfig/freeswitch.pc usr/lib/pkg-config/freeswitch.pc
cp -a etc/freeswitch/* usr/share/doc/freeswitch/examples/conf.default/
for _mod in ${_enabled_modules[@]};do
@@ -216,12 +215,8 @@ package() {
disable_mod_xml $_mod
done
- cp -a etc/freeswitch/* usr/share/doc/freeswitch/examples/conf.archlinux/
- rm etc/freeswitch/directory/default/101?.xml
- rm etc/freeswitch/directory/default/100[1-9].xml
- rm etc/freeswitch/directory/default/example.com.xml
- rm etc/freeswitch/directory/default/skinny-example.xml
- rm etc/freeswitch/directory/default/brian.xml
+ mv etc/freeswitch/* usr/share/doc/freeswitch/examples/conf.archlinux/
+ rmdir etc/freeswitch
install -D -m 0755 "$srcdir/run.freeswitch" etc/sv/freeswitch/run
install -D -m 0755 "$srcdir/run_log.freeswitch" etc/sv/freeswitch/log/run
install -D -m 0644 "$srcdir/conf_log.freeswitch" etc/sv/freeswitch/log/conf
@@ -232,29 +227,3 @@ md5sums=('f674b302edeb1895bbefcaf7bb8510ca'
'1fc676c6eba5c38af6f77fd3e12a409b'
'e9f0bdde366bca6fd29a9202818f3591'
'e6411d793501c29ec4afd6d54018de1b')
-backup=("etc/freeswitch/autoload_configs/abstraction.conf.xml" "etc/freeswitch/autoload_configs/acl.conf.xml" "etc/freeswitch/autoload_configs/alsa.conf.xml" "etc/freeswitch/autoload_configs/blacklist.conf.xml"
-"etc/freeswitch/autoload_configs/callcenter.conf.xml" "etc/freeswitch/autoload_configs/cdr_csv.conf.xml" "etc/freeswitch/autoload_configs/cdr_mongodb.conf.xml" "etc/freeswitch/autoload_configs/cdr_pg_csv.conf.xml"
-"etc/freeswitch/autoload_configs/cdr_sqlite.conf.xml" "etc/freeswitch/autoload_configs/cepstral.conf.xml" "etc/freeswitch/autoload_configs/cidlookup.conf.xml" "etc/freeswitch/autoload_configs/conference.conf.xml"
-"etc/freeswitch/autoload_configs/console.conf.xml" "etc/freeswitch/autoload_configs/db.conf.xml" "etc/freeswitch/autoload_configs/dialplan_directory.conf.xml" "etc/freeswitch/autoload_configs/dingaling.conf.xml"
-"etc/freeswitch/autoload_configs/directory.conf.xml" "etc/freeswitch/autoload_configs/distributor.conf.xml" "etc/freeswitch/autoload_configs/easyroute.conf.xml" "etc/freeswitch/autoload_configs/enum.conf.xml"
-"etc/freeswitch/autoload_configs/erlang_event.conf.xml" "etc/freeswitch/autoload_configs/event_multicast.conf.xml" "etc/freeswitch/autoload_configs/event_socket.conf.xml" "etc/freeswitch/autoload_configs/fax.conf.xml"
-"etc/freeswitch/autoload_configs/fifo.conf.xml" "etc/freeswitch/autoload_configs/hash.conf.xml" "etc/freeswitch/autoload_configs/httapi.conf.xml" "etc/freeswitch/autoload_configs/http_cache.conf.xml"
-"etc/freeswitch/autoload_configs/ivr.conf.xml" "etc/freeswitch/autoload_configs/java.conf.xml" "etc/freeswitch/autoload_configs/lcr.conf.xml" "etc/freeswitch/autoload_configs/local_stream.conf.xml"
-"etc/freeswitch/autoload_configs/logfile.conf.xml" "etc/freeswitch/autoload_configs/lua.conf.xml" "etc/freeswitch/autoload_configs/memcache.conf.xml" "etc/freeswitch/autoload_configs/modules.conf.xml"
-"etc/freeswitch/autoload_configs/mongo.conf.xml" "etc/freeswitch/autoload_configs/nibblebill.conf.xml" "etc/freeswitch/autoload_configs/opal.conf.xml" "etc/freeswitch/autoload_configs/osp.conf.xml"
-"etc/freeswitch/autoload_configs/perl.conf.xml" "etc/freeswitch/autoload_configs/pocketsphinx.conf.xml" "etc/freeswitch/autoload_configs/portaudio.conf.xml" "etc/freeswitch/autoload_configs/post_load_modules.conf.xml"
-"etc/freeswitch/autoload_configs/presence_map.conf.xml" "etc/freeswitch/autoload_configs/python.conf.xml" "etc/freeswitch/autoload_configs/redis.conf.xml" "etc/freeswitch/autoload_configs/rss.conf.xml"
-"etc/freeswitch/autoload_configs/rtmp.conf.xml" "etc/freeswitch/autoload_configs/sangoma_codec.conf.xml" "etc/freeswitch/autoload_configs/shout.conf.xml" "etc/freeswitch/autoload_configs/skinny.conf.xml"
-"etc/freeswitch/autoload_configs/sofia.conf.xml" "etc/freeswitch/autoload_configs/spandsp.conf.xml" "etc/freeswitch/autoload_configs/spidermonkey.conf.xml" "etc/freeswitch/autoload_configs/switch.conf.xml"
-"etc/freeswitch/autoload_configs/syslog.conf.xml" "etc/freeswitch/autoload_configs/timezones.conf.xml" "etc/freeswitch/autoload_configs/tts_commandline.conf.xml" "etc/freeswitch/autoload_configs/unicall.conf.xml"
-"etc/freeswitch/autoload_configs/unimrcp.conf.xml" "etc/freeswitch/autoload_configs/voicemail.conf.xml" "etc/freeswitch/autoload_configs/voicemail_ivr.conf.xml" "etc/freeswitch/autoload_configs/xml_cdr.conf.xml"
-"etc/freeswitch/autoload_configs/xml_curl.conf.xml" "etc/freeswitch/autoload_configs/xml_rpc.conf.xml" "etc/freeswitch/autoload_configs/zeroconf.conf.xml" "etc/freeswitch/chatplan/default.xml"
-"etc/freeswitch/dialplan/default/00_ladspa.xml" "etc/freeswitch/dialplan/default/01_Talking_Clock.xml" "etc/freeswitch/dialplan/default.xml" "etc/freeswitch/dialplan/features.xml"
-"etc/freeswitch/dialplan/public/00_inbound_did.xml" "etc/freeswitch/dialplan/public.xml" "etc/freeswitch/dialplan/skinny-patterns/20-Local_extension.xml" "etc/freeswitch/dialplan/skinny-patterns/90-External.xml"
-"etc/freeswitch/dialplan/skinny-patterns/99-Default_Drop.xml" "etc/freeswitch/dialplan/skinny-patterns.xml" "etc/freeswitch/directory/default/1000.xml" "etc/freeswitch/directory/default/default.xml"
-"etc/freeswitch/directory/default.xml" "etc/freeswitch/extensions.conf" "etc/freeswitch/freeswitch.xml" "etc/freeswitch/fur_elise.ttml"
-"etc/freeswitch/jingle_profiles/client.xml" "etc/freeswitch/jingle_profiles/server.xml" "etc/freeswitch/mime.types" "etc/freeswitch/mrcp_profiles/loquendo-7-mrcp-v2.xml"
-"etc/freeswitch/mrcp_profiles/nuance-1.0.0-mrcp-v1.xml" "etc/freeswitch/mrcp_profiles/nuance-5.0-mrcp-v1.xml" "etc/freeswitch/mrcp_profiles/nuance-5.0-mrcp-v2.xml" "etc/freeswitch/mrcp_profiles/unimrcpserver-mrcp-v1.xml"
-"etc/freeswitch/mrcp_profiles/voxeo-prophecy-8.0-mrcp-v1.xml" "etc/freeswitch/notify-voicemail.tpl" "etc/freeswitch/sip_profiles/external.xml" "etc/freeswitch/sip_profiles/internal-ipv6.xml"
-"etc/freeswitch/sip_profiles/internal.xml" "etc/freeswitch/skinny_profiles/internal.xml" "etc/freeswitch/tetris.ttml" "etc/freeswitch/vars.xml"
-"etc/freeswitch/voicemail.tpl" "etc/freeswitch/web-vm.tpl")
View
@@ -10,25 +10,13 @@ task :md5 do
end
task :build_package => [:md5] do
- `makepkg -sf >&2` unless File.file?("pkg/etc/freeswitch/vars.xml")
+ `makepkg -sf >&2` unless File.file?("pkg/etc/sv/freeswitch/run")
end
-task :repackage => [:make_pkgbuild] do
+task :repackage => [:build_package] do
`makepkg -Rf >&2`
end
-task :make_pkgbuild => [:build_package] do
- files = Find.find("pkg/etc/freeswitch").entries.select do |f|
- f.match(%r{default\.xml$|1000\.xml}) ||
- !f.match(%r{/lang/|/directory/default|/[dD]emo|[dD]emo\.|example}) && File.file?(f)
- end.map { |n| n.sub(%r{pkg/},'') }
- old_pkgbuild = File.readlines("PKGBUILD")
- backup_index = old_pkgbuild.index { |line| line.match /^\s*backup=/ } || 0
- lines = old_pkgbuild[0 .. backup_index-1]
- lines << "backup=(#{files.each_slice(4).map { |line| line.map { |n| %Q{"#{n}"}}.join(" ") }.join("\n")})"
- File.open("PKGBUILD","w") { |f| f.puts lines.join }
-end
-
task :release do
`makepkg --source`
end
View
@@ -12,25 +12,38 @@ pre_install() {
}
post_install() {
- cp -a /usr/share/doc/freeswitch/examples/conf.archlinux/* /etc/freeswitch/
- chown -R freeswitch:freeswitch /etc/freeswitch
echo "FreeSWITCH is installed!"
echo "<<<WARNING>>> You MUST change the default_password in /etc/freeswitch/vars.xml
Failure to do so will leave your default extension 1000 vulnerable"
+ echo "FreeSWITCH's default configuration is available in
+ /usr/share/doc/freeswitch/examples/conf.default, with this package's modified
+ version in /usr/share/doc/freeswitch/examples/conf.archlinux"
post_upgrade
}
post_upgrade() {
+ if [ -d /etc/freeswitch ];then
+ echo "Moving your old configs (/etc/freeswitch) to /usr/share/freeswitch/conf/local"
+ mv /etc/freeswitch /usr/share/freeswitch/conf/local
+ ln -s /usr/share/freeswitch/conf/local /etc/freeswitch
+ fi
+ [ -d /usr/share/freeswitch/conf/pbx ] || cp -a /usr/share/doc/freeswitch/conf.archlinux/ /usr/share/freeswitch/conf/pbx
+ chown -R freeswitch:freeswitch /usr/share/freeswitch/conf/pbx
+ if [ ! -L /etc/freeswitch ];then
+ echo "Linking /usr/share/freeswitch/conf/pbx to /etc/freeswitch"
+ ln -s /usr/share/freeswitch/conf/pbx /etc/freeswitch
+ fi
chown -R freeswitch:freeswitch /var/{run,spool,log}/freeswitch
- echo "FreeSWITCH's default configuration is available in
- /usr/share/doc/freeswitch/examples/conf.default, with this package's modified
- version in /usr/share/doc/freeswitch/examples/conf.archlinux"
+ chown -R freeswitch:freeswitch /etc/sv/freeswitch
+ echo "The running configuration directory is symlinked as /etc/freeswitch"
echo
echo "FreeSWITCH can be started with rc.d freeswitch start or /etc/sv/freeswitch/run"
echo "To start on boot add freeswitch to /etc/rc.conf or supervise the /etc/sv/freeswitch directory"
}
post_remove() {
+ rm /etc/freeswitch
+ echo "Not removing /usr/share/freeswitch/conf/ config directories!! If you do not want to keep them, rm -rf them away"
userdel freeswitch
getent group freeswitch &> /dev/null && groupdel freeswitch
true

0 comments on commit c194166

Please sign in to comment.