[SCM] crtmpserver/master: Move apps conf files to proper location.

jet-guest at users.alioth.debian.org jet-guest at users.alioth.debian.org
Sun Apr 29 18:23:31 UTC 2012


The following commit has been merged in the master branch:
commit aa66cd1cb8a0ef0925aef79206ada92d1020340e
Author: Andriy Beregovenko <jet at jet.kiev.ua>
Date:   Sun Apr 29 20:09:36 2012 +0300

    Move apps conf files to proper location.
    
    Move crtmpserver-apps conf scripts to /usr/share/crtmpserver-apps due to
    Debian Policy 10.7.3. Made corresponding fixes in inst and rm scripts.

diff --git a/debian/crtmpserver-apps.dirs b/debian/crtmpserver-apps.dirs
index a47796c..86820c6 100644
--- a/debian/crtmpserver-apps.dirs
+++ b/debian/crtmpserver-apps.dirs
@@ -1,2 +1,3 @@
 etc/crtmpserver/applications
 etc/crtmpserver/conf.d
+usr/lib/crtmpserver/applications
diff --git a/debian/crtmpserver-apps.examples b/debian/crtmpserver-apps.examples
deleted file mode 100644
index 8c35fb6..0000000
--- a/debian/crtmpserver-apps.examples
+++ /dev/null
@@ -1,10 +0,0 @@
-debian/crtmpserver-apps-scripts/admin.lua
-debian/crtmpserver-apps-scripts/applestreamingclient.lua
-debian/crtmpserver-apps-scripts/appselector.lua
-debian/crtmpserver-apps-scripts/flvplayback.lua
-debian/crtmpserver-apps-scripts/proxypublish.lua
-debian/crtmpserver-apps-scripts/samplefactory.lua
-debian/crtmpserver-apps-scripts/stresstest.lua
-debian/crtmpserver-apps-scripts/vptests.lua
-debian/crtmpserver-apps-scripts/conf.d/users.lua
-debian/crtmpserver-apps-scripts/enabled_applications.conf
diff --git a/debian/crtmpserver-apps.install b/debian/crtmpserver-apps.install
index c46c72f..294adf9 100644
--- a/debian/crtmpserver-apps.install
+++ b/debian/crtmpserver-apps.install
@@ -1,4 +1,3 @@
-usr/lib/crtmpserver/applications
 usr/lib/crtmpserver/applications/admin/libadmin.so
 usr/lib/crtmpserver/applications/applestreamingclient/libapplestreamingclient.so
 usr/lib/crtmpserver/applications/appselector/libappselector.so
@@ -7,3 +6,4 @@ usr/lib/crtmpserver/applications/proxypublish/libproxypublish.so
 usr/lib/crtmpserver/applications/samplefactory/libsamplefactory.so
 usr/lib/crtmpserver/applications/stresstest/libstresstest.so
 usr/lib/crtmpserver/applications/vptests/libvptests.so
+debian/crtmpserver-apps-scripts/*	usr/share/crtmpserver-apps
diff --git a/debian/crtmpserver-apps.postinst b/debian/crtmpserver-apps.postinst
index 7b367a5..0ee8ced 100644
--- a/debian/crtmpserver-apps.postinst
+++ b/debian/crtmpserver-apps.postinst
@@ -8,26 +8,23 @@ case "$1" in
 	configure)
 		# Copy application config if not exists
 		for app in $APPLICATIONS; do
-			if [ ! -f /etc/crtmpserver/applications/${app}.lua ]
-			then
-				cp /usr/share/doc/crtmpserver-apps/examples/${app}.lua \
+			if [ ! -f /etc/crtmpserver/applications/${app}.lua ]; then
+				cp /usr/share/crtmpserver-apps/${app}.lua \
 					/etc/crtmpserver/applications/${app}.lua
 				chmod 644 /etc/crtmpserver/applications/${app}.lua
 			fi
 		done
 
 		# copy users sample file if not exists
-		if [ ! -f /etc/crtmpserver/conf.d/users.lua ]
-		then
-			cp /usr/share/doc/crtmpserver-apps/examples/users.lua \
+		if [ ! -f /etc/crtmpserver/conf.d/users.lua ]; then
+			cp /usr/share/crtmpserver-apps/conf.d/users.lua \
 				/etc/crtmpserver/conf.d/users.lua
 			chmod 640 /etc/crtmpserver/conf.d/users.lua
 		fi
 
 		# Add all application as part of default install
-		if [ ! -f /etc/crtmpserver/enabled_applications.conf ]
-		then
-			cp /usr/share/doc/crtmpserver-apps/examples/enabled_applications.conf \
+		if [ ! -f /etc/crtmpserver/enabled_applications.conf ]; then
+			cp /usr/share/crtmpserver-apps/enabled_applications.conf \
 				/etc/crtmpserver
 			chmod 644 /etc/crtmpserver/enabled_applications.conf
 		fi
diff --git a/debian/crtmpserver-apps.postrm b/debian/crtmpserver-apps.prerm
similarity index 54%
rename from debian/crtmpserver-apps.postrm
rename to debian/crtmpserver-apps.prerm
index 361ccea..b0f3d1c 100644
--- a/debian/crtmpserver-apps.postrm
+++ b/debian/crtmpserver-apps.prerm
@@ -15,29 +15,37 @@ do_remove() {
 	for app in $APPLICATIONS; do
 		if [ -f "/etc/crtmpserver/applications/$app.lua" ]; then
 			compare "/etc/crtmpserver/applications/$app.lua" \
-				"/usr/share/doc/crtmpserver-apps/examples/$app.lua" \
-				&& rm "/etc/crtmpserver/applications/$app.lua"
+				"/usr/share/crtmpserver-apps/$app.lua" \
+				&& rm -f "/etc/crtmpserver/applications/$app.lua"
 		fi
 	done
-	rmdir /etc/crtmpserver/applications
 
 	if [ -f "/etc/crtmpserver/conf.d/users.lua" ]; then
 		compare "/etc/crtmpserver/conf.d/users.lua" \
-			"/usr/share/doc/crtmpserver-apps/examples/users.lua" \
-			&& rm /etc/crtmpserver/conf.d/users.lua
+			"/usr/share/crtmpserver-apps/conf.d/users.lua" \
+			&& rm -f "/etc/crtmpserver/conf.d/users.lua"
 	fi
-	rmdir /etc/crtmpserver/conf.d
 
 	if [ -f /etc/crtmpserver/enabled_applications.conf ]; then
 		compare "/etc/crtmpserver/enabled_applications.conf" \
-			"/usr/share/doc/crtmpserver-apps/examples/enabled_applications.conf" \
-			&& rm /etc/crtmpserver/enabled_applications.conf
+			"/usr/share/crtmpserver-apps/enabled_applications.conf" \
+			&& rm -f /etc/crtmpserver/enabled_applications.conf
 	fi
-	rmdir /etc/crtmpserver
+
+	return 0
 }
 
 do_purge() {
-	rm -r /etc/crtmpserver || exit 1
+	for app in $APPLICATIONS; do
+		[ -f "/etc/crtmpserver/applications/$app.lua" ] && \
+			rm -f "/etc/crtmpserver/applications/$app.lua"
+	done
+	[ -f "/etc/crtmpserver/conf.d/users.lua" ] && \
+		rm -f "/etc/crtmpserver/conf.d/users.lua"
+	[ -f "/etc/crtmpserver/enabled_applications.conf" ] && \
+		rm -f "/etc/crtmpserver/enabled_applications.conf"
+
+	return 0
 }
 
 

-- 
crtmpserver packaging



More information about the pkg-multimedia-commits mailing list