Found in "gnokii-working" directory, some November-patches version
[gnokii.git] / packaging / Debian / rules
index b48eee8..d964aae 100755 (executable)
@@ -1,16 +1,25 @@
 #!/usr/bin/make -f
 
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
+export DH_COMPAT=3
+
+export build_dir=$(shell pwd)/debian/gnokii
 
 build: build-stamp
 build-stamp:
        dh_testdir
+#      if [ ! -f ./configure ] ; then autoconf ; fi
        ./configure --prefix=/usr --with-x
+#      ./configure --prefix=/usr --with-x --enable-debug --enable-xdebug --enable-rlpdebug
        make
+       touch build
+       touch build-stamp
 
 clean:
        dh_testdir
        dh_testroot
+       rm -f build build-stamp config.*
+       touch Makefile.global
        make clean
        dh_clean
 
@@ -26,27 +35,44 @@ binary-arch:        build
        dh_testdir
        dh_testroot
        dh_installdirs
-       make install prefix=`pwd`/debian/tmp/usr
-       mkdir -p `pwd`/debian/tmp/etc/
-       sed 's#/usr/local/sbin/#/usr/sbin/#' < Docs/sample/gnokiirc > `pwd`/debian/tmp/etc/gnokiirc
+# The following two lines are to prevent the install process from installing
+# mgnokiidev owned by the probably not-yet-existing group "gnokii".  mgnokiidev
+# gets SGID after dpkg runs preinst which creates the group "gnokii".
+       mv utils/Makefile utils/Makefile.ORIG
+       sed 's#-o root -g gnokii -m 4750 ##' < utils/Makefile.ORIG > utils/Makefile
+#      
+       make install prefix=$(build_dir)/usr
+#
+# just to leave the sources in a pristine state...
+       mv utils/Makefile.ORIG utils/Makefile
+#
+       mkdir -p $(build_dir)/etc
+       sed 's#/usr/local/sbin/#/usr/sbin/#' < Docs/sample/gnokiirc > $(build_dir)/etc/gnokiirc
+# lintian complains if there are multiple licence files in one package, hence
+# the next two commands
+       sed 's#"COPYING"#"file:/usr/share/doc/gnokii/copyright"#' < \
+               xgnokii/docs/help/en_US/faq.html > \
+               $(build_dir)/usr/share/xgnokii/help/en_US/faq.html
+       rm -f $(build_dir)/usr/share/xgnokii/help/en_US/COPYING
+# lintian complains if there is a binary that does not have a man page.
+# Pawel says that xlogos will soon be dumped anyways, so...
+       rm -f $(build_dir)/usr/bin/xlogos
 #      dh_installdebconf       
-#      dh_installexamples
+       dh_installexamples
        dh_installdocs
        dh_installmenu
 #      dh_installemacsen
 #      dh_installpam
 #      dh_installinit
 #      dh_installcron
-#      dh_installmanpages
-       dh_installinfo
+       dh_installman
+#      dh_installinfo
 #      dh_undocumented
        dh_installchangelogs
        dh_link
        dh_strip
        dh_compress
        dh_fixperms
-       # You may want to make some executables suid here.
-       dh_suidregister
 #      dh_makeshlibs
        dh_installdeb
 #      dh_perl