[debian-edu-commits] debian-edu/ 35/183: - Added debhelper like file for installing .listing files - Various small changes to the documentation - Updated packaging to include and use dh_installlisting

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit 7b195ebfa1c5486a5adc9747efdf3c366e476180
Author: Bart Cornelis <cobaco at linux.be>
Date:   Tue Dec 28 08:12:30 2004 +0000

    - Added debhelper like file for installing .listing files
    - Various small changes to the documentation
    - Updated packaging to include and use dh_installlisting
---
 Makefile                          |  7 ++++
 debian/changelog                  |  6 ++-
 default.listing => debian/listing |  0
 debian/rules                      |  9 +++--
 desktop-profiles.7                |  3 +-
 dh_installlisting                 | 84 +++++++++++++++++++++++++++++++++++++++
 list-desktop-profiles.1           |  4 +-
 listingmodule                     | 12 ++++--
 8 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b5aa8db
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+
+documentation:
+	pod2man dh_installlisting > dh_installlisting.1
+
+clean: 
+	if(test -e dh_installlisting.1); then rm dh_installlisting.1; fi;  
diff --git a/debian/changelog b/debian/changelog
index 1bfdf9e..0e0359d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,10 @@
-desktop-profiles (1.2.-1) unreleased; urgency=low
+desktop-profiles (1.2-1) unstable; urgency=low
 
   * Added kommander GUI for managing the /etc/desktop-profiles/*.listing files
+  * Added debhelper program for installing .listing files
+  * Follow own recommendation on naming of .listing files
 
- -- Bart Cornelis (cobaco) <cobaco at linux.be>  Tue,  7 Dec 2004 22:45:45 +0100
+ -- Bart Cornelis (cobaco) <cobaco at linux.be>  Mon, 27 Dec 2004 21:31:23 +0100
 
 desktop-profiles (1.1-2) unstable; urgency=low
 
diff --git a/default.listing b/debian/listing
similarity index 100%
rename from default.listing
rename to debian/listing
diff --git a/debian/rules b/debian/rules
index 7a53270..d8b7a71 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,7 @@ clean:
 	dh_testdir
 	dh_testroot
 	# Add here commands to clean up after the build process.
+	make clean
 	dh_clean 
 
 install: build
@@ -28,18 +29,20 @@ install: build
 # Build architecture-independent files here.
 binary-indep: build install
 	dh_testdir
-	dh_testroot
+	dh_testroot	
+	make
 	dh_installchangelogs
 	dh_installdocs
 	dh_installmenu
 	dh_installexamples path
-	dh_installman desktop-profiles.7 list-desktop-profiles.1
+	dh_installman desktop-profiles.7 list-desktop-profiles.1 dh_installlisting.1
+	dh_install dh_installlisting usr/bin
 	dh_install listingmodule usr/share/desktop-profiles/
 	dh_install list-desktop-profiles usr/bin/
 	dh_install profile-manager.kmdr usr/share/desktop-profiles/kommander-scripts/
 	dh_install desktop-profiles etc/default
 	dh_install 20desktop-profiles_activateDesktopProfiles etc/X11/Xsession.d/
-	dh_install default.listing etc/desktop-profiles/
+	./dh_installlisting
 	dh_installdebconf
 	dh_compress
 	dh_fixperms
diff --git a/desktop-profiles.7 b/desktop-profiles.7
index 9209332..e41bad3 100644
--- a/desktop-profiles.7
+++ b/desktop-profiles.7
@@ -13,7 +13,7 @@ below).
 .SH HOW IT WORKS
 All available profiles are described in .listing files placed in /etc/desktop-profiles. These files contain basic information about the profiles such as the name of the profile, where to access the profile, and which criteria need to be met to activate the profile (see 
 .B "FORMAT OF .listing FILES"
-below).
+below), listing files installed by packages should be named <packagename>.listing, or <packagename>_<something>.listing (there's a debhelper script to easy that :)
 .PP
 On X startup an Xsession.d script is run that activates all profiles for which the criteria are met in order of precedence.
 .PP
@@ -139,3 +139,4 @@ This manual page was written by Bart Cornelis <cobaco at skolelinux.no>.
 
 .SH SEE ALSO
 list-desktop-profiles(1)
+dh_installlisting(1)
diff --git a/dh_installlisting b/dh_installlisting
new file mode 100755
index 0000000..e32a085
--- /dev/null
+++ b/dh_installlisting
@@ -0,0 +1,84 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_installlisting - install .listing files to be used by desktop-profiles package
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_installlisting> [S<B<debhelper options>>] [S<B<filename(s)>>]
+
+=head1 DESCRIPTION
+
+dh_installlisting is a debhelper program that handles installing listing files
+used by the desktop-profiles package into the correct location in package
+builddirectories (NOTE: this command is provided by the desktop-profiles 
+package, so don't forget to build-depends on it). 
+
+If a file named debian/package.listing exists (or debian/listing in case of the 
+main package) it is installed in etc/desktop-profiles. In addition any files 
+given as argument will be installed in etc/desktop-profiles as 
+package_file.listing. The format of .listing files is described in 
+L<desktop-profiles(7)>.
+
+A dependancy on desktop-profiles will be added to misc:Depends by using this 
+script.
+
+=cut
+
+init();
+
+foreach my $package (@{$dh{DOPACKAGES}}) {
+  my $tmp=tmpdir($package);
+	
+  # Add the debian/listing (or debian/$package.listing) if present
+  my $debDirListing=pkgfile($package,"listing");
+  my @listings=$debDirListing;
+
+  # Add further listing files given as arguments if present
+  if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
+	push @listings, @ARGV;
+  }
+	
+  # if we have listings to install
+  if ("@listings" ne '') {
+    # make sure the directory we need exists
+    if (! -d "$tmp/etc/desktop-profiles") {
+      doit("install","-d","$tmp/etc/desktop-profiles");
+    }
+
+    # install each listing file 
+    # (making sure not to double '.listing' nor the packagename)
+    foreach my $file (@listings) {
+      my $installName=basename($file);
+      $installName=~s/(.*)\.listing$/$1/;
+      if ( ("$installName" ne 'listing') && ("$installName" ne "$package") ){
+        $installName=~s/^/_/;
+        doit("install","-p","-m644",$file,"$tmp/etc/desktop-profiles/$package$installName.listing");
+      } else {
+        doit("install","-p","-m644",$file,"$tmp/etc/desktop-profiles/$package.listing");
+      }
+    }
+  }  
+	
+  # Add desktop-profiles to the dependencies if necesary
+  if ($package ne 'desktop-profiles') {
+    addsubstvar($package, "misc:Depends", "desktop-profiles (>= 1.2)");
+  }
+}
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+L<desktop-profiles(7)>
+
+=head1 AUTHOR
+
+Bart Cornelis  (cobaco) <cobaco at linux.be>
+
+=cut
diff --git a/list-desktop-profiles.1 b/list-desktop-profiles.1
index d3d676a..0baf0c1 100644
--- a/list-desktop-profiles.1
+++ b/list-desktop-profiles.1
@@ -1,7 +1,7 @@
-.TH LIST-DESKTOP-PROFILES 7 "November 11, 2004" "desktop-profiles"
+.TH LIST-DESKTOP-PROFILES 1 "November 11, 2004" "desktop-profiles"
 
 .SH NAME
-list-desktop-profiles \- list profiles meeting specific criteria
+list-desktop-profiles \- list known profiles that meet given criteria
 
 .SH SYNOPSIS
 list-desktop-profiles [OPTION]
diff --git a/listingmodule b/listingmodule
index 2d1ddff..5ab47b2 100644
--- a/listingmodule
+++ b/listingmodule
@@ -3,12 +3,18 @@
 # This is a shell library containing utility functions the scripts in the 
 # desktop-profiles package. This library currently contains the following 
 # functions (see the comments with each function for more info):
-#    - test_requirement: takes a requirement and (optionally) a username
+#    - test_requirement: takes a requirement and (optionally) a username, 
+#                        exit code indicates wether the requirement is met
 #    - test_profile_requirements: takes a profile's line (from the .listing
-#                                 file), and (optionally) a username
+#                                 file), and (optionally) a username, exit
+#                                 code indicates wether the requirements are
+#                                 met
+#    - for_each_requirement: first argument is a list of requirements, second
+#                            argument is a command to be executed once for 
+#                            each requirement (with requirement as argument)
 #    - filter_listings: returns matching profiles from the available listing
 #                       files (output influenced by a number of environment
-#                       variables)
+#                       variables, see below for a list)
 # 
 # See desktop-profiles (7) for more information about using profiles through
 # desktop-profiles and the format of the .listing files

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list